How to Install n8n on Ubuntu 26.04 LTS
Introduction
n8n is a powerful workflow automation platform that allows you to connect applications, APIs, and online services without writing extensive code. It is commonly used to automate repetitive tasks, build integrations, process webhooks, and create custom workflows for both personal and business use.
This guide walks you through installing the Community Edition of n8n on Ubuntu 26.04 LTS using Node.js and npm. You’ll also learn how to access the web interface and configure n8n to run automatically in the background using PM2.
Prerequisites
Before you begin, make sure your system meets the following requirements:
- Ubuntu 26.04 LTS
- A user account with sudo privileges
- At least 2 GB RAM (4 GB recommended)
- A stable Internet connection
Update your system before installing n8n:
sudo apt update sudo apt full-upgrade -y sudo reboot
Step 1: Install Node.js
Ubuntu 26.04 includes a recent version of Node.js in its official repositories.
Install Node.js and npm:
sudo apt install -y nodejs npm
Verify the installation:
node -v npm -v
Step 2: Install n8n
Install the latest Community Edition globally using npm.
sudo npm install -g n8n
Verify the installation:
n8n --version
Step 3: Start the n8n Server
Launch n8n with the following command:
n8n
By default, n8n listens on TCP port 5678.
If UFW is enabled, allow inbound connections on port 5678.
sudo ufw allow 5678/tcp
Step 4: Access the Web Interface
Open your preferred web browser and navigate to:
http://YOUR_SERVER_IP:5678
If you’re running n8n on your local machine, use:
http://localhost:5678
During the first launch, you’ll be asked to create an administrator account before accessing the n8n dashboard.
Note
During startup, n8n may display several warning messages in the terminal. Most of these are informational and do not affect normal operation. Recent versions also recommend using the official Docker image for production deployments. If you encounter a Secure Cookie warning while accessing n8n over HTTP, consider configuring HTTPS with a reverse proxy such as Nginx for production environments.
Step 5: Run n8n in the Background
To keep n8n running after you close the terminal or reboot the server, install PM2.
sudo npm install -g pm2
Start n8n with PM2.
pm2 start n8n --name n8n
Save the current process list.
pm2 save
Enable PM2 to start automatically after every system reboot.
pm2 startup
Run the command displayed by PM2, then save the configuration again.
pm2 save
Useful PM2 Commands
Check the current status:
pm2 status
View application logs:
pm2 logs n8n
Restart n8n:
pm2 restart n8n
Stop n8n:
pm2 stop n8n
Update n8n to the latest version:
sudo npm update -g n8n pm2 restart n8n
Troubleshooting
n8n Command Not Found
Verify that n8n is installed globally.
npm list -g n8n
Port 5678 Is Already in Use
Check which process is using the port.
sudo ss -tulpn | grep 5678
Verify the Installed Version
n8n --version
Conclusion
You have successfully installed n8n on Ubuntu 26.04 LTS. Your server is now ready to build workflows, automate repetitive tasks, connect third-party services, and create powerful integrations through the n8n web interface.
For development or personal projects, installing n8n with npm offers a simple and fast setup. As your deployment grows, consider migrating to the official Docker image and using Nginx with HTTPS to improve security, scalability, and long-term maintainability.