How to Self-Host n8n on a VPS with Docker (Step by Step)

A step-by-step guide to self-hosting n8n on a VPS with Docker Compose, Traefik SSL and Postgres, plus the firewall, update and backup steps most tutorials skip.

Summarize this post with AI

A 36-minute read, or the key points in about 30 seconds, in the assistant you already use.

Opens in a new tab with the prompt filled in. Nothing passes through this site.

Self-hosting n8n on a VPS with Docker usually breaks in one of four places: the firewall, the webhook URL, the encryption key or the backups. None of them fail on day one. They fail the day a webhook won't fire, or the day you restore a backup and every saved credential is unreadable.

n8n's own docs call self-hosting a job for "expert users". Fair. But most of the expertise is knowing those four traps.

Here's one most tutorials skip. Docker's published ports bypass ufw, the firewall Ubuntu ships with. So "I turned on the firewall" can mean nothing at all.

This guide follows n8n's official Docker Compose setup, adds the Postgres database and task runner that n8n's own examples use for production, and closes all four gaps.

I haven't run it on a live server for this post. Every setting comes from n8n's and Docker's documentation. Still choosing where to host? Start with my comparison of n8n hosting providers.

Some links here are affiliate links. They don't change your price or what I recommend.

Editorial cover showing a server box labelled VPS carrying an n8n workflow container with a padlock, next to the heading Self-Host n8n
One VPS, a few containers and a lock on every door: that is the whole self-hosted n8n setup.

What do you need to self-host n8n?

You need five things before you type a single command:

  • A VPS running a supported Ubuntu release. Docker's install guide lists Ubuntu 22.04 LTS, 24.04 LTS, 26.04 LTS and 26.10 as of 18 October 2026.
  • A domain where you can add a DNS record. n8n will live on a subdomain such as n8n.yourdomain.com.
  • SSH access to the server and basic comfort in a terminal.
  • A password manager, because this setup creates a handful of secrets you can't afford to lose.
  • Somewhere off the server to keep backups.

That last one matters more than the VPS. You can rebuild a server. You can't rebuild an encryption key you never saved.

Skip self-hosting if you've never used SSH. n8n itself says that if you aren't experienced at managing servers, you should use n8n Cloud instead. I compare what each route costs in my n8n pricing breakdown of cloud vs self-hosted.

Not sure what you're renting? My guide to what a VPS is explains root access and managed vs unmanaged plans.

How much VPS does n8n need?

n8n doesn't publish a single RAM minimum for n8n alone. Its Hetzner guide says the provider's smallest CPX11 type "is enough" for most usage levels. It asks for at least 4 GB of RAM and 2 vCPUs once you add the sandbox that powers n8n Assistant.

Usage decides the rest. n8n's memory docs name the big consumers: large JSON payloads, binary files, the Code node, manual test runs and several workflows running at once. When n8n runs out, you see errors like "Connection Lost" or "JavaScript heap out of memory".

I recommend Hostinger's KVM VPS for self-hosting tools like n8n. Here's how its four plans map to n8n workloads, with prices from Hostinger's VPS page on 18 October 2026:

PlanvCPU / RAM / NVMeIntro priceRenews atGood fit for
KVM 11 / 4 GB / 50 GB$6.49/mo$11.99/moSolo use, light scheduled workflows
KVM 22 / 8 GB / 100 GB$8.99/mo$14.99/moThis guide's full stack, plus room for n8n Assistant
KVM 44 / 16 GB / 200 GB$12.99/mo$28.99/moMany busy workflows, big files, several users
KVM 88 / 32 GB / 400 GB$25.99/mo$49.99/moHeavy AI and data workloads

The intro prices apply to a two-year term paid upfront, and the renewal price is what you pay after that. Every plan includes free weekly backups and a managed network firewall, and both come up again in this guide.

My take: KVM 2. It clears n8n's 4 GB and 2 vCPU line for the Assistant sandbox, and Hostinger's own FAQ calls KVM 2 enough for medium-scale apps like n8n. KVM 1 has a single vCPU, so it falls short of that line. My Hostinger review covers the company's support and renewal pricing in more detail.

How does a self-hosted n8n setup fit together?

Four pieces sit between a visitor and your workflows, and only one of them faces the internet.

Flow diagram of a self-hosted n8n setup: Domain, then a Reverse Proxy with an SSL padlock, then the n8n container, then a Data Volume
Only the reverse proxy is public. n8n, its database and its data volume stay on the private Docker network.
  • Domain: an A record points n8n.yourdomain.com at your server's IP address.
  • Reverse proxy: Traefik listens on ports 80 and 443, gets a free Let's Encrypt certificate and renews it. n8n's SSL docs call a reverse proxy the recommended way to add HTTPS.
  • The n8n container: the editor and workflow engine, plus a task runner container that executes Code node scripts, and a Postgres container that stores workflows and execution history.
  • Data volumes: Docker volumes that survive restarts and updates. The n8n_data volume holds the encryption key, and db_storage holds the database.

n8n listens on port 5678, but in this setup that port is bound to 127.0.0.1. Only Traefik can reach it. Postgres and the task runner publish no ports at all.

That design is the answer to the ufw problem, and I'll come back to it in Step 1.

SQLite or Postgres: which database should you use?

Out of the box, self-hosted n8n stores everything in a SQLite file inside the n8n_data volume. That's fine to start, but n8n's docs are direct about production.

QuestionSQLitePostgres
Is it the default?Yes, a file at ~/.n8n/database.sqliteNo, you set DB_TYPE=postgresdb
Extra containerNoneOne postgres:18 container
n8n's guidanceFine for trying things outProduction with more than a handful of users or round-the-clock workflows
Backup methodStop n8n, then copy the .n8n folderpg_dump, plus the .n8n folder for the key
Switching laterExisting data doesn't move over automaticallyNot needed

n8n supports Postgres 17 and 18, plus 16 for compatibility, according to its database page.

If this is the instance you'll rely on, start on Postgres. Moving from SQLite later means exporting and re-importing workflows and credentials, and users and execution history don't come along.

How to self-host n8n on a VPS with Docker, step by step

The whole job breaks into five stages, and each one below is a step.

Five numbered step cards for self-hosting n8n: 1 VPS, 2 Docker, 3 Compose, 4 SSL and 5 Backups, joined by arrows
Five stages, in order. Skipping the last one is the most expensive mistake on the list.

Step 1: Prepare the VPS with a DNS record and a firewall

First, point your subdomain at the server. In your DNS provider, add one record:

Record typeNameValue
An8nyour server's public IPv4 address

Do this first. Traefik can only get a certificate after the name resolves to your server, and DNS changes can take a while to spread.

Next, the firewall. On Ubuntu, allow SSH, HTTP and HTTPS in ufw, then switch it on:

bash
sudo ufw allow OpenSSH
sudo ufw allow 80
sudo ufw allow 443
sudo ufw enable

Now the catch. Docker's documentation warns that when you publish a container port, "these ports bypass your firewall rules". Docker routes that traffic before ufw ever sees it.

So ufw alone won't protect a port that Docker publishes. This guide handles that in two ways. n8n's port is bound to 127.0.0.1, and Postgres isn't published at all.

For a second layer, use the network firewall in your VPS panel. Hostinger's managed VPS firewall filters packets before they reach the server, so Docker can't route around it.

Step 2: Install Docker Engine and Docker Compose

n8n's server guide points to Docker's own install docs. Use Docker's apt repository method: Docker says its convenience script isn't recommended for production. If you want each command explained, plus the post-install settings that matter on a VPS, my step-by-step guide to installing Docker on Ubuntu covers them.

Remove any distro-packaged Docker first, then add Docker's repository. These commands come from Docker's Ubuntu guide:

bash
sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc docker-buildx podman-docker containerd runc | cut -f1)

sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF

sudo apt update

Then install Docker Engine with the Compose plugin and check both:

bash
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
docker --version
docker compose version

You can add your user to the docker group to skip sudo. Know what that means first: Docker's docs say the docker group "grants root-level privileges to the user".

Prefer clicks to commands? Hostinger offers ready-made n8n and Docker with Traefik templates when you set up a VPS. The manual route here shows you every setting, which is what you need on the day something breaks.

Step 3: Write the .env and docker-compose.yml files

Create a project folder, a folder for files n8n can read and write, and the small Postgres init script from n8n's withPostgres example. The script creates a separate, non-superuser account for n8n.

bash
mkdir n8n-compose
cd n8n-compose
mkdir local-files
curl -fsSL https://raw.githubusercontent.com/n8n-io/n8n-hosting/main/docker-compose/withPostgres/init-data.sh -o init-data.sh

Generate four long random secrets, one for each password or token below:

bash
openssl rand -hex 32

Now create the .env file. Docker Compose reads it automatically from the project folder.

bash
# Where n8n will live: https://n8n.example.com
DOMAIN_NAME=example.com
SUBDOMAIN=n8n

# Timezone for Schedule Trigger nodes and the container clock
GENERIC_TIMEZONE=Asia/Kolkata

# Email Let's Encrypt uses for certificate notices
SSL_EMAIL=you@example.com

# Pin the n8n version (latest stable on 18 Oct 2026)
N8N_VERSION=2.43.7

# Encrypts every saved credential. Generate once, never change, back it up
N8N_ENCRYPTION_KEY=paste-output-of-openssl-rand-hex-32

# Postgres superuser (setup only) and the user n8n connects as
POSTGRES_USER=postgres_admin
POSTGRES_PASSWORD=change-me-long-random
POSTGRES_DB=n8n
POSTGRES_NON_ROOT_USER=n8n_app
POSTGRES_NON_ROOT_PASSWORD=change-me-another-long-random

# Shared secret between n8n and its task runner
RUNNERS_AUTH_TOKEN=change-me-third-long-random

Lock the file down with chmod 600 .env, and save a copy of every value in your password manager.

Next, the Compose file. It combines n8n's official Docker Compose server setup for Traefik and SSL with the Postgres and task runner services from n8n's withPostgres example. Save it as docker-compose.yml:

yaml
services:
  traefik:
    image: "traefik"
    restart: always
    command:
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - traefik_data:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

  postgres:
    image: postgres:18
    restart: always
    environment:
      - POSTGRES_USER
      - POSTGRES_PASSWORD
      - POSTGRES_DB
      - POSTGRES_NON_ROOT_USER
      - POSTGRES_NON_ROOT_PASSWORD
      - PGDATA=/var/lib/postgresql/data
    volumes:
      - db_storage:/var/lib/postgresql/data
      - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 5s
      timeout: 5s
      retries: 10

  n8n:
    image: docker.n8n.io/n8nio/n8n:${N8N_VERSION}
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=web,websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - traefik.http.routers.n8n.middlewares=n8n@docker
    environment:
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - N8N_WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - N8N_PROXY_HOPS=1
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - TZ=${GENERIC_TIMEZONE}
      - N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
      - N8N_RESTRICT_FILE_ACCESS_TO=/files
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
      - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
      - N8N_RUNNERS_MODE=external
      - N8N_RUNNERS_AUTH_TOKEN=${RUNNERS_AUTH_TOKEN}
      - N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
    volumes:
      - n8n_data:/home/node/.n8n
      - ./local-files:/files
    depends_on:
      postgres:
        condition: service_healthy

  n8n-runner:
    image: n8nio/runners:${N8N_VERSION}
    restart: always
    environment:
      - N8N_RUNNERS_AUTH_TOKEN=${RUNNERS_AUTH_TOKEN}
      - N8N_RUNNERS_TASK_BROKER_URI=http://n8n:5679
    depends_on:
      - n8n

volumes:
  n8n_data:
  traefik_data:
  db_storage:

The file passes Docker Compose's config check. Here's what I changed from n8n's server example, and why:

  • Postgres with a non-root user, taken from withPostgres. The PGDATA line stays: n8n warns that without it, Postgres 18 writes outside the volume and your database starts empty.
  • An external task runner. n8n's task runner docs say internal mode is "insecure by design" and tell you to use external mode in production. Without it, anyone who can edit a workflow could potentially read your credentials and encryption key.
  • N8N_PROXY_HOPS=1, which n8n's reverse proxy docs ask for whenever n8n sits behind a proxy.
  • N8N_ENCRYPTION_KEY set from day one, so the key lives in your password manager as well as in the volume.
  • A pinned N8N_VERSION, so an update happens when you decide, not when the image changes. The runner image uses the same variable, because n8n requires the two versions to match.
  • No Traefik dashboard. n8n's example turns on Traefik's insecure API flag, and this setup doesn't need it.

Three settings deserve a closer look. N8N_WEBHOOK_URL is the public base URL n8n gives to services that call your webhooks. It replaces the older WEBHOOK_URL, which n8n deprecated in version 2.35.0, though many tutorials still use it.

GENERIC_TIMEZONE controls when Schedule Trigger nodes fire, and it defaults to America/New_York. N8N_RUNNERS_ENABLED isn't in the file on purpose: n8n says you no longer need it from version 2.0.

Step 4: Start n8n and let Traefik fetch the SSL certificate

From the n8n-compose folder, start the stack and check that all four containers are running:

bash
sudo docker compose up -d
sudo docker compose ps
sudo docker compose logs -f n8n
curl -sf http://localhost:5678/healthz

The health check is from n8n's Compose guide. It only works on the server itself, which proves the 127.0.0.1 binding is doing its job.

Now open https://n8n.yourdomain.com. If the certificate isn't ready yet, give Traefik a moment and reload. Create the owner account with a long password, then turn on two-factor authentication under Settings, then Personal.

No padlock, or a certificate warning? Check three things in order: the A record resolves to the right IP, port 443 is open in both firewalls, and sudo docker compose logs traefik shows no errors.

Prefer Caddy to Traefik? n8n's Hetzner guide uses Caddy instead, with a caddy service in place of the traefik one (n8n keeps the files in its n8n-docker-caddy repository). The whole proxy configuration is one Caddyfile, and Caddy also handles the certificate:

text
n8n.yourdomain.com {
    reverse_proxy n8n:5678 {
      flush_interval -1
    }
}

Use one proxy or the other, never both. They both want ports 80 and 443.

Step 5: Back up n8n data off-site

A complete n8n backup, per n8n's backup and restore docs, has two parts. The first is the .n8n folder, which holds the config file with the encryption key. The second is your Postgres database.

Backup flow for self-hosted n8n: the n8n Data volume is archived into a Backup file and copied to Off-site cloud storage, with a circular arrow for repeating it
A backup that lives only on the same VPS disappears with the VPS. Copy it somewhere else every night.

The n8n CLI exports are useful, but they aren't a full backup. n8n says they leave out users and roles, execution history, variables and instance settings, including the encryption key.

This script covers all three layers. Save it as backup.sh in the n8n-compose folder:

bash
#!/bin/sh
# Nightly n8n backup: JSON exports, Postgres dump, n8n_data volume
set -e
cd "$(dirname "$0")"
set -a && . ./.env && set +a
DEST="backups/$(date +%F)"
mkdir -p "$DEST"

# 1. Workflows and credentials as JSON (credentials stay encrypted)
docker compose exec -T -u node n8n n8n export:workflow --backup --output=/home/node/.n8n/backups/workflows/
docker compose exec -T -u node n8n n8n export:credentials --backup --output=/home/node/.n8n/backups/credentials/

# 2. The Postgres database
docker compose exec -T postgres pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" > "$DEST/n8n-db.sql"

# 3. The n8n_data volume: encryption key, config and the JSON exports
docker run --rm -v n8n-compose_n8n_data:/data:ro -v "$PWD/$DEST":/backup alpine tar czf /backup/n8n_data.tar.gz -C /data .

# 4. Keep 14 days of local copies
find backups -mindepth 1 -maxdepth 1 -type d -mtime +14 -exec rm -rf {} +

The JSON exports go inside the n8n_data volume on purpose. n8n warns that a backups folder elsewhere in the container isn't persisted, and the volume archive in part 3 picks them up anyway.

The volume name comes from the project folder, so n8n-compose gives n8n-compose_n8n_data. Run sudo docker volume ls to confirm yours.

Make the script executable and schedule it with cron. Replace the path with your own:

bash
chmod +x backup.sh
sudo crontab -e
# add this line to run it at 02:30 every night
30 2 * * * /home/youruser/n8n-compose/backup.sh >> /var/log/n8n-backup.log 2>&1

Then get the files off the server. rclone can copy the backups folder to any S3-compatible bucket, and rsync can copy it to another machine you control. Hostinger's free weekly VPS backups are a good second layer, but weekly is too slow to be your only copy.

Store the .env file separately and encrypted. With it and last night's backup, a restore follows n8n's order:

  • Stop n8n with sudo docker compose down. Never add -v, because that deletes the volumes, including the one with your encryption key.
  • Restore the n8n_data volume from n8n_data.tar.gz.
  • Start only Postgres with sudo docker compose up -d postgres, then load the dump with psql.
  • Put your .env back, including the same N8N_ENCRYPTION_KEY.
  • Start everything with sudo docker compose up -d.

Test this once on a spare VPS before you need it. An untested backup is a hope, not a backup.

How do you update self-hosted n8n safely?

n8n ships a new minor version most weeks. Its docs ask you to update at least once a month, so you never have to jump several versions at once.

Use the stable release in production. The beta channel gets the newest features first, and n8n warns it may be unstable.

Before each update, run backup.sh and read the n8n release notes for breaking changes. Then change N8N_VERSION in .env and run the update sequence from n8n's Docker docs:

bash
cd ~/n8n-compose
sudo docker compose pull
sudo docker compose down
sudo docker compose up -d

Because the runner image reads the same N8N_VERSION, n8n and its task runner move together.

Leave the postgres:18 tag alone during routine updates. A new Postgres major version can't open data written by an older one, and n8n's withPostgres notes walk through the dump and restore that a major upgrade needs.

Which security settings matter most?

Security on a self-hosted instance comes down to a handful of settings. This is the short list I'd check on any new instance:

  • Keep the encryption key in two places, the n8n_data volume and your password manager. Lose it and every saved credential is unreadable.
  • Publish only ports 80 and 443. Keep 5678 bound to 127.0.0.1, never publish Postgres, and back ufw with your provider's network firewall.
  • Run the external task runner, as in this guide. n8n says task runners are the only isolation layer between Code node scripts and your instance.
  • Turn on 2FA for the owner account, and give other people their own accounts instead of sharing yours.
  • Keep N8N_RESTRICT_FILE_ACCESS_TO=/files, so file nodes can only touch the local-files folder.
  • Treat the docker group as root, and use SSH keys rather than passwords for server logins.
  • Run n8n's built-in security audit after setup and every so often after that. It reports risks in five areas: credentials, database, file system, nodes and instance settings.
bash
sudo docker compose exec -u node n8n n8n audit

What usually goes wrong, and how do you fix it?

These are the five problems this setup is most likely to hit, with the fix for each:

  • Webhook URLs show localhost:5678. N8N_WEBHOOK_URL is missing or wrong. Set it to your https URL with a trailing slash, keep N8N_PROXY_HOPS=1, then run sudo docker compose up -d. If webhooks are new to you, my guide to how webhooks work explains test vs production URLs.
  • No certificate, or a browser warning. DNS isn't pointing at the server yet, or port 443 is blocked in one of your two firewalls.
  • Schedules fire at the wrong hour. GENERIC_TIMEZONE is unset, so n8n uses America/New_York.
  • "Connection Lost" or a 503 in the middle of a run. The workflow ran out of memory. n8n's fix is to process data in smaller batches, for example 200 rows at a time instead of 10,000, or to move to a bigger plan.
  • Credentials won't decrypt after a restore. The encryption key in .env doesn't match the one the data was saved with.

Is self-hosting n8n worth it?

For most people who can handle a server, yes. n8n says you can run the free Community edition indefinitely, so your bill is the VPS plus your time.

The Community edition does leave out some team features, such as SSO, sharing workflows and credentials, and Git-based version control. Those need a paid Business or Enterprise license, as n8n's editions page explains.

The real cost is attention. You own the updates, the backups and the 2 a.m. "why is the webhook down" moments.

If you'd rather not, n8n Cloud removes all of that for a monthly fee. If you do go self-hosted, my list of n8n workflow examples is a good place to find your first automations. Want an AI assistant on the same server? Here's how to build an AI agent in n8n, step by step.

Frequently asked questions

How much RAM does self-hosted n8n need?▾
n8n doesn't publish one minimum for n8n alone. Its Hetzner guide says the smallest CPX11 server is enough for most usage, and n8n asks for at least 4 GB of RAM and 2 vCPUs if you add the n8n Assistant sandbox. Big files, Code nodes and many parallel workflows push memory up, so leave headroom.
Can I self-host n8n without a domain name?▾
Not with this setup. Traefik requests a Let's Encrypt certificate for the hostname in your .env, and n8n's server guide only serves n8n over HTTPS. A cheap domain or a subdomain of one you already own is enough.
Should I use n8n's one-line installer instead?▾
The one-line setup (curl -fsSL https://get.n8n.io | sh) is the fastest way to get n8n running, but it targets a fresh install at localhost with SQLite. It doesn't configure a domain or SSL. For a public server, n8n points you to Docker Compose and Postgres, which is the setup in this guide.
How do I move from SQLite to Postgres?▾
n8n doesn't migrate SQLite data to Postgres automatically. Export workflows and credentials with n8n export:workflow --backup and n8n export:credentials --backup, start a fresh Postgres instance with the same encryption key, complete the owner setup, then import them. Users and execution history don't come across, so you'll set up the owner account again.
Does docker compose down delete my n8n workflows?▾
No. Plain docker compose down removes the containers but keeps the volumes, so your data survives. Adding -v deletes the volumes too, including the n8n_data volume with your encryption key, so never use it on a live instance.
How often should I update self-hosted n8n?▾
At least once a month, per n8n's docs, and always on the stable release in production. Take a full backup and read the release notes first, because a small, regular update is far safer than jumping several versions at once.

Running n8n for yourself or a small team? Start on a 2 vCPU, 8 GB server with Postgres and the external runner from day one, because changing databases later is the painful part. Then set up backup.sh before you build your first workflow.

Share