Guide

How to Self-Host n8n in 2026: Setup, Server Cost and Upkeep

Self-host n8n with Docker Compose, Postgres and HTTPS on a $24 server with 4 GB of RAM. Steps, backups, updates and server prices checked October 2026.

How to Self-Host n8n in 2026: Setup, Server Cost and Upkeep

To self-host n8n, rent a Linux server with at least 4 GB of RAM and 2 vCPUs, install Docker, and run n8n's Docker Compose file behind a reverse proxy with Postgres as the database. That server costs $24 a month on DigitalOcean, Akamai (Linode) or AWS Lightsail, prices read on October 18, 2026. The Community Edition itself is free, so the server and your time are the whole bill.

Self-hosting makes sense when your workflows outgrow n8n Cloud's caps or you need the data on your own machine. It is a bad trade if nobody on the team wants to own backups and monthly updates, because n8n's own docs say mistakes "can lead to data loss, security issues, and downtime".

Toolradar data: the workflow automation ranking we run covers 1,026 tools as of October 18, 2026. Of its top 10, 8 publish a paid price, with a median cheapest paid plan of $22.50 a month, about what the 4 GB server costs here.

What a self-hosted n8n costs each month

The software is free under the Sustainable Use License, so the bill is the server plus its backups. The table prices the size n8n asks for in its Docker Compose install guide (4 GB of RAM, 2 vCPUs, needed for the sandbox that runs Assistant code) and one lean setup without that sandbox.

Setup Server Backups Monthly total Watch for
Lean: n8n, Postgres and Traefik, no Assistant sandbox DigitalOcean Basic, 2 GiB, 1 vCPU, $12 Weekly, 20% of the Droplet price ($2.40) $14.40 n8n states no minimum for this setup, so watch memory
Full stack on DigitalOcean Basic, 4 GiB, 2 vCPU, 80 GiB SSD Daily, 30% of the Droplet price ($7.20) $31.20 Weekly backups instead bring it to $28.80
Full stack on Akamai (Linode) Linode 4 GB, 2 CPUs, 80 GB storage Backups add-on, priced separately $24 before backups Check the add-on price on Akamai's site
Full stack on AWS Lightsail General purpose, 4 GB, 2 vCPUs, public IPv4 included Snapshots at $0.05 per GB-month $24 plus snapshot storage Snapshot cost grows with disk use
DigitalOcean with managed Postgres Basic 4 GiB Droplet Managed PostgreSQL from $15.15 (1 GiB RAM, 1 vCPU) $39.15 before Droplet backups The database is billed as its own product

Prices were read on October 18, 2026, on DigitalOcean Droplet pricing, DigitalOcean managed database pricing, Akamai shared CPU pricing and Lightsail pricing. Totals add only the printed prices; the backup lines use DigitalOcean's own percentages.

The execution count does not move this bill. At 10,000 runs a month, the $31.20 DigitalOcean setup works out to about $0.003 per run, and the server costs the same at 100,000 runs as long as it keeps up. On n8n Cloud the same 10,000 runs need the Pro plan at €50 a month billed annually, priced in euros, on n8n's pricing page.

Before you start: what self-hosting changes

Three things move from n8n to you the day you self-host, and each is a recurring job rather than a one-time setup step, so weigh them before you rent the server.

  • Limits. Cloud Starter stops a run after 5 minutes and allows 5 at once; Pro allows 40 minutes. A self-hosted instance in regular mode has no concurrency limit by default, and the Cloud plans' run-time caps do not apply.
  • Data. Workflows, credentials and execution history live in your database. Losing the server without a backup loses all three.
  • Features. The free Community Edition lacks SSO, Git version control, environments, external secrets, log streaming and workflow sharing. Only the instance owner and the person who created a workflow or credential can open it.

That last point decides more teams than cost does. If five people need to edit the same workflows, the free edition is awkward, and the paid self-hosted Business plan is €667 a month billed annually for 40,000 executions with SSO and Git. n8n's pricing page also offers 50% off Business to companies with fewer than 20 employees that qualify for its Start-up Plan.

Step 1: Rent the server and point a subdomain at it

Pick a size from the table and a region near the apps your workflows call, since every node that hits an API pays that round trip. Ubuntu or Debian on a Basic Droplet, a Linode or a Lightsail instance all work, because n8n runs entirely inside Docker.

Create an A record for a subdomain such as n8n.example.com that points to the server's IP address. Do it now: the reverse proxy requests a TLS certificate on first start, and that request fails until DNS resolves.

Step 2: Install Docker and Docker Compose v2

Install Docker Engine and the Compose plugin from Docker's own instructions for your distribution, then check both:

docker --version
docker compose version

Compose v2 matters. n8n's one-line installer checks for the docker compose plugin and rejects the older standalone docker-compose binary. From n8n 3.0, Docker is the only way n8n is distributed, so an npm install is not a long-term option.

Step 3: Write the .env and compose.yaml

n8n's Docker Compose guide for a Linux server runs two containers: n8n and Traefik, which obtains the Let's Encrypt certificate and redirects HTTP to HTTPS. Create a project folder with an .env file:

DOMAIN_NAME=example.com
SUBDOMAIN=n8n
GENERIC_TIMEZONE=America/New_York
[email protected]

Set GENERIC_TIMEZONE on purpose. Schedule triggers use it, and n8n falls back to New York when it is missing, so a team in Chicago would see its 9:00 job fire an hour early.

The n8n service in the compose file sets N8N_HOST, N8N_PROTOCOL=https, NODE_ENV=production and N8N_WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/, and mounts a volume named n8n_data at /home/node/.n8n. The webhook URL is the setting people miss most. Behind a proxy, n8n would otherwise build webhook URLs from its internal port 5678, so it needs N8N_WEBHOOK_URL to show the right address in the editor and register it with outside services. n8n's reverse proxy note also asks for N8N_PROXY_HOPS=1. The variable exists from n8n 2.30.0; older versions read WEBHOOK_URL.

Step 4: Swap SQLite for Postgres

The default compose file has no database service, so n8n stores everything in SQLite inside its volume. n8n's docs call SQLite fine for trying things out and recommend Postgres for a production instance with more than a handful of users or workflows running around the clock.

Add a postgres:18 service with its own volume, then point n8n at it with DB_TYPE=postgresdb and the DB_POSTGRESDB_* variables for host, port, database, user and password. Two warnings from n8n's guide save a bad morning:

  1. Keep PGDATA: /var/lib/postgresql/data in the Postgres service. Postgres 18 moved its default data path, and without that line the database writes outside the volume and starts empty after a restart.
  2. Switching to Postgres starts a fresh instance. Existing SQLite data does not carry over, so make this choice before you build workflows, not after.

Want the managed route instead? Point the same variables at a hosted database such as DigitalOcean's managed PostgreSQL and drop the container. Our Postgres hosting comparison covers the other providers.

Step 5: Pin the encryption key, then start it

n8n encrypts every saved credential with a key it generates on first launch and stores in the config file inside .n8n. Set your own with N8N_ENCRYPTION_KEY before the first start and keep a copy in your password manager. A database backup without that key restores workflows whose credentials cannot be decrypted.

Start the stack and check it:

docker compose up -d
docker compose ps

Open https://n8n.example.com and create the owner account. During that first setup you can register the Community Edition with your email for a free license key, which adds folders, debug in editor and custom execution data at no cost.

Step 6: Stop the database from filling the disk

Every saved execution takes disk space, and on a small VPS the disk size is fixed by the plan, so an instance that logs every run fills it faster than most teams expect. Pruning is on by default and deletes finished executions after 336 hours (14 days) or once the count passes 10,000, whichever comes first, according to n8n's execution data guide.

For a busy instance, save less in the first place:

  • EXECUTIONS_DATA_SAVE_ON_SUCCESS=none keeps only failed runs, which are the ones you debug.
  • EXECUTIONS_DATA_MAX_AGE=168 cuts retention to seven days.
  • N8N_CONCURRENCY_PRODUCTION_LIMIT=20 queues production runs above 20 at once instead of letting a webhook burst stall the event loop.

Step 7: Back up, then update every month

n8n's backup and restore guide defines a complete backup as two parts: the .n8n folder (the encryption key, plus the database itself on SQLite) and your Postgres database, dumped with Postgres's own tools. The CLI export is useful but partial:

n8n export:workflow --backup --output=backups/workflows/
n8n export:credentials --backup --output=backups/credentials/

Those files hold workflows and credentials only. Users, roles, execution history, variables and instance settings are not in them, so they move workflows between instances but cannot rebuild one. Inside Docker, write them to a bind-mounted host folder, or they vanish with the container.

Updates come often: n8n ships a new minor version most weeks, and its docs listed 2.43.7 as the current stable release in October 2026. n8n asks self-hosters to update at least once a month and to read the release notes for breaking changes. With Compose the update is three commands, run after a fresh backup:

docker compose pull
docker compose down
docker compose up -d

Pin the image to a version tag rather than latest if you want updates to happen when you choose, not on the next pull.

When one server is not enough: queue mode

Queue mode splits n8n into a main instance that receives triggers and webhooks, a Redis queue, and worker processes that run the executions. It is included in the free Community Edition; only multi-main mode, which runs several main instances, needs a paid plan.

The requirements follow from n8n's queue mode guide: set EXECUTIONS_MODE=queue on the main instance and every worker, run Redis, and give every worker the same N8N_ENCRYPTION_KEY. n8n advises against queue mode on SQLite, so do Step 4 first. Each worker runs 10 jobs at once by default, and n8n recommends 5 or more, because many low-concurrency workers can exhaust the database's connection pool.

Gotchas that cost self-hosters time

  • The sandbox is the RAM hog. The memory minimum in n8n's guide comes from the Assistant sandbox, which runs Docker-in-Docker as a privileged container. n8n's own security checklist says to treat it as root on the host and never expose it to the internet.
  • Postgres major upgrades are manual. Moving an existing database from an older Postgres to 18 by changing the image tag fails with database files are incompatible with server. Dump with pg_dumpall and follow the upgrade guide.
  • Imported workflows come back switched off. After an import, activate them in the editor, or pass --activeState=fromJson, which only works in queue or multi-main mode.
  • The license is not open source. The Sustainable Use License allows internal business, personal and non-commercial use. Selling n8n as a hosted service to others falls outside it, so read the license file before you build a product on it.

Self-host or pay for n8n Cloud?

Self-host when runs are long, volume is high or the data must stay on your server. A workflow that loops through an LLM for 20 minutes is cut off on Cloud Starter, and a 50,000-run month costs the same $31.20 as a 5,000-run month on the DigitalOcean setup.

Pay for Cloud when nobody wants the upkeep. Starter is €20 a month billed annually for 2,500 executions, priced in euros, and includes the managed updates and backups that Step 7 hands to you. For how n8n's per-run billing compares with Zapier's per-task billing, see n8n vs Zapier; for the plans and weak spots, the n8n review.

Frequently asked questions

Is self-hosted n8n free?

The Community Edition is free to self-host under the Sustainable Use License, with almost the full feature set. You pay for the server: $24 a month buys the 4 GB, 2 vCPU size n8n asks for on DigitalOcean, Akamai or Lightsail, prices read in October 2026. SSO, Git version control and workflow sharing need a paid plan.

What server size does n8n need?

n8n's Docker Compose guide asks for at least 4 GB of RAM and 2 vCPUs for the full stack, because the Assistant sandbox runs Docker-in-Docker. Without that sandbox n8n states no minimum, so the $12 Droplet with 2 GiB in the cost table is a starting point to monitor, not a size n8n recommends. Move up a size once memory runs close to full.

Should I use SQLite or Postgres for self-hosted n8n?

Use Postgres for anything in production. n8n's docs reserve SQLite for trying things out and advise against it for queue mode. Decide before you build: switching to Postgres starts a fresh instance, and SQLite data does not carry over.

How do I update a self-hosted n8n?

Back up first, then run docker compose pull, docker compose down and docker compose up -d in the project folder. n8n releases a minor version most weeks and asks self-hosters to update at least once a month, reading the release notes for breaking changes.

What happens if I lose the encryption key?

Your saved credentials become unreadable. n8n encrypts them with a key stored in the .n8n folder or set by N8N_ENCRYPTION_KEY, and a restored database cannot decrypt them without it. Keep the key outside the server, next to your database backups.

Can I sell a hosted n8n to my clients?

Not under the free license. The Sustainable Use License limits use to your own internal business purposes or non-commercial and personal use, and allows distribution only free of charge for non-commercial purposes. Building workflows for your own company is fine.

How we put this guide together

The steps follow n8n's own documentation (Docker Compose install, database, execution data, backup and restore, queue mode and edition comparison pages) and its license file, read on October 18, 2026. Server prices come from each host's pricing page on the same date, in USD, and n8n Cloud prices from n8n's pricing page in euros. This is a desk guide built from those sources, not a hands-on install log. The Toolradar figure comes from the workflow automation ranking on toolradar.com.

Cite this: Devshot, "How to Self-Host n8n in 2026: Setup, Server Cost and Upkeep", October 2026.

For the hosting side, compare servers in best VPS hosting for developers, read the DigitalOcean review and the Hetzner review, and see other apps you can run on the same box in best self-hosting tools. The free credits that can cover a test server are in cloud free tiers compared, and free uptime monitoring covers how to know when the instance goes down. If your workflows are mostly LLM calls, Dify is built around that job. Moving other apps off a platform at the same time? See how to migrate off Heroku. Tool records on Toolradar: n8n, DigitalOcean, Linode and Docker.

Want more setups priced like this one? The Devshot newsletter covers the developer tools and the bills behind them. Get it at devshot.co.

Some offers on this page may be paid placements or contain affiliate links.

Devshot: the daily dev & AI brief

Free daily newsletter, read in 5 minutes.

Subscribe free