n8n Self-Hosting: Setting Up with Docker and How It Differs from Cloud
・ Employee Store Operations

Summary
You can install and run n8n on your own computer or server. The official docs recommend setting it up with Docker. This article walks through the differences from the cloud version, setup with Docker Compose, backups, settings for external access, and updates.
We checked this article against the official n8n documentation on October 2, 2026. Steps and settings change between versions. Before you start, check the latest information in the sources at the end.
Self-hosting n8n means installing and running n8n on your own computer or server. The official docs describe two methods: setting it up with Docker Compose, and setting it up with a one-line command. Both use Docker.
Self-Hosting vs. the Cloud Version
There are two ways to use n8n: use n8n Cloud, run by n8n, or install it in your own environment. The official docs say both support production use. The difference is who manages the server.
| Point | n8n Cloud | Self-hosting |
|---|---|---|
| Setup | No installation needed | Set up with Docker or similar |
| Server management and updates | Handled by n8n | Handled by you |
| Configuration freedom | Choose within the options provided | You decide the environment and settings |
| Getting started | 14-day trial, then choose a paid plan | Community edition has no license fee |
| What you pay for | The plan fee | Server costs and operating effort |
n8n Cloud
- No installation needed
- n8n owns the server and updates
- Paid plan after a 14-day trial
Self-hosting
- Set up with Docker
- You own the server, updates and backups
- Community edition has no license fee
The official docs say self-hosting requires technical knowledge: setting up servers and containers, managing resources, securing the system, and configuring n8n. Mistakes in configuration can lead to data loss, security issues, and downtime. If you are not used to managing servers, n8n recommends n8n Cloud.
Self-hosted editions
If you run n8n without a license key, you get the Community edition. It includes almost all features. What it does not include is SSO (SAML, LDAP) and sharing of workflows and credentials. Registering an email address adds features such as folders. If you need SSO or separate environments, you receive a license key with a paid Business or Enterprise plan. We compare costs in n8n pricing.
What You Need: Server Guidelines and Docker
The official docs recommend Docker for most self-hosting cases. Docker runs n8n in an isolated environment, which avoids problems caused by differences in operating systems and tools.
- Docker Engine and Docker Compose v2. Check with docker compose version
- On Mac and Windows you can use Docker Desktop, which includes Docker Engine and Docker Compose
- On Windows, use WSL and keep your working folder inside the WSL file system
- For external access, your own domain and a server to point a subdomain to
Recommended specs
The official guide for building a Docker Compose setup by hand calls for at least 4 GB of memory and at least 2 vCPUs. The setup in this guide includes a sandbox where n8n Assistant runs AI-generated code. Because the sandbox runs Docker inside Docker, the docs say it needs more headroom than a normal container.
n8n does not limit the amount of data each node fetches or processes. Workflows that handle large data, or many workflows running at once, can run out of memory. The official docs suggest adding memory or processing data in smaller pieces.
About installing with npm
Installing with npm is deprecated from n8n 3.0. According to the official docs, n8n 3.0 is scheduled for release in October 2026 and will be distributed only via Docker from then on. If you are installing on your own computer now, plan on Docker.
Setting Up with Docker Compose
The official docs offer two ways to use Docker.
- One-line setup: running curl -fsSL https://get.n8n.io | sh checks Docker, creates an n8n folder and config files, and starts n8n. Good for trying it on your own computer
- Write the Docker Compose file yourself: use this when you want fine control over settings or when you publish on a server
With either method, opening http://localhost:5678 in a browser on your own computer shows the n8n screen.
Steps to publish on a server
The steps for publishing on a Linux server are in the official Use Docker Compose page. The flow is as follows.
- Install Docker and Docker Compose, then check with docker --version and docker compose version
- Add an A record in DNS that points a subdomain for n8n to the server's IP address
- Create a .env file in the working folder with the domain name, subdomain, time zone, and an email address for the certificate
- Create compose.yaml in the same folder. The official example defines two containers: n8n and Traefik
- Start with sudo docker compose up -d
- 1Install Docker and ComposeCheck the versions
- 2A record in DNSPoint the subdomain to the server
- 3Write .envDomain, time zone, email
- 4Write compose.yamln8n and Traefik
- 5docker compose up -dOpen over HTTPS
In the official example, Traefik is a proxy that manages TLS/SSL certificates and routes traffic. After startup, you open n8n at the combination of subdomain and domain you set (for example, https://n8n.example.com). This setup accepts HTTPS only; it does not open over HTTP.
Data Storage and Backups
By default, n8n stores credentials, past executions, and workflows in SQLite. The database file is ~/.n8n/database.sqlite. With Docker, you mount this .n8n folder as the n8n_data volume at /home/node/.n8n. Once mounted, your data survives when you recreate the container.
When you have more than a few users, or in production where workflows run constantly, the official docs recommend PostgreSQL. Supported versions are PostgreSQL 17 and 18, plus 16 for compatibility (as stated in July 2026).
Do not lose the encryption key
On first startup, n8n creates an encryption key and saves it in the config file in the .n8n folder. Credentials are encrypted with this key before they are stored in the database. Without the key, you cannot read credentials from a restored database. Even if you use PostgreSQL, back up the .n8n folder. You can also set your own key with the N8N_ENCRYPTION_KEY environment variable.
How to back up
- Save the entire .n8n folder. With SQLite, stop n8n before copying
- With PostgreSQL, back up using database tools
- Export with commands: n8n export:workflow --backup and n8n export:credentials --backup write workflows and credentials to JSON files
Command exports do not include users and permissions, execution history, variables, or instance settings, including the encryption key. They are enough to move workflows to another environment, but a full restore needs backups of the .n8n folder and the database. Exports with --decrypted contain credentials in plain text, so delete them when you are done.
Settings for External Access: Domain and HTTPS
For external services to call n8n via webhooks, n8n must be reachable from the internet. For external access, prepare a domain and HTTPS.
Setting up HTTPS
The official docs list two HTTPS methods. The recommended one is to place a reverse proxy such as Traefik, or a network load balancer, in front of n8n. It can also handle certificate renewal. The other is to pass certificates directly to n8n with the N8N_SSL_CERT and N8N_SSL_KEY environment variables. In that case, you manage certificate renewal yourself.
Webhook URLs
n8n builds webhook URLs from N8N_PROTOCOL, N8N_HOST, and N8N_PORT. Behind a reverse proxy, the internal port 5678 and the public port 443 do not match. In that case, configure the following.
- Set the public URL in the N8N_WEBHOOK_URL environment variable. The older WEBHOOK_URL is deprecated from n8n 2.35.0
- Set the N8N_PROXY_HOPS environment variable to 1
- Have the last proxy pass the X-Forwarded-For, X-Forwarded-Host, and X-Forwarded-Proto headers
We cover how to protect permissions and credentials after going public in n8n security.
How to Update
n8n releases a new minor version almost every week. The production release is stable, and the newest version ships as beta, which can be unstable. The official docs recommend updating at least once a month and not skipping many versions at once.
- Before updating, back up the .n8n folder and the database
- Check the release notes for breaking changes
- In the folder with the compose file, run docker compose pull to get the new image
- Stop and remove the old version with docker compose down
- Start the new version with docker compose up -d
- 1Back up.n8n folder and database
- 2Read the release notesCheck for breaking changes
- 3docker compose pullGet the new image
- 4docker compose downStop the old version
- 5docker compose up -dStart the new version
If you used the one-line setup, update with curl -fsSL https://get.n8n.io | sh -s -- --upgrade. If your paid plan includes Environments, you can test the update in a test environment first.
Selling Workflows Built on Self-Hosted n8n
Self-hosted n8n is provided under the Sustainable Use License. It allows internal business use, non-commercial use, and personal use. The license page allows charging for consulting and support, such as building workflows. The condition for internal business use is that you do not offer n8n in a form where customers connect their own accounts and build workflows. If you are unsure, check with the n8n contact listed on that page.
Employee Store is a marketplace where companies can adopt AI agents built by developers. You can list n8n workflows too. There is no listing fee or upfront cost. The fee is 20% of the deal amount and applies only when a deal closes. For details, see the seller guide.
FAQ
- Does self-hosting n8n cost anything?
- The Community edition has no license fee. You cover server costs, the domain, and the work of updates and backups. Features such as SSO require a Business or Enterprise license key.
- What do I need just to try it on my own computer?
- Install Docker. Running curl -fsSL https://get.n8n.io | sh creates the config files and starts n8n. After startup, open http://localhost:5678 in a browser. On Windows, use WSL.
- Should I use SQLite or PostgreSQL?
- For trying it out, the default SQLite works. When you have more than a few users, or in production where workflows run constantly, the official docs recommend PostgreSQL. In either case, back up the .n8n folder that holds the encryption key.
Sources
- n8n Docs: Host n8n (checked October 2, 2026)
- n8n Docs: Choose how to use n8n
- n8n Docs: Install with Docker
- n8n Docs: Install using Docker Compose
- n8n Docs: One-line setup
- n8n Docs: Use Docker Compose
- n8n Docs: Compare editions
- n8n Docs: Choose n8n's database
- n8n Docs: Fix memory issues
- n8n Docs: Back up and restore
- n8n Docs: Set a custom encryption key
- n8n Docs: Set up SSL
- n8n Docs: Configure webhook URLs with reverse proxy
- n8n Docs: Update n8n
- n8n Docs: Sustainable Use License
- Employee Store: Seller Guide (Japanese)


