Self-hosting n8n on Hostinger VPS is Docker Compose, a domain, and 30 minutes. The right setup: persistent volume, reverse proxy with TLS, environment variables for credentials.
Table of contents
- The prerequisites
- Install Docker
- The docker-compose.yml
- Add the reverse proxy
- First-time setup
- What usually breaks
- The reverse proxy options
- The production hardening
- FAQ
The prerequisites
What you need:
- Hostinger VPS. KVM 1 or higher (~$5-10/month). Ubuntu 22.04 or 24.04.
- A domain. Point an A record to the VPS IP.
- SSH access. Hostinger provides SSH keys at provisioning.
- A working email. For n8n user invitations and notifications.
The team that uses the cheapest VPS runs out of memory for n8n + Postgres. The right pick: KVM 2 (4 GB RAM) or higher.
Install Docker
The right commands for Ubuntu:
sudo apt update && sudo apt upgrade -y
sudo apt install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo usermod -aG docker $USER
Log out and back in for the docker group to take effect.
The docker-compose.yml
The right shape for n8n + Postgres on Hostinger:
version: '3.8'
services:
postgres:
image: postgres:16
restart: always
environment:
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=change-me-strong-password
- POSTGRES_DB=n8n
volumes:
- postgres_data:/var/lib/postgresql/data
n8n:
image: n8nio/n8n
restart: always
ports:
- '5678:5678'
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=change-me-strong-password
- N8N_HOST=workflows.example.com
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://workflows.example.com/
volumes:
- n8n_data:/home/node/.n8n
volumes:
postgres_data:
n8n_data:
Then docker compose up -d. n8n is running on port 5678.
Add the reverse proxy
The right way to expose n8n on HTTPS:
Use Caddy as the reverse proxy. Caddy auto-issues Let’s Encrypt certificates.
sudo apt install -y caddy
Edit /etc/caddy/Caddyfile:
workflows.example.com {
reverse_proxy localhost:5678
}
Then sudo systemctl reload caddy. n8n is now available at https://workflows.example.com with a valid TLS certificate.
First-time setup
Visit https://workflows.example.com and create the first user. This is the admin user; the team that loses the credentials has to reset the n8n database.
Recommended first steps:
- Set up the SMTP credentials. n8n uses these for workflow notifications and user invitations.
- Enable 2FA. The team that runs n8n with weak passwords is asking for trouble.
- Set up backups. A nightly pg_dump to S3 or similar. The team that doesn’t backup has data loss on the first hardware failure.
- Set up monitoring. Uptime monitoring on the n8n endpoint.
What usually breaks
The four pitfalls:
- VPS too small. 1 GB RAM VPS runs out of memory with n8n + Postgres. KVM 2 (4 GB) or higher is the right pick.
- Domain not pointing. The team that sets up n8n before the DNS propagates gets Caddy errors.
- Forgot the timezone. n8n uses UTC by default. The team that schedules workflows for “9 AM” without setting the timezone gets surprising execution times.
- Forgot backups. The team that doesn’t backup loses workflows on the first disk failure.
The reverse proxy options
Beyond Caddy, the reverse proxy options for n8n:
- NGINX. The standard. More configuration needed but more flexible. The team that already uses NGINX elsewhere uses it for n8n.
- Caddy. Auto-TLS, simple config. The team that wants zero-config HTTPS uses Caddy.
- Traefik. Docker-aware, automatic service discovery. The team that runs n8n in Docker Compose and wants automatic config uses Traefik.
- Cloudflare Tunnel. The team that doesn’t want to open any ports on the VPS uses Cloudflare Tunnel. The VPS connects outbound to Cloudflare; Cloudflare proxies inbound traffic.
The team that picks the right reverse proxy has the easiest n8n deployment. The team that uses NGINX without a config template writes a lot of boilerplate.
The production hardening
Beyond the basic install, the production hardening steps:
- Separate the database. n8n with SQLite doesn’t scale beyond a few users. Use Postgres for production.
- Set execution mode to “queue”. n8n’s queue mode allows multiple workers to process workflows in parallel.
- Set the timezone correctly.
GENERIC_TIMEZONE=America/New_York(or your timezone) in the environment. - Set up log aggregation. n8n logs to stdout; use a log aggregator (Loki, Datadog, CloudWatch) to centralize.
- Set up backups.
pg_dumpnightly to S3 or similar. Test the restore. - Set up monitoring. Health check on the n8n endpoint, alert if it’s down.
- Set up SSO. n8n supports SAML and OIDC. The team that has enterprise customers uses SSO instead of local accounts.
The team that implements all seven has production-grade n8n. The team that runs the basic install has a hobby-grade n8n that breaks under load.
FAQ
How much does self-hosting n8n on Hostinger cost?
$5-10/month for the VPS (KVM 1-2). The domain is $10-15/year. The team that needs more resources picks KVM 4 (8 GB RAM) for $20/month.
Can I run n8n on Hostinger shared hosting?
No. n8n requires Docker, which requires a VPS. Shared hosting doesn’t allow long-running processes.
Do I need Postgres for n8n?
Yes, for production. n8n’s default SQLite database is fine for testing but has concurrency issues for production workflows.
How do I backup n8n?
Two things: the Postgres database (use pg_dump) and the n8n data directory (/home/node/.n8n). The team that backs up only one has incomplete backups.
What’s the best Hostinger plan for n8n?
KVM 2 (4 GB RAM, 2 vCPU) for small workloads. KVM 4 (8 GB RAM, 4 vCPU) for production. The team that uses KVM 1 (1 GB RAM) runs out of memory under load.
Can I run n8n on Hostinger shared hosting?
No. n8n requires Docker or a long-running Node.js process. Shared hosting restricts both.
Can I run multiple n8n instances on the same VPS?
Yes, with different ports and reverse proxy rules. The team that uses this has separate n8n instances for different teams or environments.
If you are sizing the infrastructure for the kind of project this post covers, the RunxBuild hosting calculator is the right place to model the line items. The compute, the memory, the storage, the bandwidth, the database - each one is a separate number, and the team’s mental model for the platform is the sum of those numbers. The RunxBuild dashboard is where the team sees the actual usage in one place.
Useful related references: