Introduction
Welcome to this beginner-friendly guide on installing n8n, an open-source workflow automation tool, from scratch across various operating systems. Whether you’re using Windows, macOS, Linux, or prefer Docker, this tutorial will walk you through each step in clear, easy-to-follow instructions.
Prerequisites
Before diving in, make sure you have:
- A stable internet connection
- Basic familiarity with the command line/terminal
- Administrator (or sudo) privileges on your machine
Tip for absolute beginners: The “command line” (Windows PowerShell, macOS Terminal, or Linux shell) is like typing instructions directly to your computer. Don’t worry if it feels unfamiliar—you’ll pick it up quickly!
Installation on Windows
1. Install Node.js (which includes npm)
- Go to the Node.js official download page.
- Download the LTS (Long-Term Support) Windows installer.
- Run the installer and follow the prompts, ensuring Add to PATH is checked.
Verify installation:
node --version
npm --version
You should see version numbers printed.
2. Install n8n globally
In PowerShell (run as Administrator):
npm install -g n8n
Alternative (no global install):
npx n8n
Installation on macOS
1. Install Homebrew (if not already installed)
Homebrew simplifies package management on macOS. In Terminal, paste:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2. Install Node.js via Homebrew
brew update
brew install node
Verify:
node --version
npm --version
3. Install n8n
npm install -g n8n
Or with npx:
npx n8n
Installation on Linux (Ubuntu)
1. Update package lists
sudo apt update
2. Install Node.js and npm
Ubuntu’s repos often have an older Node.js. To get the latest LTS:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
Check versions:
node --version
npm --version
3. Install n8n
sudo npm install -g n8n
Alternatively, run on-demand:
npx n8n
Installation with Docker
Using Docker is a clean way to isolate n8n from your system setup.
-
Install Docker Desktop (Windows/macOS) or Docker Engine (Linux) from docker.com.
-
Pull and run the n8n image:
docker run -it --rm \ --name n8n \ -p 5678:5678 \ n8nio/n8n
This command downloads the official n8nio/n8n
image and starts n8n, exposing the web interface on port 5678.
Starting n8n and Accessing the UI
Once installed (by any method), launch n8n:
n8n start
Then open your browser to:
http://localhost:5678
You’ll see the visual workflow builder where you can start creating automations!
Basic Configuration
- Environment variables: Create a
.env
file in your working directory to set variables likeN8N_HOST
,N8N_PORT
, or database creds. - Saving workflows: By default, workflows are stored locally. For production, consider an external database (Postgres/MySQL).
Example .env
snippet:
# Change default port
N8N_PORT=8080
# Persistent storage with SQLite (default)
DB_SQLITE_VACUUM_ON_STARTUP=true
Troubleshooting Tips
-
“Command not found” errors: Ensure Node.js/npm are in your PATH or use
npx n8n
. -
Port conflicts: If port 5678 is in use, change it via
export N8N_PORT=XXXX
(macOS/Linux) or setting env vars in PowerShell. -
Permissions issues (Linux): Avoid using
sudo
withn8n start
. Instead, fix permissions on your global npm folder:sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Conclusion
You’ve now installed n8n on Windows, macOS, Linux, and via Docker! From here, explore n8n’s rich node library to automate tasks—whether it’s sending emails, integrating APIs, or processing data. If you run into any issues or have questions, feel free to ask. Happy automating!