Blog

Tutorials, guides and product news.

Developers

Self-hosting n8n on your own server

3 November 2026 5 min read
Share this post

n8n is an automation tool that connects apps and lets you build workflows. You can run it on your own VPS with Docker. The official documentation walks through a Docker Compose setup and recommends self-hosting for people with technical experience. The installation guides give no figure for CPU, RAM or disk, so it makes sense to start with a small server and scale up as you watch it.

This article covers the license, the setup steps, the settings that matter, backups and updates.

What do you build with n8n?

A workflow in n8n is a trigger plus the steps connected to it. The trigger can be a schedule, a webhook or an event in another app. Typical examples: writing a form submission to a spreadsheet, notifying the team about a new order, or collecting a report every morning and emailing it. You build workflows in a visual editor in the browser. Writing code isn't required, but you can add a code step if you want one.

Why run it on your own server?

  • Your workflows and saved connection details stay on your own server.
  • Scheduled workflows keep running on the server while your own computer is off, and webhooks can trigger them from outside.
  • Your usage limit is set by the power of your server, and if it isn't enough you scale the server up.
  • In return, the upkeep is yours: updates, backups and security.

License: what does free use allow?

n8n isn't open source. By its own description it is "fair-code" software. The source is available, but the Sustainable Use License restricts commercial use. According to the official license page, you can use it free of charge for your company's internal operations and for personal or non-commercial projects. Building workflows for clients as paid consulting is also fine, as long as the clients don't get access to n8n themselves. Offering a service in which customers log in to n8n to build or edit their own workflows (hosting n8n as a service) needs a commercial license. For edge cases, ask n8n's licensing team.

Setup steps

These steps follow the official Docker Compose guide. The guide gets and renews the HTTPS certificate through a reverse proxy called Traefik.

  1. Prepare a Linux server with Docker Engine and Docker Compose installed. Check with docker --version and docker compose version.
  2. Add an A record that points a subdomain of your domain (for example n8n.example.com) to the server's IP address. How to connect your own domain walks you through it.
  3. Create the .env and compose.yaml files from the official guide on the server.
  4. Fill in DOMAIN_NAME, SUBDOMAIN, GENERIC_TIMEZONE and SSL_EMAIL in .env. Use Europe/Istanbul for the time zone. If you leave it out, the default is New York.
  5. Start it: docker compose up -d
  6. Open your subdomain in a browser and create the owner account right away. Whoever fills in that screen first becomes the owner.

Settings you should know

VariableWhat it does
N8N_HOST, N8N_PROTOCOLThe host name n8n runs on and the protocol (https)
N8N_WEBHOOK_URLBehind a reverse proxy, n8n can't work out its outside address. Enter your public HTTPS address so webhook URLs show up correctly. The old name WEBHOOK_URL still works in current versions but is deprecated. On an older version only the old name applies, so check the documentation for your version.
GENERIC_TIMEZONE, TZThe time zone of scheduling nodes
N8N_ENCRYPTION_KEYThe key that encrypts saved connection details

The Webhook node has two addresses: the test address works while you edit the workflow, and the production address works once you activate it. Give outside services the production address. The start of the address comes from the N8N_WEBHOOK_URL value, so if that value is wrong, outside services can't reach your workflow.

The encryption key and backups

On first start n8n generates a random encryption key and keeps it in its data folder (/home/node/.n8n). Your saved connections are encrypted with it. Connection details in a restored database can't be decrypted without the key. Keep a separate copy of the key.

  • What to back up: The data volume (n8n_data) holds the default SQLite database and the key. Stop n8n before copying. If you use PostgreSQL, back the database up separately with its own tools.
  • Quick export: The n8n commands run inside the container. docker compose exec n8n n8n export:workflow --backup --output=/home/node/.n8n/backups/workflows/ and docker compose exec n8n n8n export:credentials --backup --output=/home/node/.n8n/backups/credentials/ write workflows and connections to the data volume. Users, execution history and settings aren't included, so it isn't enough for a full recovery.
  • Server backup: Seturack backs up your server every night and keeps the last 7 days. That covers the n8n data too, but exporting your critical workflows separately is a good idea.

Resources and database

The official installation guides give no CPU or memory figure. As a rule of thumb, light and infrequent workflows run on a small server, while workflows that handle big files or lots of data need memory. Watch the container's real usage with docker stats. The default database is SQLite. For heavy use you switch to PostgreSQL with DB_TYPE=postgresdb, and you still keep the data folder volume.

If the server isn't enough, scale it up in the panel. Your IP address and data stay the same, and your webhook URLs don't change.

Updating

The official guide describes the update in three commands: docker compose pull, docker compose down and docker compose up -d. Take a backup first and read the release notes. Operating system and application updates are yours after setup.

Security

  • Open n8n over HTTPS only. The official guide takes the same approach.
  • Create the owner account right after setup and pick a strong password.
  • Keep only ports 22, 80 and 443 open in the firewall. Because Docker skips ufw rules for the ports it publishes, don't publish n8n's port 5678 to the outside.

If you'd rather skip these steps, choose your server with n8n pre-installed. If you're installing it yourself, start from a server with Docker installed.

Comments0

No Comments Yet

Be the first to share your thoughts.

Join the Discussion

Please sign in or sign up to leave a comment.

Never Miss a Post

Get our latest tutorials, guides and product news in your inbox.

You're subscribed to our newsletter.