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

n8n Queue Mode Setup: PostgreSQL, Redis, Workers and Task Runners

Run n8n in scalable Queue Mode with PostgreSQL, Redis, separate workers and task runners, including webhooks, encryption, TLS, backup and monitoring.

n8n Queue Mode Setup: PostgreSQL, Redis, Workers and Task Runners
What will be running at the end?

Run n8n in scalable Queue Mode with PostgreSQL, Redis, separate workers and task runners, including webhooks, encryption, TLS, backup and monitoring. Every command is presented as an operational step; replace example hostnames, passwords and secrets before execution.

Architecture and requirements before installation

  • Ubuntu 24.04 LTS with sudo access and a dedicated IPv4 address
  • Docker Engine and Compose v2 where the deployment uses containers
  • A DNS A record pointing the application hostname to the server
  • NVMe capacity sized for application data, logs, temporary files and backups
  • Memory and CPU headroom based on measured concurrency rather than vendor minimums

DNS and port plan

  • 22/TCP: SSH
  • 80/443 TCP: Nginx ve HTTPS
  • 5678/TCP: yalnız localhost veya özel Docker ağı
  • 5432/TCP: PostgreSQL yalnız iç ağ
  • 6379/TCP: Redis yalnız iç ağ

Hands-on installation steps

1. Docker kurulumu
sudo apt update
sudo apt install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo $VERSION_CODENAME) stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
2. Güçlü sırlar
openssl rand -hex 32
openssl rand -base64 48
openssl rand -base64 36
3. Ortam dosyası
.env
N8N_HOST=n8n.example.com
N8N_PROTOCOL=https
WEBHOOK_URL=https://n8n.example.com/
GENERIC_TIMEZONE=Europe/Istanbul
N8N_ENCRYPTION_KEY=BURAYA_64_KARAKTER_RASTGELE_DEGER
POSTGRES_USER=n8n
POSTGRES_PASSWORD=GUCLU_POSTGRES_PAROLASI
POSTGRES_DB=n8n
QUEUE_BULL_REDIS_HOST=redis
EXECUTIONS_MODE=queue
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=336
4. Compose yapısı
services:
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
    volumes:
      - postgres_veri:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 10s
      timeout: 5s
      retries: 10
  redis:
    image: redis:7-alpine
    restart: unless-stopped
    command: redis-server --appendonly yes
    volumes:
      - redis_veri:/data
  n8n:
    image: docker.n8n.io/n8nio/n8n:2
    restart: unless-stopped
    env_file: .env
    environment:
      DB_TYPE: postgresdb
      DB_POSTGRESDB_HOST: postgres
      DB_POSTGRESDB_DATABASE: ${POSTGRES_DB}
      DB_POSTGRESDB_USER: ${POSTGRES_USER}
      DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
      EXECUTIONS_MODE: queue
      QUEUE_BULL_REDIS_HOST: redis
      N8N_RUNNERS_ENABLED: "true"
    ports:
      - 127.0.0.1:5678:5678
    volumes:
      - n8n_veri:/home/node/.n8n
    depends_on:
      postgres:
        condition: service_healthy
  worker:
    image: docker.n8n.io/n8nio/n8n:2
    restart: unless-stopped
    command: worker --concurrency=5
    env_file: .env
    environment:
      DB_TYPE: postgresdb
      DB_POSTGRESDB_HOST: postgres
      DB_POSTGRESDB_DATABASE: ${POSTGRES_DB}
      DB_POSTGRESDB_USER: ${POSTGRES_USER}
      DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
      EXECUTIONS_MODE: queue
      QUEUE_BULL_REDIS_HOST: redis
      N8N_RUNNERS_ENABLED: "true"
    depends_on:
      - redis
      - postgres
volumes:
  postgres_veri:
  redis_veri:
  n8n_veri:
5. Başlatma ve sağlık
sudo docker compose config
sudo docker compose up -d
sudo docker compose ps
sudo docker compose logs --since 10m n8n worker
curl -I http://127.0.0.1:5678/healthz
6. PostgreSQL yedeği
sudo docker compose exec -T postgres pg_dump -U n8n -d n8n -Fc > n8n-$(date +%F).dump
sha256sum n8n-$(date +%F).dump
7. Geri yükleme
sudo docker compose stop n8n worker
sudo docker compose exec -T postgres dropdb -U n8n --if-exists n8n
sudo docker compose exec -T postgres createdb -U n8n n8n
sudo docker compose exec -T postgres pg_restore -U n8n -d n8n --clean --if-exists < n8n-YEDEK.dump
sudo docker compose up -d
8. Nginx reverse proxy
sudo apt update
sudo apt install -y nginx certbot python3-certbot-nginx
sudo tee /etc/nginx/sites-available/n8n.example.com > /dev/null <<'NGINX'
server {
    listen 80;
    listen [::]:80;
    server_name n8n.example.com;
    client_max_body_size 10G;
    proxy_read_timeout 3600;
    proxy_send_timeout 3600;
    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 "upgrade";
    }
}
NGINX
sudo ln -s /etc/nginx/sites-available/n8n.example.com /etc/nginx/sites-enabled/n8n.example.com
sudo nginx -t
sudo systemctl reload nginx
9. Let’s Encrypt SSL ve yenileme testi
sudo certbot --nginx -d n8n.example.com --redirect --agree-tos --no-eff-email -m [email protected]
sudo certbot renew --dry-run
curl -I https://n8n.example.com
openssl s_client -connect n8n.example.com:443 -servername n8n.example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates

What to know before production

Production note
n8n Queue Mode Setup must be isolated behind HTTPS; databases, queues and internal APIs must not be published directly to the internet.
Production note
Pin tested image versions before production. Read release notes and take an application-consistent backup before database migrations.
Production note
A database dump alone may be incomplete. Preserve persistent files, configuration, encryption keys and the exact deployed version together.
Production note
Validate the installation with a real transaction or workload, then reboot the host and confirm automatic recovery before accepting production traffic.

Common failures and root causes

Belirti / SymptomKök neden ve çözüm / Root cause and fix
Service or container does not startInspect compose configuration, dependency health, file permissions and the first fatal log line instead of repeatedly restarting.
Domain opens but HTTPS failsCheck A/AAAA records, ports 80/443, proxy mode, certificate challenge and conflicting reverse proxies.
Application cannot reach its database or queueUse the internal service hostname, verify credentials and health checks, and keep database ports off the public interface.
Works initially but fails under loadMeasure memory peaks, disk latency, connection pools and worker concurrency; increase capacity only after identifying the bottleneck.

Post-installation validation checklist

  • All services are running and their health checks pass
  • The public hostname serves a valid HTTPS certificate
  • Only explicitly required ports are reachable
  • Administrator MFA and recovery access are configured
  • Backup checksums have been recorded
  • A restore was completed in an isolated environment
  • Logs contain no repeating critical failure
  • Services recover automatically after a host reboot

Official technical sources

Related EKA Sunucu guides

Frequently asked questions

Is this suitable for production?

Yes after secrets are replaced, public access is restricted and a complete restore test has succeeded.

Are minimum resources enough?

Minimums only prove the software can start. Size CPU, memory, IOPS and storage from representative workload measurements.

Can I use Cloudflare?

Yes. Use Full (strict) TLS and configure origin certificates, WebSockets and client IP forwarding where required.

Should upgrades be automatic?

Do not automatically apply major releases. Review migrations, back up data and retain the previous tested image.

What must be backed up?

Back up databases, uploaded files, persistent volumes, configuration, encryption keys and the deployed version together.

VPS or GPU server?

An NVMe VPS fits normal web workloads. Inference, accelerated OCR and video transcoding may require a compatible GPU.

Contact us for deployment

Run n8n in scalable Queue Mode with PostgreSQL, Redis, separate workers and task runners, including webhooks, encryption, TLS, backup and monitoring.

Explore VPS plansContact us for deployment
Top