⚙️
Hosting

Self-Hosting n8n: Step-by-Step Setup with Docker, Nginx and SSL

18.11.2026
← All articles

n8n is a platform that connects services and automates repetitive work. You can link a website order form to a Telegram message, a spreadsheet or a CRM by wiring blocks together in a visual editor. There is a cloud version, but many teams prefer self-hosting: the data stays under their control and the number of workflow executions is not capped by a plan.

What server n8n needs

n8n is a Node.js service that runs constantly, so shared hosting will not work and you need a VPS with root access. For a small business starting with a handful of workflows, 1-2 vCPUs and around 2 GB of RAM is usually enough. Workflows that process large files, loop over thousands of records or run very often will need more memory and CPU. The latest LTS release of Ubuntu or Debian is a convenient choice because most guides target them.

Example: automating orders for a bookshop

Say a small bookshop in Tashkent has an order form on its website. Right now a manager copies every order from email into a spreadsheet and messages the courier separately. With n8n this becomes one workflow: the form posts data to an n8n webhook, n8n adds the order to the sheet, notifies the manager on Telegram and emails a confirmation to the customer.

Preparing the domain and DNS record

A dedicated subdomain such as n8n.example.uz works best. In the sayt.uz cabinet, open the DNS records of your domain, create an A record named n8n and point it to your VPS IP address. Propagation can take a while, so check it with dig n8n.example.uz +short. You cannot get an SSL certificate until this record resolves, so do it first.

Installing Docker and starting n8n

Running n8n in a Docker container is the simplest and safest approach, since upgrades and migrations come down to a few commands. Install Docker with the official script and verify it works.

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo docker run --rm hello-world

Next, create a volume for data and start the container. The port is bound only to 127.0.0.1, so n8n is reachable only through Nginx, not directly from the internet. The WEBHOOK_URL variable matters: without it n8n shows webhook URLs with the internal port, and external services cannot reach them.

docker volume create n8n_data

docker run -d --name n8n --restart unless-stopped \
  -p 127.0.0.1:5678:5678 \
  -e GENERIC_TIMEZONE="Asia/Tashkent" \
  -e TZ="Asia/Tashkent" \
  -e N8N_HOST=n8n.example.uz \
  -e N8N_PROTOCOL=https \
  -e WEBHOOK_URL=https://n8n.example.uz/ \
  -e N8N_PROXY_HOPS=1 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

Connecting the domain via Nginx and adding SSL

The n8n editor talks to the browser over WebSocket, so the reverse proxy must pass the Upgrade and Connection headers. Otherwise the editor opens, but execution status does not update live. Save this as /etc/nginx/sites-available/n8n and symlink it into sites-enabled.

server {
    listen 80;
    server_name n8n.example.uz;

    location / {
        proxy_pass http://127.0.0.1:5678;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
    }
}

Test the configuration, reload Nginx and get a free Let's Encrypt certificate with Certbot, which adds the 443 block and renews the certificate automatically.

sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d n8n.example.uz

On the first visit to https://n8n.example.uz, n8n asks you to create the owner account. Use a strong password, because this panel gives access to every connected service.

The encryption key and backups

n8n stores workflow credentials such as API keys and passwords in encrypted form. The encryption key is generated on first start and saved in a config file inside the volume. If you move servers and lose that key, all stored credentials become unreadable, so back up the whole volume. The commands below export workflows to JSON and archive the data folder; run them daily via cron and copy the archive off the server.

docker exec -u node n8n n8n export:workflow --all --output=/home/node/.n8n/workflows.json

docker run --rm -v n8n_data:/data -v /root/backup:/backup alpine \
  tar czf /backup/n8n-$(date +%F).tar.gz -C /data .

Upgrades and security habits

n8n releases often, with bug fixes and new integrations. Always take a backup first, then pull the new image and recreate the container; the volume keeps your workflows safe.

docker pull docker.n8n.io/n8nio/n8n
docker stop n8n && docker rm n8n
# then run the same docker run command again with the same parameters

On the server, allow SSH with keys only, keep just ports 22, 80 and 443 open and update system packages regularly. Validate incoming webhook data, for example with a secret header or token, so strangers cannot trigger your workflows. Also review the license: n8n is free to self-host for use inside your own business, but read the official terms before offering it to others as a service.

Related articles

📈 When to upgrade your hosting plan: the real signs ⚙️ How to Change the PHP Version and Settings in ISPmanager 🚦 503 Service Unavailable: what to do when the server is overloaded ⏰ How to Add a Cron Job in ISPmanager: Schedule, Command, Checks
🌐 Language
🇺🇿 O'zbek 🇺🇿 Ўзбек 🇷🇺 Русский 🇬🇧 English ✓