How to Self-Host n8n (2026): Docker Setup, Costs and Security
Self-hosting n8n is free software on your own server. Here is the Docker setup, what to secure, what it costs and when Cloud is easier.
Short answer: to self-host n8n you run it on your own server, most simply with Docker. The Community Edition is free, but you pay for the server and you handle updates, backups and security. n8n itself recommends n8n Cloud if you do not have server management experience.
n8n self host or Cloud?
n8n's documentation says self-hosting needs skills in server and container setup, resource management, security and configuration, and that mistakes can cause data loss, security issues or downtime. If that is not you, n8n Cloud removes the server work. See the plans in our n8n pricing guide.
What you need
- A VPS or computer with Docker. Docker Desktop works on Mac, Windows and Linux, and Docker Engine with Docker Compose suits Linux servers without a desktop.
- A domain name and HTTPS if you want webhooks to work from the internet.
- Basic command-line skills.
For server options and prices, read our cheap VPS hosting guide.
n8n Docker setup
This is the quick-start command from n8n's Docker documentation. Replace the timezone with yours, for example America/Toronto. Note that n8n marks this single-container page as outdated and recommends the Docker Compose installation for longer-term use, so read the current n8n Docker docs before you deploy.
docker volume create n8n_data docker run -it --rm \ --name n8n \ -p 5678:5678 \ -e GENERIC_TIMEZONE="America/Toronto" \ -e TZ="America/Toronto" \ -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \ -v n8n_data:/home/node/.n8n \ n8nio/n8n
- -p 5678:5678 opens n8n on port 5678. Visit http://localhost:5678.
- -v n8n_data:/home/node/.n8n keeps your data when the container restarts.
- GENERIC_TIMEZONE sets the timezone for schedule-based nodes.
Use PostgreSQL
By default n8n uses SQLite. For heavier use you can point it at PostgreSQL by setting database environment variables such as DB_TYPE=postgresdb, plus the host, port, database, user and password. Keep the data volume mounted even with PostgreSQL, because it still holds encryption keys and logs. Follow the exact variables in n8n's docs.
Update n8n
With a single container, pull the new image, stop and remove the old container, then start a new one. With Docker Compose, n8n's docs list the sequence docker compose pull, docker compose down, docker compose up -d in your compose folder. Back up your data first.
Security and backups
- Put n8n behind HTTPS and do not expose it without authentication.
- Back up the data volume and, if used, the database.
- Keep the server operating system and Docker updated.
- Store credentials in n8n's credential system, not in workflow fields.
What self hosting n8n costs
The Community Edition has no license fee, but you pay for the server, your time and any backups. A small VPS can cost a few dollars a month. Compare against n8n Cloud, which starts at €20 a month billed annually, before you decide.
Putting n8n behind HTTPS
For webhooks and logins you want a domain name and HTTPS. A common setup is a reverse proxy such as Caddy or Nginx in front of n8n, with a certificate from Let's Encrypt. You also need to tell n8n its public address so webhook URLs are generated correctly. n8n's docs describe the relevant settings, such as the webhook URL variable, so follow them rather than guessing. Do not expose port 5678 directly to the internet.
A simple backup routine
- Back up the n8n data volume on a schedule, not just once.
- If you use PostgreSQL, back up the database too.
- Export important workflows as files and keep a copy outside the server.
- Test a restore on a spare machine before you need it.
- Keep your encryption key safe, because credentials are encrypted with it.
Common problems
| Symptom | Likely cause |
|---|---|
| Webhooks do not arrive | Wrong public URL, firewall or proxy setting |
| Workflows stop after a restart | The container was not set to restart, or the volume was not mounted |
| Slow or crashing workflows | Not enough RAM for the data being processed |
| Schedules run at the wrong time | Timezone variable not set |
Cost example: self-hosting vs n8n Cloud
| Option | Monthly cost | What you also pay |
|---|---|---|
| n8n Cloud Starter | €20 (billed annually) | Nothing else. n8n runs it. |
| Hostinger KVM 1 (24-month promo) | $6.49, then $11.99 at renewal | Setup, updates, backups, security and your time |
| Vultr Regular Performance | From $2.50 | Same as above |
Self-hosting saves money only if your time is cheap or you already run servers. If setting up and securing a server takes you ten hours, that time often costs more than a year of Cloud Starter. Cloud also includes support from n8n and no maintenance.
Sources and last checked
Frequently asked questions
Is n8n free to self-host?
The Community Edition is free to run on your own server. You pay for the server and maintenance, and some features are limited to paid plans.
How do I self-host n8n with Docker?
Install Docker, create a data volume, and run the n8nio/n8n image with port 5678 and your timezone set. Check n8n's docs for the current recommended method.
What server do I need for n8n?
A small VPS with Docker is enough to start. Needs grow with the number and size of workflows.
Is n8n self-hosted safe?
It is as safe as you make it. Use HTTPS, authentication, backups and updates.
Should I use SQLite or PostgreSQL?
n8n uses SQLite by default. PostgreSQL is an option for heavier use.
Is n8n Cloud easier than self-hosting?
Yes. n8n recommends Cloud if you lack server management experience.
How do I do an n8n Docker install?
Install Docker, create a data volume and run the n8nio/n8n image on port 5678. The docs recommend Docker Compose for longer-term use.
Is self hosting n8n worth it?
It can lower software costs if you can manage a server. If not, n8n recommends Cloud.
Prefer not to manage a server?
n8n Cloud removes the setup. Compare plans, or run the free Community Edition yourself.
Try n8n Cloud →Prices and limits were read from the pages below on October 12, 2026. They change often, so confirm before you pay.
