How to Install n8n Workflow Automation Platform on Debian 12

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

  • Debian 12 server

  • Domain: n8n2.domainhere.info

  • Root or sudo access

  • Open ports: 80, 443

Install Docker on Debian 12

Update system,

apt update && apt upgrade -y

Install required packages,

apt install -y ca-certificates curl gnupg nano

Add Docker’s GPG key,

install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | \
gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Add Docker repository,

echo \
  "deb [arch=$(dpkg --print-architecture) \
  signed-by=/etc/apt/keyrings/docker.gpg] \
  https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  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:00 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:00 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

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 (/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Thu 2025-07-31 17:49:12 UTC; 31min ago
       Docs: man:nginx(8)
   Main PID: 2856 (nginx)
      Tasks: 5 (limit: 4641)
     Memory: 6.6M
        CPU: 732ms
     CGroup: /system.slice/nginx.service
             ├─2856 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             ├─4196 "nginx: worker process"
             ├─4197 "nginx: worker process"
             ├─4198 "nginx: worker process"
             └─4199 "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

Paste Config:

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 site,

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

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

Test and reload,

nginx -t && systemctl reload nginx

Configure Firewall (if ufw is used)

Install and allow ports:

apt install -y ufw
ufw allow 'Nginx Full'
ufw allow 5678/tcp
ufw reload

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

Create Docker Volume & Run n8n

Create volume.

docker volume create n8n_data

Run container using below command,

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

Access n8n UI

Open 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 Debian 12 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