Self-Host n8n on a VPS — Full Setup Guide

n8n auf VPS selbst hosten – Anleitung

🇬🇧 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 Virtual Private Server (VPS) gives you full control over your data, no usage limits, and significant cost savings in the long run.

Whether you are running complex AI pipelines, connecting dozens of APIs, or simply want to keep sensitive business data on your own infrastructure, a self-hosted setup is the professional choice. Providers like Hostinger and Netcup offer affordable VPS plans that are perfectly suited for running n8n reliably.

What You Will Need

  • A VPS with at least 1 vCPU and 1 GB RAM (2 GB recommended) — available from Hostinger or Netcup
  • Ubuntu 22.04 LTS installed on your server
  • A domain name pointed to your server's IP address
  • Basic familiarity with the Linux command line
  • Docker and Docker Compose installed

Step 1 — Get Your VPS Ready

Start by ordering a VPS from a reliable provider. Hostinger VPS plans are beginner-friendly and come with fast SSD storage, while Netcup offers excellent value for European users with flexible root server options.

Once your VPS is provisioned, log in via SSH:

  • Open your terminal
  • Run: ssh root@YOUR_SERVER_IP
  • Update your system: apt update && apt upgrade -y

Step 2 — Install Docker and Docker Compose

Docker makes running n8n extremely straightforward. Install it with the following commands:

  • apt install -y docker.io docker-compose
  • Enable Docker on boot: systemctl enable docker && systemctl start docker
  • Verify installation: docker --version

Docker Compose allows you to define your entire n8n setup in a single configuration file, making updates and maintenance much simpler.

Step 3 — Create the Docker Compose File for n8n

Create a dedicated directory and a docker-compose.yml file:

  • mkdir ~/n8n && cd ~/n8n
  • nano docker-compose.yml

Paste the following configuration:

  • Service name: n8n
  • Image: n8nio/n8n
  • Restart policy: always
  • Ports: 5678:5678
  • Environment variables: set N8N_HOST, N8N_PORT, WEBHOOK_URL, and optionally N8N_BASIC_AUTH_ACTIVE=true with a username and password
  • Volumes: mount ~/.n8n:/home/node/.n8n to persist your data

Save the file and start n8n with: docker-compose up -d

Step 4 — Set Up a Reverse Proxy with Nginx

To access your n8n instance via a domain name with HTTPS, you need a reverse proxy. Install Nginx and Certbot:

  • apt install -y nginx certbot python3-certbot-nginx
  • Create a new Nginx config file for your domain
  • Set up a proxy_pass directive pointing to http://localhost:5678
  • Run Certbot: certbot --nginx -d yourdomain.com

Certbot will automatically configure SSL and renew certificates, giving your n8n instance a secure https:// address.

Step 5 — Secure and Harden Your Setup

Security is critical when exposing any service to the public internet. Take these steps:

  • Enable the firewall: ufw allow OpenSSH && ufw allow 'Nginx Full' && ufw enable
  • Enable n8n's built-in basic authentication in your Docker Compose environment variables
  • Consider setting up fail2ban to protect against brute-force attacks
  • Regularly update your Docker images: docker-compose pull && docker-compose up -d

Step 6 — Access Your n8n Instance

Open your browser and navigate to https://yourdomain.com. You should see the n8n login screen. Log in with the credentials you set in your Docker Compose file and start building your first automation workflow.

Your self-hosted n8n instance is now live, fully private, and ready to power your automation stack — from AI agents to CRM integrations and beyond.

Recommended VPS Providers

Choosing the right hosting partner makes a real difference for uptime and performance. Here are two excellent options:

  • Hostinger — Beginner-friendly VPS with a clean control panel, fast NVMe storage, and affordable pricing starting from just a few euros per month.
  • Netcup — German-based provider with excellent value root servers and VPS plans, ideal for European businesses and GDPR-conscious users.

Final Thoughts

Self-hosting n8n on a VPS is one of the smartest moves you can make as an automation enthusiast or professional. You get unlimited workflows, full data ownership, and the freedom to extend n8n with custom nodes and integrations — all at a fraction of the cloud subscription cost.

With providers like Hostinger and Netcup offering reliable and affordable infrastructure, there has never been a better time to take your automation setup into your own hands.

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 VPS selbst hosten?

n8n ist eines der leistungsstärksten Open-Source-Tools für Workflow-Automatisierung. Während die Cloud-Version praktisch ist, bietet das Selbsthosten von n8n auf einem Virtual Private Server (VPS) volle Kontrolle über deine Daten, keine Nutzungslimits und langfristig erhebliche Kosteneinsparungen.

Ob du komplexe KI-Pipelines betreibst, dutzende APIs verbindest oder sensible Geschäftsdaten auf deiner eigenen Infrastruktur behalten möchtest — ein selbst gehostetes Setup ist die professionelle Wahl. Anbieter wie Hostinger und Netcup bieten günstige VPS-Tarife, die ideal für den zuverlässigen Betrieb von n8n geeignet sind.

Was du benötigst

  • Einen VPS mit mindestens 1 vCPU und 1 GB RAM (2 GB empfohlen) — erhältlich bei Hostinger oder Netcup
  • Ubuntu 22.04 LTS auf deinem Server installiert
  • Eine Domain, die auf die IP-Adresse deines Servers zeigt
  • Grundkenntnisse der Linux-Befehlszeile
  • Docker und Docker Compose installiert

Schritt 1 — VPS vorbereiten

Bestelle zunächst einen VPS bei einem zuverlässigen Anbieter. Hostinger-VPS-Tarife sind einsteigerfreundlich und bieten schnellen SSD-Speicher, während Netcup für europäische Nutzer besonders gutes Preis-Leistungs-Verhältnis mit flexiblen Root-Server-Optionen bietet.

Sobald dein VPS bereit ist, melde dich per SSH an:

  • Öffne dein Terminal
  • Führe aus: ssh root@DEINE_SERVER_IP
  • Aktualisiere dein System: apt update && apt upgrade -y

Schritt 2 — Docker und Docker Compose installieren

Docker macht das Ausführen von n8n extrem einfach. Installiere es mit folgenden Befehlen:

  • apt install -y docker.io docker-compose
  • Docker beim Start aktivieren: systemctl enable docker && systemctl start docker
  • Installation prüfen: docker --version

Docker Compose ermöglicht es dir, dein gesamtes n8n-Setup in einer einzigen Konfigurationsdatei zu definieren, was Updates und Wartung deutlich vereinfacht.

Schritt 3 — Docker Compose Datei für n8n erstellen

Erstelle ein eigenes Verzeichnis und eine docker-compose.yml-Datei:

  • mkdir ~/n8n && cd ~/n8n
  • nano docker-compose.yml

Füge folgende Konfiguration ein:

  • Service-Name: n8n
  • Image: n8nio/n8n
  • Neustart-Richtlinie: always
  • Ports: 5678:5678
  • Umgebungsvariablen: setze N8N_HOST, N8N_PORT, WEBHOOK_URL und optional N8N_BASIC_AUTH_ACTIVE=true mit Benutzername und Passwort
  • Volumes: binde ~/.n8n:/home/node/.n8n ein, um deine Daten dauerhaft zu speichern

Speichere die Datei und starte n8n mit: docker-compose up -d

Schritt 4 — Reverse Proxy mit Nginx einrichten

Um deine n8n-Instanz über einen Domainnamen mit HTTPS erreichbar zu machen, benötigst du einen Reverse Proxy. Installiere Nginx und Certbot:

  • apt install -y nginx certbot python3-certbot-nginx
  • Erstelle eine neue Nginx-Konfigurationsdatei für deine Domain
  • Richte eine proxy_pass-Direktive ein, die auf http://localhost:5678 zeigt
  • Führe Certbot aus: certbot --nginx -d deinedomain.de

Certbot konfiguriert SSL automatisch und erneuert Zertifikate selbstständig, sodass deine n8n-Instanz unter einer sicheren https://-Adresse erreichbar ist.

Schritt 5 — Setup absichern

Sicherheit ist entscheidend, wenn du einen Dienst öffentlich zugänglich machst. Ergreife folgende Maßnahmen:

  • Firewall aktivieren: ufw allow OpenSSH && ufw allow 'Nginx Full' && ufw enable
  • Integrierte Basic-Authentifizierung von n8n in den Docker-Compose-Umgebungsvariablen aktivieren
  • Erwäge die Installation von fail2ban zum Schutz vor Brute-Force-Angriffen
  • Docker-Images regelmäßig aktualisieren: docker-compose pull && docker-compose up -d

Schritt 6 — Auf deine n8n-Instanz zugreifen

Öffne deinen Browser und navigiere zu https://deinedomain.de. Du solltest den n8n-Anmeldebildschirm sehen. Melde dich mit den in deiner Docker-Compose-Datei festgelegten Zugangsdaten an und erstelle deinen ersten Automatisierungs-Workflow.

Deine selbst gehostete n8n-Instanz ist jetzt live, vollständig privat und bereit, deinen Automatisierungs-Stack zu betreiben — von KI-Agenten bis hin zu CRM-Integrationen.

Empfohlene VPS-Anbieter

Die Wahl des richtigen Hosting-Partners macht einen echten Unterschied für Verfügbarkeit und Performance. Hier sind zwei hervorragende Optionen:

  • Hostinger — Einsteigerfreundliche VPS-Tarife mit übersichtlichem Control Panel, schnellem NVMe-Speicher und günstigen Preisen ab wenigen Euro pro Monat.
  • Netcup — Deutscher Anbieter mit hervorragendem Preis-Leistungs-Verhältnis bei Root-Servern und VPS-Tarifen, ideal für europäische Unternehmen und DSGVO-bewusste Nutzer.

Fazit

n8n auf einem VPS selbst zu hosten ist eine der cleversten Entscheidungen, die du als Automatisierungs-Enthusiast oder Profi treffen kannst. Du erhältst unbegrenzte Workflows, vollständige Datenkontrolle und die Freiheit, n8n mit eigenen Nodes und Integrationen zu erweitern — und das zu einem Bruchteil der Cloud-Abo-Kosten.

Mit Anbietern wie Hostinger und Netcup, die zuverlässige und erschwingliche Infrastruktur bieten, war es nie einfacher, dein Automatisierungs-Setup in die eigenen Hände zu nehmen.

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.