Power-User · Level 3 of 3
Self-hosting n8n means running the open-source workflow automation tool on your own server instead of paying per execution in the cloud. The Community Edition is free with no execution limits, so the only real cost is a small VPS (roughly $5–12/mo for a budget box) plus the time to maintain it. This guide walks the full setup on a budget VPS: Docker Compose, automatic HTTPS, working webhook URLs, backups, and updates — written for the first time you do it.
If you have been hitting Zapier task limits (the free plan caps at 100 tasks a month and two-step Zaps), moving those workflows to a self-hosted n8n instance trades a monthly per-task bill for a fixed server cost you control. Here is the clean way to stand it up.
Is n8n free to self-host?
Yes. The n8n Community Edition is free and open-source, and self-hosting it removes the per-execution billing that the cloud plans use. n8n Cloud starts at EUR 20/mo (Starter, 2,500 executions) and EUR 50/mo (Pro, 10,000 executions), billed per full workflow execution regardless of step count (verify current numbers at n8n.io/pricing). Self-hosting has no execution cap, but you take on the server and its upkeep.
"Free" here means the software, not the hosting. The honest total cost breaks down like this:
| Cost line | Typical amount | Notes |
|---|---|---|
| Budget VPS (1–2 vCPU, 2 GB RAM) | ~$5–12/mo | Ranges by provider; check current VPS pricing before you commit |
| Domain (for HTTPS + webhooks) | Varies by registrar | A domain you may already own works; a subdomain is enough |
| Your time (setup) | 1–2 hours first time | The real cost of self-hosting is maintenance, not money |
| Your time (upkeep) | ~15–30 min/mo | Updates, checking backups, occasional troubleshooting |
| n8n Community Edition | $0 | No execution limits |
Compared with n8n Cloud, self-hosting pays off once your execution count climbs past what the cloud tiers include, or when you want full control of your data. If you would rather not run a server at all, the cloud plan is the trade you make for that convenience. Be honest with yourself about the upkeep line before you start.
What you need before you start (n8n VPS requirements)
n8n is light. A budget VPS handles a single-user instance with room to spare. Before the first command, get these four things ready:
- A VPS with at least 1 vCPU and 2 GB of RAM running a current Ubuntu LTS. 2 GB is comfortable; 1 GB can work for light use but leaves little headroom for the database and updates.
- A domain or subdomain you can point at the server. You need this for a real HTTPS certificate and for webhook URLs that outside services can reach. An IP address alone will fight you on both.
- SSH access to the VPS as a user who can run Docker.
- Docker and Docker Compose, installed in the steps below.
Pick a provider you are comfortable managing. This walkthrough uses a Hostinger VPS as the example box because it is a common budget choice, but the commands are the same on any Ubuntu VPS.
Step-by-step: install n8n with Docker Compose
The plan: spin up the VPS, point a subdomain at it, install Docker, then run n8n behind Caddy so HTTPS is issued and renewed for you. Caddy gets a valid certificate automatically once the domain resolves, which removes the most common self-host headache.
1. Create the VPS and log in
Create an Ubuntu LTS VPS in your provider's panel and note its public IP. Then connect over SSH from your own machine:
ssh root@YOUR_SERVER_IP
Update the system first:
apt update && apt upgrade -y
2. Point a subdomain at the server
In your domain registrar's DNS settings, add an A record for a subdomain (for example n8n.yourdomain.com) pointing to the VPS public IP. DNS can take a few minutes to propagate. Caddy will not be able to issue a certificate until this record resolves, so do this before bringing the stack up.
3. Install Docker and the Compose plugin
Install Docker from the official convenience script, then confirm the Compose plugin is present:
curl -fsSL https://get.docker.com | sh
docker compose version
If docker compose version prints a version number, you are set.
4. Write the docker-compose file
Create a working directory and a docker-compose.yml. This is the full worked example — two services, n8n and Caddy, sharing named volumes so your data and certificates survive restarts:
mkdir -p ~/n8n && cd ~/n8n
nano docker-compose.yml
Paste this, changing the domain, timezone, and the basic-auth values to your own:
services:
n8n:
image: docker.n8n.io/n8nio/n8n:latest
restart: unless-stopped
environment:
- N8N_HOST=n8n.yourdomain.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.yourdomain.com/
- N8N_EDITOR_BASE_URL=https://n8n.yourdomain.com/
- GENERIC_TIMEZONE=America/New_York
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=changeme
- N8N_BASIC_AUTH_PASSWORD=use-a-long-random-password
volumes:
- n8n_data:/home/node/.n8n
caddy:
image: caddy:latest
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
n8n_data:
caddy_data:
caddy_config:
Now create the Caddyfile next to it. Caddy reads your domain, requests a certificate, and reverse-proxies to n8n:
nano Caddyfile
n8n.yourdomain.com {
reverse_proxy n8n:5678
}
5. Bring the stack up
Start both containers in the background:
docker compose up -d
Watch the logs until Caddy reports a certificate and n8n reports it is ready:
docker compose logs -f
Open https://n8n.yourdomain.com in your browser. You should get the n8n editor behind the basic-auth prompt you set. Create your owner account when n8n asks, and you have a working instance.
Make webhooks and HTTPS actually work
The single most common self-host mistake is webhooks that trigger from inside n8n but fail when an outside service calls them. That is why the compose file sets WEBHOOK_URL and N8N_EDITOR_BASE_URL to your public HTTPS address. n8n uses those values to build the webhook URLs it hands to services like Stripe, GitHub, or a form provider. If they point at localhost or the raw IP, the external service cannot reach the callback and the workflow never fires.
Two checks before you trust it:
- Open a workflow with a Webhook node and confirm the Production URL it shows starts with your
https://domain, not an internal address. - From another machine, send a test request to that URL and confirm n8n receives it. If the certificate is valid and the record resolves, this works on the first try.
Because Caddy renews certificates automatically, HTTPS is not something you have to babysit after the initial issue. If a certificate ever fails to appear, the cause is almost always DNS not resolving yet or ports 80 and 443 being blocked by a firewall.
Back up your n8n data
Everything that matters — your workflows, credentials, and execution history — lives in the n8n_data volume. Backing it up is a two-minute job that saves a rebuild. This command writes a timestamped archive of the volume to a backups folder:
mkdir -p ~/backups
docker run --rm \
-v n8n_n8n_data:/data \
-v ~/backups:/backup \
busybox tar czf /backup/n8n-$(date +%F).tar.gz -C /data .
Confirm the volume name with docker volume ls first; Compose prefixes it with the project folder name (here n8n_). To make it recurring, add a cron entry so it runs nightly:
crontab -e
0 3 * * * docker run --rm -v n8n_n8n_data:/data -v /root/backups:/backup busybox tar czf /backup/n8n-$(date +\%F).tar.gz -C /data .
Copy those archives off the server periodically — a backup that only lives on the same VPS does not help if the VPS itself is lost.
Keep n8n updated
n8n ships new versions often, and self-hosting means you apply them. The update is a pull-and-recreate:
cd ~/n8n
docker compose pull
docker compose up -d
Your data stays put because it lives in the named volume, not the container. Take a backup with the command above before a major version jump so you can roll back if a node behaves differently. Checking for updates once a month is a reasonable cadence for a single-user instance.
Where self-hosting breaks
Self-hosting is stable once it is set up correctly, but a handful of failure points cause most of the trouble. Knowing them upfront saves an evening of guessing:
- Webhook URLs pointing inward. If
WEBHOOK_URLis unset or wrong, external triggers silently fail. Set it to your public HTTPS address, as in the compose file above. - SSL certificate never issues. Almost always DNS has not propagated or a firewall is blocking ports 80 and 443. Confirm the
Arecord resolves and the ports are open. - Skipped backups. The one time you need a backup is after something breaks. Automate it with cron and copy archives off-server.
- Updates left too long. Falling many versions behind makes eventual upgrades riskier. Small, regular updates beat one large jump.
- Running out of memory. A 1 GB box can stall during updates or heavy workflows. If executions hang or the container restarts, more RAM is usually the fix.
Self-host, n8n Cloud, or stay on Zapier?
Self-hosting is worth it when you run enough automations that per-execution or per-task billing adds up, and when you want your data on infrastructure you control. It is the Power-User path: more setup, lower ongoing cost, full ownership.
n8n Cloud makes sense if you would rather not manage a server and your volume fits inside the EUR 20 or EUR 50 tiers. Zapier stays reasonable for light use inside the free plan, but its task-based pricing scales steeply as volume grows, which is exactly the pressure that pushes people toward n8n in the first place. Match the tool to how much you run and how much upkeep you want to own.
Once your instance is live, the next question is what to build on it. For a starting list of automations that pay back the setup time, see 15 workflow automations that save solopreneurs 5 hours a week. If you want a lighter warm-up before wiring up full workflows, automating your inbox with Gmail filters and labels is a fast win that needs no server at all.
Self-hosting n8n is a one-evening project that hands you an automation platform with no execution ceiling for the price of a small VPS. Set the webhook URL correctly, let Caddy handle HTTPS, automate your backups, and update on a monthly rhythm — and the instance mostly runs itself.
Evidence and verification
Last verified: July 12, 2026. This guide was checked against n8n’s official self-hosting documentation and Docker installation guidance. Interfaces, plan limits, pricing, and feature availability can change. Confirm any feature or cost that determines your setup before relying on it, and test the workflow with a non-critical example first.
Leave a Reply