How to Install n8n on a VPS (Step-by-Step)
By Rick, NoCode Guide

To install n8n on a VPS, provision a server with 2 vCPU and 4GB RAM, secure it, install Docker, and run n8n with Postgres behind Caddy for HTTPS. The whole thing takes about 15 minutes and costs from $6.49/month on a 24-month term, or about $12/month at renewal, with unlimited executions. Here's the exact, tested walkthrough.
Disclosure: some links on this page are affiliate links. If you buy through them we may earn a commission at no extra cost to you.
Step 1: Get a VPS
Use a provider with a one-click app template to save time. A Hostinger VPS (from $6.49/mo) can deploy n8n automatically, or start from a plain Ubuntu image and follow the steps below.
Step 2: Secure the server
# as root, right after first login
apt update && apt upgrade -y
adduser deploy && usermod -aG sudo deploy
ufw allow OpenSSH
ufw allow 80,443/tcp
ufw enableStep 3: Install Docker and n8n
curl -fsSL https://get.docker.com | sh
mkdir ~/n8n && cd ~/n8n
# create docker-compose.yml (see our Docker guide) then:
docker compose up -dUse the same Compose file from the Docker Compose guide, with your real domain set in N8N_HOST and N8N_WEBHOOK_URL.
Step 4: Add HTTPS with Caddy
n8n.example.com {
reverse_proxy localhost:5678
}Caddy fetches a free TLS certificate automatically. Point an A record for n8n.example.com at your VPS IP first.
Security checklist
- SSH key auth only; disable password login.
- Firewall limited to 80, 443, and SSH.
- Strong basic-auth or SSO on n8n itself.
- Automated backups of the Postgres and
.n8nvolumes. - Keep Docker images updated monthly.
Real monthly cost
A small VPS runs $6.49/month on Hostinger's 24-month promotional term and about $12/month at renewal, with no execution fees. Compare with managed plans on the cost calculator and read cloud vs self-hosted. The official server setup docs cover advanced scaling.
Disclosure: some links on this page are affiliate links. If you buy through them we may earn a commission at no extra cost to you.
What a VPS for n8n actually costs
Hostinger's VPS range is the one most n8n tutorials point at, so it is worth stating the prices precisely, including the part most articles leave out.
The headline prices are promotional rates for a 24-month term paid upfront. The renewal rate is roughly double. As of October 2026 the entry KVM 1 plan, with 1 vCPU, 4GB RAM and 50GB NVMe, is $6.49 a month promotional and $11.99 on renewal. KVM 2, with 2 vCPU, 8GB and 100GB, is $8.79 against $14.99. KVM 4, with 4 vCPU, 16GB and 200GB, is $12.99 against $28.99. KVM 8, with 8 vCPU, 32GB and 400GB, is $25.99 against $49.99.
Budget against the renewal number. A two-year commitment at the promotional rate is a genuine saving, but planning your costs around a price that expires is how people end up surprised in year three. There is a 30-day money-back guarantee if the plan turns out to be wrong.
Which tier to pick
Smaller than you think, for most people. n8n does not publish hardware requirements, and the figures circulating in blog posts are hosts' recommendations rather than vendor specifications. What drives real memory use is payload size rather than workflow count, because n8n holds the data passing between nodes in memory.
So the entry tier suits a personal or small-business instance running scheduled jobs and webhooks over modest JSON payloads, which describes most n8n deployments. Step up when your workflows handle large files, long API responses or thousands of records per run, or when you are planning queue mode, which adds Redis and Postgres containers alongside n8n and wants the headroom. Upgrading a VPS later is a resize rather than a migration, so starting small is a cheap decision to get wrong.
One-click templates versus doing it yourself
Hostinger ships an "Ubuntu 24.04 with n8n" template that runs n8n in Docker, plus a separate template preconfigured for queue mode. A template gets you to a running instance in minutes without writing a compose file, which is a reasonable trade if you want the thing working today.
What you give up is knowing how it was assembled. When an upgrade needs doing, or a webhook URL is wrong, or you need to add the external task runners container, you are debugging someone else's configuration rather than your own. Templates also pin whatever n8n version was current when the image was built, and they do not update themselves.
A reasonable middle path: start from the template to confirm the VPS and networking work, then look at the compose file it installed and take ownership of it. You get the fast start and you still end up understanding your own stack.
The security checklist nobody includes
A VPS is a public machine, and an n8n instance holds credentials for every service it touches. Five things before you put anything real through it.
Put TLS in front of it, with a reverse proxy such as Caddy or Traefik. Never expose n8n over plain HTTP. Set N8N_WEBHOOK_URL to your real domain so the webhook URLs n8n hands out are the ones that work. Disable password authentication for SSH and use keys. Restrict the firewall to ports 80, 443 and SSH, so n8n's own port 5678 is not reachable from the internet directly. And record your N8N_ENCRYPTION_KEY somewhere outside the server, because without it a restored backup cannot decrypt a single stored credential.
Then set yourself a monthly reminder to update. Self-hosting is not hard, but it is ongoing, and the instances that go wrong are almost always the ones nobody has touched in a year.
Frequently asked questions
From $6.49/month promotional, or about $12/month at renewal, for a 1 vCPU / 4GB VPS, which comfortably runs n8n with Postgres for most users.
About 15 minutes with Docker Compose, or a couple of minutes with a one-click template.
2 vCPU and 4GB RAM is the sweet spot for production. Light personal use runs fine on 1 vCPU / 2GB.
Yes, for HTTPS and reliable webhooks. Point an A record at your VPS IP and use Caddy for automatic TLS.
Almost always, if you have moderate volume. A $12 VPS with unlimited executions beats the €20/mo Cloud Starter plan on cost alone.
