Guides

How to install n8n on your Ubuntu VPS

Open SSH, install Docker, paste the compose file, open port 5678. n8n is not preinstalled.

Samuel AkiresCEO RoxyCloud
1 min read205 words
How to install n8n on your Ubuntu VPS

n8n is the board where you wire one service to another: sheet, WhatsApp, email, webhook. It runs on your VPS. It is not preinstalled.

What you need

  • An Ubuntu VPS and the root password.
  • The machine IP.
  • 2 GB to test. 4 GB if you will use it every day.

1. Update and install Docker

SSH
sudo apt update && sudo apt upgrade -y
sudo apt install -y docker.io docker-compose-v2
sudo systemctl enable --now docker

2. Create the folder and the file

SSH
mkdir -p ~/n8n
cd ~/n8n
nano docker-compose.yml

Paste this. In nano save with Ctrl+O, Enter, Ctrl+X.

docker-compose.yml
services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - GENERIC_TIMEZONE=America/Sao_Paulo
      - TZ=America/Sao_Paulo
      - N8N_HOST=0.0.0.0
      - N8N_PORT=5678
      - N8N_PROTOCOL=http
      - N8N_SECURE_COOKIE=false
    volumes:
      - ./n8n_data:/home/node/.n8n

3. Start it and open the browser

~/n8n
docker compose up -d
sudo ufw allow 5678/tcp

In the browser:

Browser
http://YOUR_IP:5678

Create the owner account on the first screen. If the page does not open, port 5678 is still closed in the firewall.

Domain and HTTPS come later. When it is time, the DNS guide helps you point the name.

Frequently asked questions

Straight answers before you order

No. The VPS is the machine. This guide installs n8n.

For a test, yes. Daily use: 4 GB. Heavy queue: 8 GB.

Not on day one. Open the IP on port 5678. Domain and HTTPS come later.