Self-host n8n on a Hostinger VPS (Docker, HTTPS, backups)
Run your own n8n automation server for a flat monthly price: the one-click template, or a Docker Compose setup with automatic HTTPS, plus updates, backups and which KVM plan to pick.
Why self-host n8n
n8n is a workflow automation tool, in the same space as Zapier and Make. You connect apps, add logic, and let it run. The hosted version charges by workflow executions; self-hosted, you pay for the server and run as many executions as it can handle.
n8n is distributed under its Sustainable Use License, which allows self-hosting for your own and your company's internal use. If you plan to resell n8n as a service, read the licence first.
Which plan you need
n8n itself is light, but workflows that process files, call AI models or loop over large lists use memory quickly.
| Plan | Good for |
|---|---|
| KVM 1 (1 vCPU, 4 GB) | Personal automations and a small team's workflows on the default SQLite database |
| KVM 2 (2 vCPU, 8 GB) | Many active workflows, Postgres alongside n8n, heavier file or AI processing |
| KVM 4 and up | Queue mode with Redis and multiple workers |
Option A — The one-click n8n template
Hostinger offers n8n as a VPS OS template. Choose it when you create the server (or reinstall an existing one from the VPS settings) and you get n8n running in Docker without touching the command line.
It's the fastest route and fine for most people. Choose Option B if you want to see every moving part, run n8n next to other apps, or control exactly which version you're on.
Option B — Docker Compose with automatic HTTPS
Start from a plain Ubuntu 24.04 server that you've already secured, with an A record for a subdomain such as `n8n.example.com` pointing at it. Caddy handles HTTPS: it requests and renews the Let's Encrypt certificate on its own.
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER # log out and back in after this
mkdir -p ~/n8n && cd ~/n8n
openssl rand -hex 32 # copy this; it becomes N8N_ENCRYPTION_KEYDOMAIN=n8n.example.com
N8N_ENCRYPTION_KEY=paste-the-random-string-here
GENERIC_TIMEZONE=Asia/Karachiservices:
n8n:
image: docker.n8n.io/n8nio/n8n:latest
restart: unless-stopped
environment:
- N8N_HOST=${DOMAIN}
- N8N_PROTOCOL=https
- N8N_PORT=5678
- WEBHOOK_URL=https://${DOMAIN}/
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- TZ=${GENERIC_TIMEZONE}
volumes:
- n8n_data:/home/node/.n8n
caddy:
image: caddy:2
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
- DOMAIN=${DOMAIN}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
volumes:
n8n_data:
caddy_data:{$DOMAIN} {
reverse_proxy n8n:5678
}docker compose up -d
docker compose logs -fFirst login and the encryption key
Open `https://n8n.example.com` and create the owner account. Do it straight away: until an owner exists, whoever reaches the URL first can claim the instance.
n8n encrypts every saved credential with `N8N_ENCRYPTION_KEY`. Keep a copy somewhere safe, outside the server. If you lose it, restored backups can't decrypt your API keys and passwords, and every credential has to be re-entered.
Updating n8n
n8n releases often. Read the release notes for breaking changes, take a backup, then pull and restart. Pin a specific version tag instead of `latest` if you'd rather update deliberately.
cd ~/n8n
docker compose pull
docker compose up -d
docker image prune -fBackups
Everything n8n stores (workflows, credentials, execution history in SQLite) lives in the `n8n_data` volume. Archive it on a schedule and copy the file off the server.
docker run --rm \
-v n8n_n8n_data:/data:ro \
-v "$PWD":/backup \
alpine tar czf /backup/n8n-$(date +%F).tar.gz -C /data .docker compose exec n8n n8n export:workflow --all --output=/home/node/.n8n/workflows.jsonFrequently asked questions
Is self-hosted n8n free?
The Community Edition is free to self-host for internal use under n8n's Sustainable Use License. You pay only for the server. Some enterprise features need a paid licence.
Can n8n run on KVM 1?
Yes. For personal and small-team automations, KVM 1's 4 GB of RAM is plenty. Move to KVM 2 when you add Postgres or run heavy file or AI workflows.
Why do my webhooks show localhost URLs?
WEBHOOK_URL isn't set, or n8n was started before you set it. Set it to your public https URL with a trailing slash and recreate the container with `docker compose up -d`.
Does the WEBHOST2026 coupon work on the VPS?
Yes. The links on this site apply WEBHOST2026 to VPS plans, and the 24 and 48-month terms have the lowest monthly price.
Ready to save an extra 20% with coupon WEBHOST2026?
Get my discount link →Disclosure: links to Hostinger on this page are referral links. If you buy through them we may earn a commission, at no extra cost to you. It doesn't change what we recommend. About us
Keep reading
How to point a domain to your Hostinger VPS (A records, step by step)
Find your VPS IP, add the right A and AAAA records whether your domain is at Hostinger, GoDaddy or Namecheap, and check propagation before you ask Let's Encrypt for a certificate.
TutorialsSecure a new Hostinger VPS: the 10-minute checklist
SSH keys, no root or password logins, a firewall, Fail2ban, automatic security updates and snapshots. The minimum to do before a fresh VPS goes on the internet, with copy-paste commands.
DealsHostinger VPS coupon code: extra 20% off KVM 1 to KVM 8
Save an extra 20% on Hostinger KVM VPS plans with WEBHOST2026. Real prices per plan, which size fits your app, and why the 24-month term is often the smart pick for a VPS.