How to Install n8n on Linux (Ubuntu/Debian/Fedora Instructions)

If you're looking to automate tasks and streamline workflows, installing n8n on your Linux system is a smart move. n8n (pronounced "n-eight-n") is an open-source workflow automation tool that allows you to integrate different services with ease. Whether you're using Ubuntu, Debian, or Fedora, this guide will walk you through how to install n8n on Linux, with simple, step-by-step instructions. This post is perfect for both newcomers and those with some experience in DevOps or automation.


What Is n8n and Why Install It on Linux?

n8n is short for "nodemation" and stands out as a flexible alternative to other automation tools like Zapier or Make.com. It's self-hosted, meaning you're in total control of your data and workflows. Installing it on Linux provides you with:

  • Full ownership of your data
  • No task or execution limits
  • Easier integration with local or private tools
  • Enhanced security through self-hosting

Linux is widely used for hosting software due to its stability and flexibility, making it a great platform for your n8n setup.


Prerequisites for Installing n8n on Linux

Before starting, make sure you have the following prepared:

  • A Linux server or local machine (Ubuntu/Debian/Fedora)
  • A user account with sudo privileges
  • A stable internet connection
  • Basic knowledge of the terminal

You’ll also need to install a few dependencies like Node.js, npm, and optionally Docker if you choose a containerized deployment.


Method 1: Install n8n on Ubuntu/Debian Using Node.js

Step 1: Update Your System

Open your terminal and ensure your system packages are up to date:

sudo apt update && sudo apt upgrade -y

Step 2: Install Node.js and npm

We recommend using NodeSource to get the latest stable Node.js version:

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs

Verify the installation:

node -v
npm -v

Make sure Node.js version is >= 18 for best compatibility with n8n.

Step 3: Install n8n Globally via npm

Now, install n8n globally so you can run it from anywhere:

sudo npm install -g n8n

After installation, start n8n:

n8n

By default, n8n will start on port 5678. Open your browser and go to:

http://localhost:5678

If you're installing on a server, replace localhost with your server’s IP address.


Method 2: Install n8n Using Docker (Cross-Distro Compatible)

Using Docker is often more secure and portable. This method works on Ubuntu, Debian, and Fedora systems.

Step 1: Install Docker and Docker Compose

Ubuntu/Debian:

sudo apt update
sudo apt install -y docker.io docker-compose

Fedora:

sudo dnf install -y docker docker-compose

Start and enable the Docker service:

sudo systemctl start docker
sudo systemctl enable docker

Step 2: Create a Docker Compose File

Create a directory for n8n:

mkdir n8n && cd n8n

Create a docker-compose.yml file:

version: '3'
services:
  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=securepassword
    volumes:
      - ./n8n_data:/home/node/.n8n

🔐 Tip: Replace securepassword with a strong password.

Step 3: Run Your n8n Container

Now start the container:

docker-compose up -d

Visit http://localhost:5678 or your server’s IP to access the n8n dashboard.


Method 3: Install n8n on Fedora Using Node.js

If you prefer to skip Docker, you can install n8n on Fedora directly using Node.js.

Step 1: Install Node.js

Use the NodeSource script for Fedora:

curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash -
sudo dnf install -y nodejs

Confirm installation:

node -v
npm -v

Step 2: Install n8n and Run It

sudo npm install -g n8n
n8n

You should now be able to access the n8n UI from a browser on port 5678.


Bonus: Run n8n as a Background Service

By default, n8n runs in the foreground. To keep it running in the background, especially on production servers, use a process manager like PM2.

Step 1: Install PM2

sudo npm install -g pm2

Step 2: Start n8n with PM2

pm2 start n8n

To ensure n8n starts on boot:

pm2 startup
pm2 save

This keeps your automation platform running 24/7 without manual restarts.


Useful Configuration Options

You can configure n8n with environment variables for better control. Here’s a sample table of commonly used options:

Environment Variable Purpose Example Value
N8N_PORT Change default port 8080
N8N_BASIC_AUTH_USER Set admin username admin
N8N_BASIC_AUTH_PASSWORD Set admin password mySecurePassword
N8N_HOST Set host IP/domain n8n.example.com

To use these, either set them in your shell or inside your Docker Compose file.


Next Steps After You Install n8n on Linux

Now that you've installed n8n on your Linux system, here are a few ideas to get started:

  • Create your first workflow: Automate RSS to Twitter, Gmail to Notion, or Slack notifications.
  • Install self-signed SSL: Use Let's Encrypt with Nginx reverse proxy for HTTPS.
  • Enable backups: Backup your workflow files stored in ~/.n8n or Docker volume.

The possibilities are endless as n8n supports hundreds of integrations, and custom webhook triggers.


FAQ

How do I update n8n after installation?

If installed via npm, use:

sudo npm update -g n8n

If you used Docker, just pull the latest image:

docker-compose down
docker pull n8nio/n8n
docker-compose up -d

Is it safe to expose n8n to the internet?

Yes, but make sure to enable basic auth and HTTPS. n8n supports built-in authentication and can be placed behind a reverse proxy like Nginx for added security.


Can I run multiple workflows at the same time?

Absolutely! n8n is capable of running concurrent workflows. Just ensure your server has enough RAM and CPU resources.


Where are workflows stored in n8n?

By default:

  • Local Install: In ~/.n8n
  • Docker Install: In the volume mapped to /home/node/.n8n

You can change the storage location using environment variables.


What are the minimum system requirements to install n8n on Linux?

  • 1 GB RAM (2 GB+ recommended)
  • 1 vCPU
  • Disk space: 2–5 GB for workflows and node modules

Better specs will offer improved performance for larger automations.


This guide gave you multiple reliable ways to install n8n on Linux, including Docker and direct Node.js methods. Whether you're automating marketing reports, CRM updates, or DevOps workflows, n8n on Linux is a powerful solution that keeps you in control.

Comments
Join the Discussion and Share Your Opinion
Add a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *