How to self-host n8n
n8n's Community Edition is free to self-host. You pay only for the server. Below are three routes, from least to most hands-on, with the commands taken from n8n's own documentation.
Steps and prices checked Nov 19, 2026 against the official docs (sources below). n8n on GitHub: 213k stars, Custom license, active, latest release stable on Nov 30, 2026 (as of Nov 30, 2026).
Before you start: n8n says self-hosting needs real server skills (containers, security, scaling) and that mistakes can lead to data loss, security issues and downtime. If that is not you, use the one-click route or n8n Cloud.
Three ways to run it
| Option | Best for | Cost | How |
|---|---|---|---|
| Railway (one click) | Fastest. No server to manage. | Hobby plan $5/month minimum, includes $5 of usage | A community template deploys n8n with PostgreSQL: deploy n8n on Railway. |
| DigitalOcean Droplet | Cheapest always-on server you control, with automatic HTTPS. | $6/month (1 GiB) or $12/month (2 GiB) | Follow the steps below, based on n8n's official DigitalOcean guide. Create the server at DigitalOcean. |
| Docker on your computer | Trying n8n out. Not reachable from the internet without extra work. | Free | One docker run command (see the end of this guide). |
What you need
- A domain or subdomain you can point at the server (for example
n8n.example.com). - A server with Docker. n8n does not publish a minimum RAM figure; its DigitalOcean guide says a basic shared-CPU plan is enough for most usage.
- For production, n8n recommends PostgreSQL. The default SQLite database suits testing and small setups.
Step by step (your own server)
- Create a Droplet. In DigitalOcean, create a Droplet from the Docker image on the Marketplace tab. n8n's guide says a basic shared-CPU plan is enough for most usage. Choose SSH-key login.
- Log in and create a non-root user. SSH in as root, then create a user and give it sudo rights. Log back in as that user.
adduser <username> usermod -aG sudo <username> - Get n8n's Docker + Caddy setup. n8n maintains a ready-made configuration with Caddy, a web server that gets and renews HTTPS certificates automatically.
git clone https://github.com/n8n-io/n8n-docker-caddy.git cd n8n-docker-caddy sudo docker volume create caddy_data sudo docker volume create n8n_data - Point your domain at the server. At your DNS provider, create an A record for your n8n subdomain pointing to the Droplet's IP address.
- Open the web ports.
sudo ufw allow 80 sudo ufw allow 443 - Fill in the settings. Edit
.env(it has inline comments), then set your domain in the Caddy config.nano .env nano caddy_config/CaddyfileThe Caddyfile should look like this, with your own domain:
n8n.example.com { reverse_proxy n8n:5678 { flush_interval -1 } } - Start n8n. This can take a few minutes. Then open your domain in a browser and create the owner account.
sudo docker compose up -d
Updating
n8n releases a new minor version most weeks. From the folder with your compose file:
docker compose pull
docker compose down
docker compose up -dBackups
Back up the n8n_data volume. Even with PostgreSQL, n8n keeps important data there, including the encryption key for saved credentials.
Try it locally first
To test on your own computer with Docker installed, then open http://localhost:5678:
docker volume create n8n_data
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-e GENERIC_TIMEZONE="America/New_York" \
-e TZ="America/New_York" \
-e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
-v n8n_data:/home/node/.n8n \
n8nio/n8n What it costs
| Self-hosted on a 1 GiB DigitalOcean Droplet | $6/month |
|---|---|
| Self-hosted on a 2 GiB DigitalOcean Droplet | $12/month |
| Railway Hobby plan | $5/month minimum, includes $5 of usage; extra usage billed |
| n8n Cloud Starter (for comparison) | €20/month billed annually, 2.5K executions |
DigitalOcean Basic Droplet sizes and list prices
| Memory | vCPU | SSD | Price |
|---|---|---|---|
| 512 MiB | 1 vCPU | 10 GiB | $4/month |
| 1 GiB | 1 vCPU | 25 GiB | $6/month |
| 2 GiB | 1 vCPU | 50 GiB | $12/month |
| 2 GiB | 2 vCPUs | 60 GiB | $18/month |
| 4 GiB | 2 vCPUs | 80 GiB | $24/month |
| 8 GiB | 4 vCPUs | 160 GiB | $48/month |
List prices checked Nov 19, 2026; they can change. Some hosting links on this page are affiliate links, which never change what we recommend.
FAQ
How much does it cost to self-host n8n?
The software is free. Server costs start at $6/month for a 1 GiB DigitalOcean Droplet, or Railway's $5/month Hobby plan, which includes $5 of usage. n8n Cloud Starter, for comparison, is €20/month billed annually for 2.5K executions.
Can I self-host n8n for free?
Yes, under the Sustainable Use License, for internal business, personal or non-commercial use. You can run it free on your own computer with Docker; to keep it online for webhooks you need a server.
Does self-hosted n8n need PostgreSQL?
No. It uses SQLite by default, which n8n says suits testing and small setups. n8n recommends PostgreSQL for production, and SQLite is not supported in queue mode.
Related
Sources
- n8n docs: Deploy to DigitalOcean
- n8n docs: Install with Docker
- n8n docs: Production requirements
- n8n pricing
- Railway n8n template
- Railway pricing
- DigitalOcean Droplet pricing
Commands are adapted from the official docs linked above (example domains replaced with placeholders). Spot something out of date? Tell us at hello@opensourceswap.com.