/n8n-tutorials

How to install n8n on Windows?

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.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free consultation

How to install n8n on Windows?

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.

  1. Visit the official Node.js website at https://nodejs.org/
  2. Download the LTS (Long Term Support) version of Node.js for Windows
  3. Run the downloaded installer and follow the installation wizard
  4. Accept the license agreement and click "Next"
  5. Choose the installation location and click "Next"
  6. Select the components to install (the default selection is recommended)
  7. Click "Install" to begin the installation process
  8. Wait for the installation to complete and click "Finish"

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.

  1. Open Command Prompt as Administrator (right-click on Command Prompt and select "Run as administrator")
  2. Run the following command to install n8n globally:
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:

  1. Right-click on your desktop and select New > Shortcut
  2. In the location field, enter: cmd.exe /k n8n
  3. Click "Next"
  4. Name the shortcut "n8n" and click "Finish"

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:

  1. Install the node-windows package globally:
npm install -g node-windows
  1. Create a new directory for the service files:
mkdir C:\n8n-service
cd C:\n8n-service
  1. Create a JavaScript file named "n8n-service.js" with the following content:
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.

  1. Install the service by running:
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:

  1. Install Docker Desktop for Windows from https://www.docker.com/products/docker-desktop
  2. Open Command Prompt and run:
docker run -it --rm --name n8n -p 5678:5678 -v %USERPROFILE%.n8n:/home/node/.n8n n8nio/n8n

This command will:

  • Pull the n8n Docker image if it's not already available
  • Create a container named "n8n"
  • Map port 5678 on your local machine to port 5678 in the container
  • Create a volume to persist your workflows in your user profile directory

You can then access n8n at http://localhost:5678.

 

Step 7: Alternative Installation Method - Using Executable Installer

 

n8n also provides desktop applications for Windows:

  1. Visit https://downloads.n8n.io/
  2. Download the Windows .exe installer
  3. Run the downloaded .exe file
  4. Follow the installation wizard
  5. After installation, you can launch n8n from the Start menu

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:

  1. Create an environment variables file (.env) in your n8n directory or user home directory with custom configurations:
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
  1. To specify these settings when starting n8n from the command line:
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:

  1. Change the port by starting n8n with a different port:
n8n start --port=5679

Issue 2: Permission Errors

If you encounter permission errors during installation:

  1. Make sure you're running Command Prompt as Administrator
  2. Check if your antivirus is blocking the installation
  3. Try running:
npm install n8n -g --unsafe-perm

Issue 3: Node.js Version Issues

If you get errors related to Node.js version compatibility:

  1. Check the current Node.js version requirements for n8n
  2. Install a Node.js version manager like nvm-windows to manage multiple Node.js versions
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:

  1. Generate SSL certificates (you can use tools like OpenSSL or purchase from a certificate authority)
  2. Start n8n with SSL configuration:
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:

  1. Set up user management by adding these variables to your .env file or command line:
N8N_USER_MANAGEMENT\_DISABLED=false
N8N_ENCRYPTION_KEY=your-secure-encryption-key
  1. Start n8n, and you'll be prompted to create an initial admin user
  2. To add users later, use the n8n command:
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.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022