Your Workflows, Your Server — Here's How

n8n selbst hosten — so geht's

🇬🇧 English

Why Self-Host n8n on a VPS?

n8n is one of the most powerful open-source workflow automation tools available today. While the cloud version is convenient, self-hosting n8n on a VPS gives you unlimited workflows, full data privacy, and no monthly per-execution fees. You own the server. You own the data. You own the process.

In this guide, you will set up a fully functional n8n instance on a VPS using Docker and Docker Compose, secure it with an SSL certificate, and have it running as a persistent background service — all within about 30 minutes.

What You Need Before You Start

  • A VPS with at least 1 GB RAM and 1 vCPU (2 GB recommended) — providers like hostinger or netcup are solid choices
  • A domain name pointed to your VPS IP address
  • Ubuntu 22.04 LTS (recommended OS)
  • Basic SSH access and terminal knowledge

Step 1 — Set Up Your VPS

Log into your VPS via SSH. If you're using hostinger or netcup, you can access the root credentials directly from the control panel.

Start by updating the system packages:

apt update && apt upgrade -y

Then create a new non-root user for added security:

adduser n8nuser
usermod -aG sudo n8nuser

Switch to that user for all remaining steps:

su - n8nuser

Step 2 — Install Docker and Docker Compose

Docker is the cleanest way to run n8n on a VPS. It isolates the application, makes updates simple, and avoids dependency conflicts.

sudo apt install docker.io docker-compose -y
sudo systemctl enable docker
sudo systemctl start docker

Verify Docker is running correctly:

docker --version

Step 3 — Create the Docker Compose File

Create a new directory for your n8n setup:

mkdir ~/n8n && cd ~/n8n

Now create a docker-compose.yml file:

nano docker-compose.yml

Paste the following configuration:

version: '3.8'
services:
  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - '5678:5678'
    environment:
      - N8N_HOST=yourdomain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://yourdomain.com/
      - GENERIC_TIMEZONE=Europe/Berlin
    volumes:
      - ~/.n8n:/home/node/.n8n

Replace yourdomain.com with your actual domain. Save and exit with CTRL+X → Y → Enter.

Step 4 — Set Up a Reverse Proxy with Nginx and SSL

To make n8n accessible via HTTPS, you need a reverse proxy. Install Nginx and Certbot:

sudo apt install nginx certbot python3-certbot-nginx -y

Create a new Nginx site configuration:

sudo nano /etc/nginx/sites-available/n8n

Add the following:

server {
    server_name yourdomain.com;

    location / {
        proxy_pass http://localhost:5678;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Enable the config and obtain your SSL certificate:

sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo certbot --nginx -d yourdomain.com
sudo systemctl reload nginx

Step 5 — Start n8n

Navigate back to your n8n directory and bring the container up:

cd ~/n8n
docker-compose up -d

Check that it is running:

docker ps

You should see the n8n container listed as Up. Open your browser and go to https://yourdomain.com — the n8n setup screen should greet you.

Step 6 — Secure Your Instance

On first launch, n8n will ask you to create an owner account. Use a strong password. Additionally, consider the following security hardening steps:

  • Enable basic authentication via environment variables if you want an extra login layer
  • Set up UFW firewall: allow only ports 22, 80, and 443
  • Keep Docker and n8n updated regularly

Step 7 — Enable Auto-Restart and Keep n8n Running

Because you used restart: always in your Docker Compose file, n8n will automatically restart if the server reboots or crashes. No additional configuration is needed for basic persistence.

To update n8n in the future:

docker-compose pull
docker-compose up -d

Which VPS Provider Should You Choose?

Both hostinger and netcup work excellently for self-hosting n8n. hostinger offers beginner-friendly dashboards and competitive pricing for entry-level VPS plans. netcup is popular in the European developer community for its transparent pricing and high-performance SSD VPS options.

For a lightweight n8n instance running personal or small-team workflows, a 2 GB RAM plan from either hostinger or netcup is more than sufficient.

Final Thoughts

Self-hosting n8n on a VPS puts you firmly in control of your automation stack. No usage limits, no vendor lock-in, no surprise bills. With Docker and Nginx handling the heavy lifting, the setup is reliable, reproducible, and easy to maintain.

Once your instance is live, the real power begins — connect APIs, build multi-step automations, and run workflows on a schedule that you define, on infrastructure that belongs to you.

This post was created with tools we use and recommend: n8n for workflow automation, Turbotic as an AI-native automation alternative, ElevenLabs for AI voiceover, Placid for visual content creation, and Hostinger for reliable VPS hosting. Some links are affiliate links.

🇩🇪 Deutsch

Warum n8n auf einem eigenen VPS hosten?

n8n ist eines der leistungsstärksten Open-Source-Tools für Workflow-Automatisierung. Die Cloud-Version ist bequem, aber wer n8n selbst hostet, profitiert von unbegrenzten Workflows, vollständiger Datenkontrolle und keinen monatlichen Ausführungsgebühren. Du besitzt den Server. Du besitzt die Daten. Du behältst die Kontrolle.

In dieser Anleitung richtest du eine vollständige n8n-Instanz auf einem VPS mit Docker und Docker Compose ein, sicherst sie mit einem SSL-Zertifikat ab und betreibst sie als dauerhaften Hintergrunddienst — in etwa 30 Minuten.

Was du vorher brauchst

  • Einen VPS mit mindestens 1 GB RAM und 1 vCPU (2 GB empfohlen) — Anbieter wie hostinger oder netcup sind gute Optionen
  • Einen Domainnamen, der auf die IP-Adresse deines VPS zeigt
  • Ubuntu 22.04 LTS als Betriebssystem (empfohlen)
  • Grundlegende SSH- und Terminal-Kenntnisse

Schritt 1 — VPS einrichten

Melde dich per SSH bei deinem VPS an. Wenn du hostinger oder netcup verwendest, findest du die Root-Zugangsdaten direkt im Control Panel.

Aktualisiere zuerst die Systempakete:

apt update && apt upgrade -y

Erstelle anschließend einen neuen Nicht-Root-Benutzer für mehr Sicherheit:

adduser n8nuser
usermod -aG sudo n8nuser

Wechsle für alle weiteren Schritte zu diesem Benutzer:

su - n8nuser

Schritt 2 — Docker und Docker Compose installieren

Docker ist der sauberste Weg, um n8n auf einem VPS zu betreiben. Es isoliert die Anwendung, vereinfacht Updates und vermeidet Abhängigkeitskonflikte.

sudo apt install docker.io docker-compose -y
sudo systemctl enable docker
sudo systemctl start docker

Überprüfe, ob Docker korrekt läuft:

docker --version

Schritt 3 — Docker Compose Datei erstellen

Erstelle ein neues Verzeichnis für dein n8n-Setup:

mkdir ~/n8n && cd ~/n8n

Erstelle jetzt eine docker-compose.yml-Datei:

nano docker-compose.yml

Füge folgende Konfiguration ein:

version: '3.8'
services:
  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - '5678:5678'
    environment:
      - N8N_HOST=deinedomain.de
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://deinedomain.de/
      - GENERIC_TIMEZONE=Europe/Berlin
    volumes:
      - ~/.n8n:/home/node/.n8n

Ersetze deinedomain.de durch deine tatsächliche Domain. Speichern und beenden mit CTRL+X → J → Enter.

Schritt 4 — Reverse Proxy mit Nginx und SSL einrichten

Damit n8n über HTTPS erreichbar ist, benötigst du einen Reverse Proxy. Installiere Nginx und Certbot:

sudo apt install nginx certbot python3-certbot-nginx -y

Erstelle eine neue Nginx-Site-Konfiguration:

sudo nano /etc/nginx/sites-available/n8n

Füge folgendes ein:

server {
    server_name deinedomain.de;

    location / {
        proxy_pass http://localhost:5678;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Aktiviere die Konfiguration und hole dein SSL-Zertifikat:

sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo certbot --nginx -d deinedomain.de
sudo systemctl reload nginx

Schritt 5 — n8n starten

Wechsle zurück in dein n8n-Verzeichnis und starte den Container:

cd ~/n8n
docker-compose up -d

Prüfe, ob er läuft:

docker ps

Du solltest den n8n-Container als Up sehen. Öffne deinen Browser und rufe https://deinedomain.de auf — der n8n-Einrichtungsbildschirm sollte erscheinen.

Schritt 6 — Instanz absichern

Beim ersten Start fordert n8n dich auf, ein Besitzerkonto zu erstellen. Verwende ein starkes Passwort. Zusätzlich empfehlen sich folgende Sicherheitsmaßnahmen:

  • Basic Authentication über Umgebungsvariablen aktivieren, falls du eine zusätzliche Login-Schicht möchtest
  • UFW-Firewall einrichten: nur Ports 22, 80 und 443 erlauben
  • Docker und n8n regelmäßig aktualisieren

Schritt 7 — Automatischen Neustart sicherstellen

Da du restart: always in deiner Docker Compose Datei verwendet hast, startet n8n automatisch neu, wenn der Server neu startet oder abstürzt. Für grundlegende Persistenz ist keine weitere Konfiguration erforderlich.

So aktualisierst du n8n zukünftig:

docker-compose pull
docker-compose up -d

Welchen VPS-Anbieter solltest du wählen?

Sowohl hostinger als auch netcup eignen sich hervorragend für das Selbst-Hosten von n8n. hostinger bietet einsteigerfreundliche Dashboards und wettbewerbsfähige Preise für Einsteiger-VPS-Pläne. netcup ist in der europäischen Entwickler-Community für transparente Preise und leistungsstarke SSD-VPS-Optionen bekannt.

Für eine leichtgewichtige n8n-Instanz, die persönliche oder kleine Team-Workflows ausführt, reicht ein 2-GB-RAM-Plan von hostinger oder netcup völlig aus.

Fazit

Wer n8n auf einem eigenen VPS hostet, hat die volle Kontrolle über seinen Automatisierungs-Stack. Keine Nutzungsbeschränkungen, keine Abhängigkeit von einem Anbieter, keine unerwarteten Rechnungen. Mit Docker und Nginx als technischer Grundlage ist das Setup zuverlässig, reproduzierbar und leicht zu warten.

Sobald deine Instanz live ist, beginnt die eigentliche Stärke — verbinde APIs, baue mehrstufige Automatisierungen und führe Workflows nach einem selbst definierten Zeitplan auf einer Infrastruktur aus, die dir gehört.

Dieser Beitrag wurde mit Tools erstellt, die wir selbst nutzen und empfehlen: n8n für Workflow-Automatisierung, Turbotic als KI-native Automatisierungsalternative, ElevenLabs für KI-Voiceover, Placid für visuelle Content-Erstellung und netcup für zuverlässiges VPS-Hosting in Deutschland. Einige Links sind Affiliate-Links.