How to Run n8n on a VPS (Docker + Caddy, HTTPS)
Run your own n8n workflow automation on a VPS with Docker Compose and Caddy for automatic HTTPS. Copy-paste commands, backups and a note on paying with crypto.
To run n8n on a VPS, you need one small server, Docker, a domain name and about ten minutes. This guide gives you the exact commands: n8n in Docker Compose, Caddy in front of it for automatic HTTPS, and a backup of your workflow data. You end up with your own automation server that keeps running when your laptop is closed.
What n8n needs from a server
n8n is a workflow tool that connects apps and runs your automations on triggers, schedules and webhooks. Webhooks are the reason to host it on a server: they need a public address that is online around the clock.
- Memory - 2 GB of RAM is a comfortable start for a handful of workflows; 1 GB works for very light use but leaves little headroom.
- Disk - The app itself is small, but execution history grows, so leave a few gigabytes free.
- Network - A dedicated IPv4 and a domain name pointing at it, so webhooks and HTTPS work.
On Neckrez the plain VPS line is the right fit here: the Ion plan (1 vCPU, 2 GB, $18/mo) is a sensible starting point, and Photon (2 vCPU, 4 GB, $34/mo) gives room to grow. If you later run steady, heavy workflows all day, Dedicated CPU (cores reserved for you) is the step up. For most people a VPS is enough. See also VPS for bots and automation.
Rule of thumb: start with 2 GB of RAM, watch memory for a week, and resize only if you actually need to.
How to do it on Neckrez
- Sign up - Use an email (or Google/GitHub). No KYC, no ID, no phone, no card.
- Top up the balance - Pay in crypto from $15; the payment page shows the exact minimum for each coin and network.
- Pick plan, location and OS - Choose a location near you or your users and Ubuntu. The Docker 1-click app also exists if you want Docker preinstalled.
- Server ready in about a minute - You get full root and a dedicated IPv4.
- Billed hourly - Destroy the server anytime and billing stops.
First, create a DNS A record for n8n.example.com that points to the server's IPv4 address. Then connect over SSH as root and install Docker.
apt update && apt install -y docker.io docker-compose-v2
mkdir -p /opt/n8n && cd /opt/n8nCreate docker-compose.yml in /opt/n8n. It runs n8n and Caddy together; replace n8n.example.com with your domain and set your own time zone.
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
environment:
- N8N_HOST=n8n.example.com
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.example.com/
- GENERIC_TIMEZONE=Europe/Berlin
volumes:
- n8n_data:/home/node/.n8n
caddy:
image: caddy:2
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
volumes:
n8n_data:
caddy_data:Next, create a file named Caddyfile in the same folder. Caddy gets and renews the HTTPS certificate on its own.
n8n.example.com {
reverse_proxy n8n:5678
}Start everything and open your domain in a browser. The first visit asks you to create the owner account.
docker compose up -d
docker compose logs -f n8nBack up your n8n data
Your workflows, credentials and the encryption key live in the n8n_data volume. Copy that archive off the server regularly; without the key, saved credentials cannot be decrypted.
docker run --rm -v n8n_n8n_data:/data -v $(pwd):/backup alpine \
tar czf /backup/n8n-data.tgz -C /data .One honest caveat: a Neckrez balance that runs out leads to the server being deleted, and bare metal has no snapshots at all. On Vultr, DigitalOcean and Hetzner servers you can also take an on-demand snapshot, kept 7 days, but keep your own archive too.
FAQ
Can I run n8n on a 1 GB VPS? Yes, for a few light workflows. If it runs out of memory, move to 2 GB.
Do I need a domain? Yes. Caddy needs one to issue a certificate, and many services only send webhooks to HTTPS addresses.
Get started
Plans from $10/month, billed hourly. Deploy your server and run n8n today. Neckrez rents VPS, Dedicated CPU and bare metal servers, and GPU servers when the provider has capacity, all on one crypto balance billed by the hour.