How to Install n8n Workflow Automation Platform on Ubuntu 24.04

n8n is an open-source workflow automation tool that lets you connect apps and services using a visual interface. It’s ideal for automating repetitive tasks without complex code.

Prerequisites

Before starting:

  • Fresh Ubuntu 24.04 VPS/server

  • Registered domain: n8n2.domainhere.info

  • Root or sudo access

  • Ports 80 and 443 open

  • Docker and Nginx will be used

Install Docker

Docker will run n8n inside a container. Update system,

apt update && sudo apt upgrade

Install required packages,

apt install -y ca-certificates curl gnupg nano

Add Docker’s GPG key,

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

Add Docker repo,

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

Install Docker,

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

Start and enable Docker,

systemctl enable --now docker

Verify Docker,

docker version

Output:

root@vps:~# docker version
Client: Docker Engine - Community
 Version:           28.3.3
 API version:       1.51
 Go version:        go1.24.5
 Git commit:        980b856
 Built:             Fri Jul 25 11:34:09 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.3.3
  API version:      1.51 (minimum version 1.24)
  Go version:       go1.24.5
  Git commit:       bea959c
  Built:            Fri Jul 25 11:34:09 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.27
  GitCommit:        05044ec0a9a75232cad458027ca83437aae3f4da
 runc:
  Version:          1.2.5
  GitCommit:        v1.2.5-0-g59923ef
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Install Nginx

Nginx will act as a reverse proxy for n8n. Install Nginx using below command,

apt install -y nginx

Start and enable,

systemctl enable --now nginx

Check status,

systemctl status nginx

Output:

root@vps:~# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Thu 2025-07-31 16:16:17 UTC; 1h 4min ago
       Docs: man:nginx(8)
   Main PID: 8414 (nginx)
      Tasks: 5 (limit: 4604)
     Memory: 6.6M (peak: 20.3M)
        CPU: 768ms
     CGroup: /system.slice/nginx.service
             ├─8414 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             ├─9094 "nginx: worker process"
             ├─9095 "nginx: worker process"
             ├─9096 "nginx: worker process"
             └─9097 "nginx: worker process"

Configure Nginx for n8n

Create config,

nano /etc/nginx/sites-available/n8n2.domainhere.info

Note: Replace n8n2.domainhere.info with actual domain name

Add:

server {
    listen 80;
    server_name n8n2.domainhere.info;

    location / {
        proxy_pass http://localhost:5678/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Enable config,

ln -s /etc/nginx/sites-available/n8n2.domainhere.info /etc/nginx/sites-enabled/

Test and reload,

nginx -t && sudo systemctl reload nginx

Configure Firewall

Allow necessary ports,

ufw allow 'Nginx Full'
ufw allow 5678/tcp
ufw reload

Output:

root@vps:~# ufw reload
Firewall reloaded
root@vps:~# 

Install Certbot for SSL

Install Certbot and Nginx plugin,

apt install -y certbot python3-certbot-nginx

Run Certbot,

certbot --nginx -d n8n2.domainhere.info

Note: Replace n8n2.domainhere.info with actual domain name

It will:

  • Ask for an email

  • Register with Let’s Encrypt

  • Set up HTTPS

Create Persistent Docker Volume

Create Docker Volume using below command,

docker volume create n8n_data

Run n8n Container using below command,

docker run -it --rm --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

Output:

root@vps:~# docker run -it --rm --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n
Unable to find image 'docker.n8n.io/n8nio/n8n:latest' locally
latest: Pulling from n8nio/n8n
fe07684b16b8: Pull complete 
49b72e7e39fe: Pull complete 
c1ab3b052759: Pull complete 
845179b1d451: Pull complete 
ad03744990d9: Pull complete 
4f4fb700ef54: Pull complete 
dfa6d2aca810: Pull complete 
27699bb6f957: Pull complete 
83e016eda368: Pull complete 
e74e7229ed04: Pull complete 
2e30d6f5b43e: Pull complete 
7ab76b2acd73: Pull complete 
There is a deprecation related to your environment variables. Please take the recommended actions to update your configuration:
 - N8N_RUNNERS_ENABLED -> Running n8n without task runners is deprecated. Task runners will be turned on by default in a future version. Please set `N8N_RUNNERS_ENABLED=true` to enable task runners now and avoid potential issues in the future. Learn more: https://docs.n8n.io/hosting/configuration/task-runners/

[license SDK] Skipping renewal on init because renewal is not due yet or cert is not initialized
Version: 1.104.2

Editor is now accessible via:
http://localhost:5678

Press "o" to open in Browser.

Access n8n UI

Visit in browser:

https://n8n2.domainhere.info

Note: Replace n8n2.domainhere.info with actual domain name

Set up the admin account and start using the dashboard.

images

images

images

Conclusion

Done! You’ve now successfully deployed n8n on Ubuntu 24.04 with Docker, Nginx, and Let’s Encrypt SSL using n8n2.domainhere.info.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS