Self Host n8n: A Beginner's Docker Guide With Security and Maintenance Basics
To self host n8n, you run the workflow automation tool on your own computer or server instead of using n8n Cloud. It can save subscription costs and give you control over data, but it also makes you responsible for installation, security, backups and uptime. n8n's own documentation warns that self-hosting requires technical skills in servers, containers, scaling and security, and that mistakes can cause data loss, security issues or downtime. This guide covers the basic Docker setup from n8n's documentation, the decisions that matter and when Cloud is the better choice, checked on 15 October 2026.
Self-hosted or cloud: decide first
n8n's Community Edition is free to self-host under its Sustainable Use License, while n8n Cloud is a paid hosted service. From our earlier research, Cloud plans start at EUR 20 a month (annual billing) with 2.5K executions, and n8n counts one execution per full workflow run. Self-hosting removes that subscription but adds server costs, time and risk. If you have no experience with servers, n8n itself suggests considering Cloud. See our Zapier vs Make vs n8n comparison for costs and tradeoffs.
What you need to self host n8n
According to n8n's Docker documentation, install Docker Desktop on Mac, Windows or Linux, which includes Docker Engine and Docker Compose. On Linux without a graphical environment, install Docker Engine and Docker Compose separately. n8n recommends the stable image for production and warns that the beta image is the newest and may be unstable. You also need a computer or server that stays on if workflows must run on schedules.
Step 1: Create a persistent volume
n8n's documentation starts with a Docker volume so your data survives restarts:
`docker volume create n8n_data`
The volume stores workflows, credentials and encryption keys. Keeping it persistent is essential: without it, you can lose everything when the container is removed.
Step 2: Start n8n
The documentation gives a docker run command like this, where you replace the timezone placeholder:
`docker run -it --rm --name n8n -p 5678:5678 -e GENERIC_TIMEZONE="YOUR_TIMEZONE" -e TZ="YOUR_TIMEZONE" -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true -v n8n_data:/home/node/.n8n n8nio/n8n`
Port 5678 is mapped to the host, so you open http://localhost:5678 in your browser to create the owner account. `TZ` sets the container's system timezone, while `GENERIC_TIMEZONE` sets the timezone used by schedule nodes such as the Schedule Trigger. The setting N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS enforces secure permissions on the configuration file. Note that the documentation page itself is marked outdated and recommends Docker Compose as the current installation method, so check the latest instructions.
Why Docker Compose is recommended
Docker Compose lets you describe your setup in a file, restart it consistently and add services such as a database. n8n's documentation page for plain Docker recommends Compose as the current method. Follow the newest n8n installation instructions rather than copying old commands from blogs or videos.
Database and persistence
By default n8n uses SQLite stored in its data directory. n8n's documentation notes that even when you use PostgreSQL, the data directory still holds encryption keys and other important data, so keep it persistent. For heavier use, many teams choose PostgreSQL; follow n8n's current documentation for configuration.
Security basics
- Do not expose n8n to the internet without HTTPS, strong authentication and a reverse proxy.
- Do not use the built-in tunnel in production. n8n's documentation says it is for local development and testing only and that "it isn't safe to use it in production."
- Protect credentials and encryption keys, and keep backups of them separately.
- Keep the server and n8n updated.
- Limit who can create or edit workflows.
- Review community nodes before installing.
Backups and updates
Back up the data volume and your database regularly, and test restoring them. Before updating n8n, read release notes, back up first and try the update on a test copy for important workflows. Keep a record of the version you run. Export workflows as files so you have a second copy outside the server.
Monitoring and reliability
Self-hosted workflows run only when the server does. Add alerts for failed executions and for the server being down. For business-critical automations, think about restarts, resource limits and what happens if the machine loses power or internet. See our guide to human-in-the-loop AI automation for review steps on important workflows.
Local vs server hosting
Running n8n on your laptop is fine for learning, because schedules stop when the laptop sleeps. For always-on workflows, use a small server or a managed container service, and follow security guidance for exposing it. Many beginners start local with our n8n tutorial for beginners and move to Cloud or a server when workflows matter.
Costs to include
Count server or hosting costs, domain and certificates, backup storage, the time you spend on maintenance and the cost of any outage. Compare that total with n8n Cloud pricing for your expected executions. For many small teams, Cloud's cost is lower than the hidden time cost of self-hosting; for others, data control and volume justify running it themselves.
Example: a freelancer's learning setup
A freelancer installs Docker Desktop on her laptop, creates the n8n_data volume and starts n8n with her timezone. She builds a workflow that sends a daily summary email, learns how credentials work and exports the workflow file as a backup. When clients start to depend on her automations, she moves them to n8n Cloud rather than running a server herself, avoiding security and uptime work.
Common mistakes
- No persistent volume.
- Exposing n8n to the internet without protection.
- Using the production tunnel.
- Skipping backups of the encryption key.
- Copying outdated install commands.
When to move to Cloud
Consider n8n Cloud if workflows are business-critical, if you lack server experience, if you need predictable uptime or if security and maintenance take more time than the subscription costs. You can export workflows from a self-hosted instance and import them elsewhere, so starting local does not lock you in.
FAQ
Is it free to self host n8n?
The Community Edition is free to self-host under the Sustainable Use License, but you pay for servers, time and maintenance.
What do I need to install n8n with Docker?
Docker Desktop on Mac, Windows or Linux, which includes Docker Engine and Compose, per n8n's documentation.
Why do I need a volume?
A persistent volume keeps workflows, credentials and encryption keys safe when the container restarts or is replaced.
Can I use the built-in tunnel in production?
No. n8n's documentation says the built-in tunnel is for local development and testing only and is not safe in production.
Should beginners self host?
n8n advises that users without server and security experience should consider n8n Cloud.
Conclusion
To self host n8n, follow n8n's current Docker or Compose instructions, keep a persistent volume, set your timezone, secure access and back up regularly. Weigh the hidden costs of maintenance and security against Cloud pricing, and choose Cloud when reliability matters more than control.
Sources and methodology
Installation steps, warnings and the outdated-page note come from n8n's Docker installation documentation (https://docs.n8n.io/hosting/installation/docker/), checked 15 October 2026. Cloud pricing and the Community Edition licence come from https://n8n.io/pricing/, verified earlier in October 2026. This guide is based on our earlier research and testing of AI image, video and automation tools, linked throughout. It contains no vendor pricing or legal claims beyond those attributed below. Features, prices and platform rules change; check each provider's current terms.