Learn how to install n8n on Windows using npm, Docker, or the executable installer. Follow step-by-step instructions to set up, start, and configure n8n for workflow automation.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
n8n is a workflow automation tool that can be installed on Windows through several methods including npm, Docker, or using a manual setup process. The most straightforward way to install n8n on Windows is using npm (Node Package Manager), which requires having Node.js installed first. After installing Node.js, you can simply run the npm command to install n8n globally, allowing you to start the n8n server and access the workflow editor through your web browser.
Step 1: Install Node.js and npm
Before installing n8n, you need to have Node.js and npm installed on your Windows system.
To verify that Node.js and npm were installed correctly, open Command Prompt and run:
node --version
npm --version
You should see the versions of Node.js and npm displayed in the terminal.
Step 2: Install n8n using npm
Now that you have Node.js and npm installed, you can install n8n globally on your system.
npm install n8n -g
This command will download and install n8n and its dependencies. The installation might take a few minutes to complete.
Step 3: Start n8n
After the installation is complete, you can start n8n:
n8n
n8n will start and display some information in the command prompt. By default, n8n runs on port 5678. You can access the n8n editor by opening a web browser and navigating to:
http://localhost:5678
Step 4: Create a desktop shortcut (Optional)
To make it easier to start n8n, you can create a desktop shortcut:
cmd.exe /k n8n
Now you can double-click this shortcut to start n8n anytime.
Step 5: Configure n8n to run as a service (Optional)
To have n8n start automatically when you boot your computer, you can set it up as a Windows service:
npm install -g node-windows
mkdir C:\n8n-service
cd C:\n8n-service
const Service = require('node-windows').Service;
// Create a new service object
const svc = new Service({
name: 'n8n',
description: 'n8n workflow automation',
script: 'C:\Users\YOUR_USERNAME\AppData\Roaming\npm\node_modules\n8n\bin\n8n.js',
nodeOptions: [],
workingDirectory: 'C:\Users\YOUR_USERNAME\AppData\Roaming\npm\node_modules\n8n',
allowServiceLogon: true
});
// Listen for the "install" event
svc.on('install', function() {
svc.start();
console.log('n8n service installed and started');
});
// Install the service
svc.install();
Make sure to replace "YOUR_USERNAME" with your actual Windows username.
node n8n-service.js
This will install n8n as a Windows service that automatically starts when your computer boots.
Step 6: Alternative Installation Method - Using Docker
If you prefer using Docker, you can install n8n using Docker Desktop for Windows:
docker run -it --rm --name n8n -p 5678:5678 -v %USERPROFILE%.n8n:/home/node/.n8n n8nio/n8n
This command will:
You can then access n8n at http://localhost:5678.
Step 7: Alternative Installation Method - Using Executable Installer
n8n also provides desktop applications for Windows:
This method is the simplest as it handles all the dependencies and configurations automatically.
Step 8: Basic Configuration
After installing n8n, you may want to configure some basic settings:
N8N\_PORT=5678
N8N\_PROTOCOL=http
N8N\_HOST=localhost
N8N_EDITOR_BASE\_URL=http://localhost:5678
N8N_ENCRYPTION_KEY=your-secret-encryption-key
N8N_USER_MANAGEMENT\_DISABLED=false
n8n start --port=5678 --tunnel
The --tunnel
flag creates a tunnel to make your n8n instance accessible from the internet (useful for webhook testing).
Step 9: Updating n8n
To update n8n to the latest version, run:
npm update -g n8n
If you installed via Docker, pull the latest image:
docker pull n8nio/n8n
If you used the executable installer, download and install the latest version from the n8n website.
Step 10: Troubleshooting Common Issues
Issue 1: Port Already in Use
If you see an error about port 5678 already being in use, you can:
n8n start --port=5679
Issue 2: Permission Errors
If you encounter permission errors during installation:
npm install n8n -g --unsafe-perm
Issue 3: Node.js Version Issues
If you get errors related to Node.js version compatibility:
nvm install 16.17.0
nvm use 16.17.0
npm install n8n -g
Step 11: Setting Up SSL (HTTPS) for Security
For production use, it's recommended to use HTTPS:
n8n start --ssl-key=C:\path\to\privkey.pem --ssl-cert=C:\path\to\cert.pem
Or add to your .env file:
N8N\_PROTOCOL=https
N8N_SSL_KEY=C:\path\to\privkey.pem
N8N_SSL_CERT=C:\path\to\cert.pem
Step 12: Configuring User Authentication
To enable user authentication in n8n:
N8N_USER_MANAGEMENT\_DISABLED=false
N8N_ENCRYPTION_KEY=your-secure-encryption-key
n8n user create
This command will prompt you to enter details for the new user.
Conclusion
You've now successfully installed n8n on Windows. You can access the n8n workflow editor through your web browser at http://localhost:5678 (or the port you configured). From here, you can create automated workflows using the visual editor, connecting various services and APIs without writing code.
Remember to check the official n8n documentation at https://docs.n8n.io/ for more detailed information on configuring and using n8n for your automation needs.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.