Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
Ubuntu 24.04 n8n Setup: Docker, Nginx, SSL and Domain Self-Hosting Guide
n8n, Docker, Nginx and Ubuntu 24.04

How to Install n8n on Ubuntu 24.04 with Docker, Nginx, SSL and a Custom Domain

In this real Ubuntu 24.04.4 LTS VPS deployment we installed n8n with Docker, prepared the n8n_data volume and a fixed encryption key, bound the app only to 127.0.0.1:5678, published n8n.ekasunucu.com through Nginx and Let’s Encrypt, and verified the complete first-run flow from owner account to workflow editor with real WebP screenshots.

Ubuntu 24.04n8nSelf Hosted n8nDockerNginxLet’s EncryptSSLWorkflow AutomationLinux VPSn8n Community EditionReverse ProxyWebSocketEKA Sunucu
n8n / Ollama / Qwen3 AI Agent / Ubuntu 24.04
Ubuntu 24.04.4 LTS
  ↓ Docker
n8n :5678 → 127.0.0.1
  ↓
n8n_data + Encryption Key
  ↓
Nginx + WebSocket
  ↓
Let’s Encrypt HTTPS
  ↓
n8n.ekasunucu.com
n8n2.33.7 testModelqwen3:4b
24real WebP screenshots
3TR · EN · DE content
443public HTTPS
127.0.0.1localhost-only app port
01n8n with Docker
02Nginx + SSL + domain
03localhost-only 5678
04Owner + Community Edition
00
Table of contents

Ubuntu 24.04 n8n installation steps

  1. 01What are we building with self-hosted n8n on Ubuntu 24.04?
  2. 02Verify Ubuntu, Docker, server resources and the n8n DNS record
  3. 03Prepare n8n_data, the encryption key and reverse-proxy environment variables
  4. 04Pull the official n8n image and bind port 5678 only to localhost
  5. 05Check the health endpoint, n8n version and first-start logs
  6. 06Publish n8n.ekasunucu.com through Nginx and Let’s Encrypt
  7. 07Verify that port 5678 is private and SSL renewal works
  8. 08Create the n8n owner account and complete onboarding
  9. 09Create an empty workflow and verify the editor opens correctly
  10. 10Optionally activate Registered Community Edition
  11. 11Verify the Workflows page and workflow editor
  12. 12Make backups, upgrades, logs and security audits routine
01
Deployment architecture

What are we building with self-hosted n8n on Ubuntu 24.04?

This guide documents a real n8n deployment on Ubuntu 24.04.4 LTS using Docker, a localhost-only application port and n8n.ekasunucu.com published through Nginx and Let’s Encrypt.

In the final architecture users never connect directly to port 5678. HTTPS traffic reaches Nginx on 443, which proxies to the n8n container on 127.0.0.1:5678. Persistent application data is stored in the n8n_data named volume.

Command 1
Internet :443
  ↓
Nginx + Let’s Encrypt
  ↓
127.0.0.1:5678
  ↓
n8n Docker container
  ↓
n8n_data volume
02
Pre-flight checks

Verify Ubuntu, Docker, server resources and the n8n DNS record

The tested server ran Ubuntu 24.04.4 LTS with Docker Engine already active. Checking OS, kernel, RAM, disk and Docker before installation makes later troubleshooting much easier.

We resolved n8n.ekasunucu.com through both Cloudflare and Google DNS before requesting a certificate. DNS must point to the intended server before the Let’s Encrypt step.

Command 1
cat /etc/os-release | grep -E 'PRETTY_NAME|VERSION_ID|VERSION_CODENAME'
uname -r
free -h
df -h /
Command 2
docker --version
docker compose version
systemctl is-active docker
Command 3
dig +short A n8n.ekasunucu.com @1.1.1.1
dig +short A n8n.ekasunucu.com @8.8.8.8
03
Persistence and environment

Prepare n8n_data, the encryption key and reverse-proxy environment variables

We used the n8n_data named volume instead of relying on the container filesystem, so user, workflow and credential data can survive container recreation.

Generate a fixed N8N_ENCRYPTION_KEY and back it up securely. Explicit host, protocol, editor URL, webhook URL, proxy-hop and timezone settings make reverse-proxy deployments more predictable.

Command 1
docker volume inspect n8n_data >/dev/null 2>&1 || docker volume create n8n_data
Command 2
openssl rand -hex 32
Command 3
cat > /root/n8n.env <<'EOF'
N8N_ENCRYPTION_KEY=BURAYA_UZUN_RASTGELE_ANAHTAR
N8N_HOST=n8n.ekasunucu.com
N8N_PORT=5678
N8N_PROTOCOL=https
N8N_EDITOR_BASE_URL=https://n8n.ekasunucu.com
N8N_WEBHOOK_URL=https://n8n.ekasunucu.com/
N8N_PROXY_HOPS=1
N8N_SECURE_COOKIE=true
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
GENERIC_TIMEZONE=Europe/Istanbul
TZ=Europe/Istanbul
NODE_ENV=production
EOF
chmod 600 /root/n8n.env
04
Docker deployment

Pull the official n8n image and bind port 5678 only to localhost

We pulled the official n8n image from docker.n8n.io and started the container with a restart policy. Host port 5678 is bound to 127.0.0.1 instead of 0.0.0.0.

The n8n_data volume is mounted at /home/node/.n8n. Public access is therefore provided by Nginx instead of Docker directly publishing the editor port.

Command 1
docker pull docker.n8n.io/n8nio/n8n:latest
Command 2
docker rm -f n8n 2>/dev/null || true
docker run -d \
  --name n8n \
  --restart=always \
  --env-file /root/n8n.env \
  -p 127.0.0.1:5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n:latest
05
Health, version and migrations

Check the health endpoint, n8n version and first-start logs

After startup the /healthz endpoint returned HTTP 200 with {"status":"ok"}. The version used in this real test was n8n 2.33.7.

First-start database migrations are expected. Our logs also showed that an internal Python task runner could not start because Python 3 was missing, while n8n recommended external task-runner mode for production. The JS Task Runner registered successfully and the normal editor remained operational.

The same startup log contained deprecation notices for future default changes, so reviewing docker logs after upgrades is important.

Command 1
curl -sS -i http://127.0.0.1:5678/healthz
Command 2
docker exec n8n n8n --version
Command 3
docker logs --tail 160 n8n
06
Domain and HTTPS

Publish n8n.ekasunucu.com through Nginx and Let’s Encrypt

Because n8n listens only on 127.0.0.1:5678, we used Nginx as the public reverse proxy. Host, X-Forwarded and WebSocket upgrade headers are forwarded to n8n.

After nginx -t succeeded, Certbot obtained and deployed the certificate for n8n.ekasunucu.com. Final origin and public HTTPS checks returned HTTP 200.

Command 1
cat > /etc/nginx/conf.d/eka-websocket-map.conf <<'EOF'
map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}
EOF
Command 2
cat > /etc/nginx/sites-available/n8n.ekasunucu.com <<'EOF'
server {
    listen 80;
    listen [::]:80;
    server_name n8n.ekasunucu.com;
    client_max_body_size 100m;

    location / {
        proxy_pass http://127.0.0.1:5678;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_buffering off;
        proxy_read_timeout 3600;
        proxy_send_timeout 3600;
    }
}
EOF
ln -sfn /etc/nginx/sites-available/n8n.ekasunucu.com /etc/nginx/sites-enabled/n8n.ekasunucu.com
nginx -t && systemctl reload nginx
Command 3
certbot --nginx -d n8n.ekasunucu.com
Command 4
curl -I https://n8n.ekasunucu.com
07
Security verification

Verify that port 5678 is private and SSL renewal works

In the final setup n8n listens on 127.0.0.1:5678 while only Nginx exposes ports 80 and 443 externally. The editor is not published through a public Docker port.

We used certbot renew --dry-run to verify renewal without replacing the live certificate, and systemctl --failed showed no failed systemd services.

Command 1
ss -lntp | grep -E ':5678|:80|:443'
Command 2
docker ps --filter name='^/n8n$'
Command 3
certbot renew --dry-run
Command 4
systemctl --failed
08
First login

Create the n8n owner account and complete onboarding

Opening the HTTPS domain displayed the owner-account setup screen. Use a strong unique password in production.

n8n may then show onboarding and customization questions. Completing them takes you to the main instance interface.

09
First automation

Create an empty workflow and verify the editor opens correctly

After setup, n8n opens the workflow creation screen. An empty workflow loading successfully is a practical check that the session, frontend and backend API are functioning.

From here you can add triggers, HTTP Request, database, mail, Telegram or AI nodes. This guide focuses first on a stable self-hosted n8n foundation.

10
Community Edition

Optionally activate Registered Community Edition

With the self-hosted Community Edition already working, the UI offered an optional free Registered Community Edition activation. In our real test the key arrived by email and activation completed successfully in the panel.

Available registered features can change over time. Core Docker, Nginx and SSL operation does not depend on this optional step.

11
Running instance

Verify the Workflows page and workflow editor

After activation, both the Workflows home page and workflow editor opened normally. At this point the instance is available over domain HTTPS, its data is persistent and port 5678 remains restricted to localhost.

You can now build webhook automations, API integrations, email flows or connect local AI services such as Ollama.

12
Production maintenance

Make backups, upgrades, logs and security audits routine

Before updating n8n, back up the n8n_data volume or create a VPS snapshot. Recreate the container with the same environment file and persistent volume.

After updates, re-test /healthz, docker logs, HTTPS and webhook behavior. n8n also provides a security audit command for common instance risks.

Command 1
docker exec n8n n8n audit
Command 2
docker logs --tail 200 n8n
Command 3
curl -sS http://127.0.0.1:5678/healthz
Command 4
certbot renew --dry-run
Production checklist

Self-hosted n8n production security checklist

Do not publish port 5678 directly to the public Internet.
Serve n8n through HTTPS behind Nginx or another reverse proxy.
Keep N8N_ENCRYPTION_KEY secure and backed up.
Back up the n8n_data volume regularly.
Use a strong unique owner password and enable 2FA where appropriate.
Review community nodes and credential permissions using least privilege.
Create a snapshot or rollback plan before Docker image upgrades.
Check docker logs, /healthz and SSL renewal regularly.
Run n8n audit periodically.
Review external endpoints and sensitive data flows in webhook and HTTP workflows.
R
Official sources

Official n8n self-hosting and security resources

+
EKA Sunucu

Related EKA Sunucu n8n, Docker and AI guides

?
FAQ

Frequently asked questions about installing n8n on Ubuntu 24.04

Does n8n run on Ubuntu 24.04 with Docker?

Yes. In this real test n8n 2.33.7 ran on Ubuntu 24.04.4 LTS using the official Docker image.

Which port does n8n use?

The default application port is 5678. This guide binds it only to 127.0.0.1:5678 on the host.

Do I need to expose port 5678 publicly?

No. n8n remains on localhost and public access is provided through Nginx over HTTPS.

What is the n8n_data volume for?

It keeps n8n application data persistent when the container is recreated.

Why is N8N_ENCRYPTION_KEY important?

n8n uses it for credential encryption. Losing or changing it can break access to existing credentials.

How should webhook URL be configured behind a reverse proxy?

This example uses N8N_WEBHOOK_URL=https://n8n.ekasunucu.com/. Our real startup log marked the older WEBHOOK_URL name as deprecated.

Does n8n need WebSocket headers behind Nginx?

Forwarding Upgrade and Connection headers is important for long-lived and real-time UI connections.

How was SSL installed?

After the Nginx vhost was ready, Certbot --nginx obtained and deployed a Let’s Encrypt certificate.

How do I test certificate renewal?

Use certbot renew --dry-run to simulate renewal without replacing the live certificate.

Can I use n8n Community Edition?

Yes. Self-hosted Community Edition works. We also completed the optional free Registered Community Edition activation in this test.

What does the Python task runner warning mean?

Our log showed the internal Python runner could not start because Python 3 was missing and n8n recommended external mode for production. The normal editor and JS workflows continued working.

Are first-start database migrations normal?

Yes. A new or upgraded n8n instance can run database migrations during startup.

What should I do before updating n8n?

Back up n8n_data or take a VPS snapshot, and preserve your environment file and encryption key.

How can I audit n8n security?

Use n8n audit to check common credential, database, filesystem, node and instance risks.

EKA YAZILIM VE BİLİŞİM SİSTEMLERİ

Need a Linux VPS for self-hosted n8n?

Run webhook, API, AI and business workflow automation on your own EKA Sunucu Linux VPS.

Updated: 10.08.2026
View Linux VPS PlansLinux & VPS Guides
Top