
n8n connects apps such as Google Sheets, WhatsApp Business, email and your online store, and runs repetitive tasks for you: a new store customer is added to a sheet, you get a message, and a welcome email goes out. The cloud version is billed per execution; on your own server the only limit is the server’s resources, and your data stays with you.
Choosing resources #
| Use | Suitable plan | Why |
|---|---|---|
| Testing and a few workflows | VPS 2GB | n8n alone needs 1 to 2 GB of memory |
| A business with dozens of workflows | VPS 4GB | Room for parallel executions and PostgreSQL |
| Large files or AI steps | VPS 8GB | Big files and requests use memory |
Before you start #
- A VPS with Ubuntu 24.04 or Debian 12 and root SSH access.
- Point a subdomain (for example
n8n.example.com) to the server IP with an A record and wait for it to resolve. - In the firewall, open only ports 22, 80 and 443 and keep the rest closed.
1. Install Docker #
curl -fsSL https://get.docker.com | sh systemctl enable --now docker docker compose version
2. Create the project files #
mkdir -p /opt/n8n && cd /opt/n8n
Create docker-compose.yml with this content, changing the domain and time zone:
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: unless-stopped
environment:
- N8N_HOST=n8n.example.com
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.example.com/
- GENERIC_TIMEZONE=Asia/Riyadh
- TZ=Asia/Riyadh
volumes:
- n8n_data:/home/node/.n8n
caddy:
image: caddy:2
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
volumes:
n8n_data:
caddy_data:
Then a Caddyfile in the same folder:
n8n.example.com {
reverse_proxy n8n:5678
}
3. Start n8n #
docker compose up -d docker compose logs -f n8n
Open https://n8n.example.com and create the owner account straight away, because whoever opens the page first becomes the owner. Caddy obtains the SSL certificate automatically, with no extra setup.
Updates and backups #
cd /opt/n8n docker compose pull && docker compose up -d
n8n data (workflows and encrypted credentials) lives in the n8n_data volume. Take a snapshot from the VPS control panel before every update, and export important workflows from n8n from time to time.
Frequently asked questions #
Is n8n free on my own server?
The community edition is open source and free to self-host under its licence terms; you only pay for the server.
How many workflows can I run?
n8n itself sets no limit; the limit is the server’s memory and CPU. Start with a 4GB plan and upgrade when needed.
Do I need PostgreSQL?
n8n runs on its built-in SQLite database, which is fine for light use. With many executions, move to PostgreSQL for better stability.