How To Install n8n on Linux Mint 22

Install n8n on Linux Mint 22

If you want to automate repetitive tasks, connect APIs, or build AI-powered workflows without paying a monthly SaaS bill, you need a self-hosted automation tool. n8n is one of the best options available today, and installing it on Linux Mint 22 is more straightforward than most tutorials make it look. This guide walks you through two complete installation methods: using npm (Node.js) for a bare-metal setup, and using Docker for an isolated, production-ready deployment. By the end, you will have n8n running as a persistent system service, accessible from your browser, with workflows that survive reboots.

Linux Mint 22, codenamed “Wilma,” uses Ubuntu 24.04 as its base. That gives you a stable, Debian-compatible system with broad community support. However, Mint 22 ships with Node.js 18.x by default, which is end-of-life and incompatible with current n8n builds. Most generic tutorials skip this detail and wonder why the install breaks. This guide does not skip it. You will learn exactly why Node.js 20.x is required, how to install it correctly, and how to configure n8n so it behaves like a first-class Linux daemon.

What is n8n?

n8n (pronounced “n-eight-n”) is an open-source, fair-code workflow automation platform. It lets you connect over 400 apps, APIs, and services through a visual drag-and-drop interface, and it supports writing custom logic directly inside nodes using JavaScript or Python.

Unlike cloud-based tools such as Zapier or Make, n8n gives you full data ownership. Your workflows, credentials, and execution history stay on your machine. It uses SQLite as its default database, which means zero extra configuration for a local or small office setup. You can replace SQLite with PostgreSQL later if your workload grows.

A few real-world use cases to put this in context:

  • Automating email routing and Slack notifications based on webhook triggers
  • Syncing data between a CRM and a spreadsheet on a schedule
  • Running local AI agent pipelines using Ollama integrated into n8n workflows

Why Self-Host n8n on Linux Mint 22?

Running n8n locally means no per-execution pricing, no data leaving your network, and full control over updates. Linux Mint 22 is an excellent host for this because its Ubuntu 24.04 base means every Docker, Node.js, and apt command that works on Ubuntu works on Mint without modification.

Self-hosting also matters in enterprise or regulated environments where sending workflow data to a third-party cloud is not an option. With n8n running locally, you control the database, the credentials, the TLS certificates, and the update schedule.

Prerequisites

Before starting, confirm the following:

  • Operating System: Linux Mint 22 “Wilma” (64-bit)
  • User privileges: A user account with sudo access
  • RAM: 1 GB minimum, 2 GB recommended
  • Disk space: At least 20 GB free
  • Internet connection: Required to download packages
  • Terminal access: Mint’s default terminal (Ctrl+Alt+T) works fine
  • Pre-installed tools: curl and git (both are included in Mint 22 by default)

This guide covers two installation methods:

  • Method 1: npm (Node.js) — best for lightweight, bare-metal desktops or servers
  • Method 2: Docker — best for isolated environments and easier long-term updates

If you are not sure which to pick, go with Docker. It is the officially recommended deployment method for n8n.

Step 1: Update Your Linux Mint 22 System

Always update your system before installing new software. Skipping this step causes dependency conflicts that are difficult to debug later.

Open a terminal and run:

sudo apt update
sudo apt upgrade -y

The apt update command refreshes your local package index so apt knows about the latest available versions. The apt upgrade -y command installs all pending updates without asking for confirmation on each package.

This step takes 1-5 minutes depending on how many updates are pending. Once it finishes, you are ready to install your chosen method.

Step 2: Install Node.js 20.x on Linux Mint 22 (Required for Method 1)

Skip this step if you are using Method 2 (Docker). Docker handles Node.js internally.

Linux Mint 22 includes Node.js 18.x in its default repositories. Node.js 18.x is end-of-life and n8n explicitly requires a Node.js version between 20.19 and 24.x. Installing n8n on Node.js 18 will fail with package compatibility errors.

The correct approach is to add the NodeSource repository, which provides up-to-date Node.js LTS builds.

Add the NodeSource Repository and Install Node.js 20.x

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

What these commands do:

  • curl -fsSL downloads the NodeSource setup script silently, following redirects and failing on errors
  • sudo -E bash - executes that script with root privileges, preserving your environment variables
  • The setup script registers the NodeSource apt repository on your system
  • apt-get install -y nodejs then installs Node.js 20.x from that repository

Verify the Installation

node -v
npm -v

Expected output:

v20.x.x
10.x.x

If you see v18.x.x for the node version, the NodeSource repository did not register correctly. Re-run the curl command and try again.

Optional: Use NVM for Multiple Node.js Versions

If you need to manage multiple Node.js versions on the same machine, NVM (Node Version Manager) is a clean alternative to NodeSource.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20
node -v

NVM installs Node.js in your home directory rather than system-wide, so it does not require sudo for installs. The tradeoff is that the n8n binary will not be available system-wide unless you configure your PATH carefully.

Step 3: Install n8n via npm (Method 1)

With Node.js 20.x confirmed, install n8n globally using npm:

sudo npm install -g n8n

The -g flag installs n8n as a global binary, making it available from any directory in your terminal. Without -g, npm installs n8n only in the current directory, and you will get a “command not found” error when you try to run it later.

This step downloads n8n and all its dependencies. Depending on your internet speed and system, it takes 2-5 minutes.

Verify the n8n Binary

n8n --version

Expected output:

2.14.2

The exact version number will differ based on the latest stable release.

Quick Test: Run n8n in the Foreground

Before setting up a persistent service, confirm n8n actually starts:

n8n

n8n will print startup logs and bind to port 5678 by default. Open your browser and navigate to:

http://localhost:5678

If the n8n setup wizard loads, the installation works. Stop n8n now by pressing Ctrl+C. This foreground mode is for testing only. It stops the moment you close the terminal.

Step 4: Configure n8n as a systemd Service (Method 1 Production Setup)

Running n8n in a terminal is fine for testing. For anything beyond that, you need it running as a systemd service so it starts automatically on boot, restarts on failure, and runs under a dedicated user account.

Create a Dedicated System User

Create a system user with no login shell and no home directory:

sudo adduser --system --group --no-create-home n8n

Running n8n as a dedicated, unprivileged user follows the principle of least privilege. If something goes wrong with a workflow, the n8n process cannot touch files outside its assigned directories.

Create a Data Directory

sudo mkdir -p /var/lib/n8n
sudo chown -R n8n:n8n /var/lib/n8n

The /var/lib/ path is the standard Linux location for persistent application data, per the Filesystem Hierarchy Standard. Without a writable directory, n8n will fail at startup because the system user has no home directory to write to.

Create the systemd Service File

sudo nano /etc/systemd/system/n8n.service

Paste the following content exactly:

[Unit]
Description=n8n workflow automation
After=network.target

[Service]
Type=simple
User=n8n
Group=n8n
Environment="N8N_USER_FOLDER=/var/lib/n8n"
Environment="N8N_RUNNERS_ENABLED=true"
Environment="N8N_SECURE_COOKIE=false"
ExecStart=/usr/bin/n8n
Restart=on-failure
RestartSec=5s
StartLimitIntervalSec=60
StartLimitBurst=5
WorkingDirectory=/var/lib/n8n

[Install]
WantedBy=multi-user.target

Key directives explained:

  • Type=simple — n8n runs in the foreground, which is exactly what systemd expects
  • Restart=on-failure — systemd restarts n8n if it crashes, but leaves it stopped after a clean shutdown
  • N8N_SECURE_COOKIE=false — required when accessing n8n via plain HTTP; without this, the browser will reject the session cookie
  • StartLimitBurst=5 — prevents a broken configuration from trashing the CPU in a tight restart loop
  • N8N_RUNNERS_ENABLED=true — enables the execution runner, which is required in current n8n versions

Save the file with Ctrl+O, then Enter, then exit with Ctrl+X.

Enable and Start the Service

sudo systemctl daemon-reload
sudo systemctl enable n8n
sudo systemctl start n8n
  • daemon-reload tells systemd to read your new service file
  • enable configures the service to start automatically on boot
  • start starts it immediately

Verify n8n is Running

sudo systemctl status n8n

Expected output includes:

Active: active (running) since ...

To watch live logs:

journalctl -u n8n -f

Step 5: Install n8n via Docker on Linux Mint 22 (Method 2)

Docker provides a fully isolated, reproducible environment and is the method the n8n team officially recommends for production deployments. It also makes updates trivially easy: one docker compose pull command replaces the entire install.

Install Docker Engine on Linux Mint 22

Linux Mint 22 uses Ubuntu 24.04 “Noble” as its base. You must use the Ubuntu Noble repository when adding Docker’s apt source, not the Mint-specific one.

Add Docker’s GPG key and repository:

sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
  https://download.docker.com/linux/ubuntu noble stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine:

sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Verify Docker installed correctly:

docker --version

Add Your User to the Docker Group

This lets you run Docker commands without sudo every time:

sudo usermod -aG docker $USER
newgrp docker

The newgrp command applies the group change to your current session without logging out and back in.

Deploy n8n with Docker Compose

Create a project directory and a Compose file:

mkdir ~/n8n && cd ~/n8n
nano compose.yaml

Paste the following:

services:
  n8n:
    image: n8nio/n8n
    container_name: n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    volumes:
      - n8n_data:/home/node/.n8n
    environment:
      - N8N_HOST=localhost
      - N8N_PORT=5678
      - N8N_RUNNERS_ENABLED=true
      - N8N_SECURE_COOKIE=false
    user: "1000:1000"

volumes:
  n8n_data:

What each section does:

  • restart: unless-stopped — Docker automatically restarts the container after a reboot or crash, unless you manually stop it
  • volumes: n8n_data — stores all workflow data in a named Docker volume so updates never wipe your data
  • user: "1000:1000" — runs the container as your default user, avoiding permission errors on the volume

Start n8n in detached mode (background):

docker compose up -d

Verify the container is running:

docker container ls

You should see a container named n8n with status Up.

Step 6: Access the n8n Web Interface and Complete Setup

Open your browser and go to:

http://localhost:5678

If you are accessing n8n from another device on the same network, replace localhost with the machine’s local IP address. Find the IP with:

ip addr

Look for the IP under your active network interface (usually eth0 or wlan0).

Complete the First-Time Setup Wizard

On first load, n8n presents a setup form. Fill in:

  1. First name and last name
  2. Email address — used as your admin login username
  3. Password — use a strong, unique password and store it in a password manager immediately

Click Next, complete the brief usage questionnaire (or skip it), then click Get Started. You land on the n8n Workflows canvas. These credentials are stored locally on your machine and are not connected to any n8n cloud account.

Configure Key Environment Variables

You can customize n8n behavior through environment variables. The most useful ones are:

Variable Purpose Example
N8N_PORT Change the default port 8080
N8N_USER_FOLDER Set a custom data directory /var/lib/n8n
N8N_SECURE_COOKIE Disable for non-HTTPS access false
N8N_RUNNERS_ENABLED Enable execution runners true
GENERIC_TIMEZONE Set timezone for scheduled workflows Asia/Jakarta

For the npm/systemd method, add variables to /etc/systemd/system/n8n.service under [Service], then run:

sudo systemctl daemon-reload && sudo systemctl restart n8n

For the Docker method, add variables under environment: in compose.yaml, then run:

docker compose down && docker compose up -d

Configure the UFW Firewall

Linux Mint 22 includes UFW but does not enable it by default. If UFW is active on your machine, you must allow port 5678:

sudo ufw status
sudo ufw allow 5678
sudo ufw reload

For local-only access, restrict access to your subnet instead of opening the port globally:

sudo ufw allow from 192.168.1.0/24 to any port 5678

Never expose port 5678 directly to the public internet without first placing n8n behind an Nginx or Caddy reverse proxy with HTTPS and a valid TLS certificate.

Step 7: How to Update n8n on Linux Mint 22

Keeping n8n updated ensures you have the latest security patches, bug fixes, and node integrations. Your data is safe during updates because it lives in a separate data directory or Docker volume.

npm Method

sudo npm update -g n8n
sudo systemctl restart n8n

Docker Method

docker compose pull
docker compose down
docker compose up -d

Before major updates, check the n8n GitHub Releases page for breaking changes. The n8n team ships a new minor version most weeks, with stable tagged for production use.

Troubleshooting Common Issues When You Install n8n on Linux Mint 22

Issue 1: “command not found: n8n” After npm Install

Cause: The npm global binary path is not included in your $PATH variable.

Fix:

export PATH=$(npm bin -g):$PATH

Add this line to your ~/.bashrc to make it permanent. Alternatively, reinstall Node.js using the NodeSource method in Step 2, which correctly configures PATH.

Issue 2: n8n Fails to Start — “EACCES: permission denied, mkdir ‘/nonexistent'”

Cause: The n8n system user has no home directory and cannot write anywhere.

Fix:

sudo mkdir -p /var/lib/n8n
sudo chown -R n8n:n8n /var/lib/n8n

Issue 3: npm Install Fails with Node.js Version Errors

Cause: Linux Mint 22 defaults to Node.js 18.x, which is end-of-life and incompatible with current n8n.

Fix: Follow Step 2 to install Node.js 20.x via NodeSource. Confirm the version with node -v before re-running the n8n install.

Issue 4: Port 5678 Not Accessible from Another Device

Cause: UFW is blocking inbound traffic, or n8n is only binding to 127.0.0.1.

Fix:

sudo ufw allow 5678
ss -tulnp | grep 5678

The ss command confirms whether n8n is actually listening and on which interface. If it only shows 127.0.0.1:5678, set N8N_HOST=0.0.0.0 in your environment variables and restart the service.

Issue 5: Docker Container Exits Immediately After Starting

Cause: Volume ownership mismatch — the container user (UID 1000) cannot write to the volume directory.

Fix:

docker compose down
sudo chown -R 1000:1000 ~/.local/share/docker/volumes/n8n_n8n_data
docker compose up -d

Alternatively, confirm the user: "1000:1000" line is present in your compose.yaml as shown in Step 5.

Congratulations! You have successfully installed n8n. Thanks for using this tutorial for installing n8n workflow automation software and tools on Linux Mint 22 system. For additional help or useful information, we recommend you check the official n8n website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!
r00t is a dedicated and highly skilled Linux Systems Administrator with over a decade of progressive experience in designing, deploying, and maintaining enterprise-grade Linux infrastructure. His professional journey began in the telecommunications industry, where early exposure to Unix-based operating systems ignited a deep and enduring passion for open-source technologies and server administration.​ Throughout his career, r00t has demonstrated exceptional proficiency in managing large-scale Linux environments, overseeing more than 300 servers across development, staging, and production platforms while consistently achieving 99.9% system uptime. He holds advanced competencies in Red Hat Enterprise Linux (RHEL), Debian, and Ubuntu distributions, complemented by hands-on expertise in automation tools such as Ansible, Terraform, Bash scripting, and Python.

Related Posts