N8N Local Setup Guide

A complete beginner-friendly guide to installing and running n8n on your local machine

1 Prerequisites

Node.js

You'll need Node.js (version 14.x or higher) installed on your machine.

node -v
Download Node.js

npm or yarn

You'll need either npm (comes with Node.js) or yarn installed.

npm -v
yarn -v

2 Installation Methods

npm

Install n8n globally using npm (recommended for most users).

npm install n8n -g

yarn

Install n8n globally using yarn (alternative to npm).

yarn global add n8n

Docker

Run n8n in a Docker container (recommended for production).

docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8nio/n8n

Note for Windows Users

If you encounter permission issues on Windows, try running your terminal as Administrator or use the following command:

npm install n8n -g --production --unsafe-perm

3 Running N8N

Start n8n

After installation, you can start n8n with this simple command:

n8n

This will start n8n and make it available at:

http://localhost:5678

First Run Information

On first run, n8n will create configuration files in:

  • Windows: %APPDATA%\n8n
  • macOS/Linux: ~/.n8n

Basic Authentication

For security, it's recommended to set up basic authentication:

n8n --user=YOUR_USERNAME --password=YOUR_PASSWORD

Replace YOUR_USERNAME and YOUR_PASSWORD with your credentials.

Custom Port

If port 5678 is already in use, you can specify a different port:

n8n --port=8080

Replace 8080 with your preferred port number.

4 Accessing the n8n Web Interface

Open n8n in your browser

Once n8n is running, open your web browser and navigate to:

http://localhost:5678

Congratulations! You should now see the n8n web interface.

First-time Setup

When you access n8n for the first time:

  • If you set up authentication, enter your credentials
  • Explore the dashboard and sample workflows
  • Check out the "Workflows" section to create your first automation

Configuration Options

n8n supports many configuration options. Common ones include:

--tunnel - Create a public URL (using localtunnel)
--skip-webhook-registration - Skip webhook registration
--help - See all available options

Frequently Asked Questions

1. Why should I install n8n locally instead of using the cloud version?

Installing n8n locally gives you complete control over your data and workflows. It's especially useful when:

  • You're working with sensitive data
  • You need to connect to internal services that aren't exposed to the internet
  • You want to avoid cloud service limitations or costs
  • You need to customize or extend n8n's functionality

2. I'm getting permission errors during installation. What should I do?

Permission errors typically occur when npm/yarn doesn't have write access to the global installation directory. Try these solutions:

Option 1: Run the command with sudo (Linux/macOS)
sudo npm install n8n -g
Option 2: Fix npm permissions (recommended)
npm config set prefix ~/.npm-global
Then add ~/.npm-global/bin to your PATH
Windows: Run terminal as Administrator

3. How do I keep n8n running after closing the terminal?

When you close your terminal, n8n will stop running. To keep it running in the background:

Linux/macOS

Use nohup:

nohup n8n &

Or use a process manager like pm2:

npm install pm2 -g
pm2 start n8n

Windows

Run as a service or use:

start /B n8n

Or install a process manager like pm2:

npm install pm2 -g
pm2 start n8n

4. How do I update n8n to the latest version?

To update n8n to the latest version, run the same installation command with the -g flag:

npm install n8n -g
yarn global add n8n

After updating, restart n8n to use the new version.

5. Where are my workflows stored?

By default, n8n stores your workflows in the configuration directory:

Windows: %APPDATA%\n8n
macOS/Linux: ~/.n8n

The database file is named database.sqlite and contains all your workflows and credentials.

Additional Resources

Official Documentation

Comprehensive guides and API references

Visit Docs

Community Forum

Get help from the n8n community

Join Community

GitHub Repository

Source code and issue tracking

View on GitHub

YouTube Tutorials

Video guides and walkthroughs

Watch Videos

Sample Workflows

Explore these ready-to-use workflows to get started quickly:

Send Email on Form Submission

Trigger an email when a Google Form is submitted

View Workflow

Slack Notification for New RSS Items

Get Slack notifications for new RSS feed items

View Workflow

Made with DeepSite LogoDeepSite - 🧬 Remix