This article contains affiliate links. If you buy through them, we may earn a commission at no extra cost to you.
n8n on a netcup VPS: Self-Hosted, GDPR-Compliant, Ready in 30 Minutes
If you process personal data inside your automation workflows — customer names, email addresses, form submissions — storing that data on US-based cloud servers creates real GDPR exposure. The cleanest solution is to run your own n8n instance on a VPS whose data centre sits inside the EU. This guide walks you through the complete setup on a netcup VPS, from a blank Ubuntu server to a fully operational n8n instance with HTTPS, in roughly 30 minutes.
For the automation layer itself, get it from n8n — the open-source workflow tool ships with 400+ integrations and costs nothing to self-host, so you only pay for the VPS underneath it.
Why Self-Host n8n for GDPR Compliance?
When you use a SaaS automation platform, your workflow payloads — including any personal data — transit and rest on the provider's infrastructure. Under GDPR Article 28, that makes the provider a data processor, and you need a valid Data Processing Agreement plus confirmation that data stays in the EEA.
Self-hosting eliminates that dependency entirely. Your data never leaves your server. Combined with a VPS hosted in Germany, you get:
- Data residency inside the EU — no Schrems II concerns
- Full control over retention and deletion — purge execution logs on your schedule
- No per-workflow or per-execution pricing — scale freely
- Auditability — you own the database and can produce records for a supervisory authority
What You Need Before You Start
- A netcup VPS (VPS 1000 G11 or higher recommended — 2 vCores, 2 GB RAM)
- Ubuntu 22.04 LTS as the OS image
- A domain or subdomain pointed at the VPS IP (e.g. n8n.yourdomain.com)
- SSH access to the server
- About 30 minutes
Step 1 — Provision Your netcup VPS
Log in to the netcup customer control panel (SCP), order a VPS, and select Ubuntu 22.04 LTS as the image. Once the server is active, note the IPv4 address and set your DNS A record now — propagation takes a few minutes and you will need it working before the SSL step.
Step 2 — Initial Server Hardening
Connect via SSH as root, then run the following to update packages and create a non-root user:
apt update && apt upgrade -yadduser n8nuser— follow the promptsusermod -aG sudo n8nuser- Copy your SSH public key to the new user and disable root SSH login in
/etc/ssh/sshd_config - Enable UFW:
ufw allow OpenSSH && ufw allow 80 && ufw allow 443 && ufw enable
Step 3 — Install Docker and Docker Compose
n8n's recommended self-host method is Docker. Install it with the official convenience script:
curl -fsSL https://get.docker.com | shusermod -aG docker n8nuser- Log out and back in as n8nuser to apply the group change
- Verify:
docker --version
Step 4 — Create the Docker Compose File
Create a working directory and a docker-compose.yml file:
mkdir ~/n8n && cd ~/n8n- Create
docker-compose.ymlwith the following services: n8n, Postgres (for persistent storage), and Caddy (for automatic HTTPS)
A minimal but production-ready compose file looks like this:
- Postgres service — image
postgres:15, named volumepostgres_data, environment variables forPOSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DB - n8n service — image
n8nio/n8n, depends on Postgres, environment variables:DB_TYPE=postgresdb,DB_POSTGRESDB_HOST=postgres,N8N_HOST=n8n.yourdomain.com,N8N_PROTOCOL=https,WEBHOOK_URL=https://n8n.yourdomain.com/,N8N_ENCRYPTION_KEY(generate withopenssl rand -hex 24), named volumen8n_data - Caddy service — image
caddy:2, ports 80 and 443, a simpleCaddyfilethat reverse-proxies to n8n and handles Let's Encrypt certificates automatically
Sample Caddyfile
Mount a Caddyfile into the Caddy container at /etc/caddy/Caddyfile. Its content should be:
n8n.yourdomain.com { reverse_proxy n8n:5678 }
Caddy will obtain and renew a Let's Encrypt TLS certificate automatically as long as your DNS record is live.
Step 5 — Configure GDPR-Relevant Environment Variables
n8n stores execution data in its database. For GDPR compliance, limit retention by adding these variables to the n8n service:
EXECUTIONS_DATA_PRUNE=true— enables automatic pruningEXECUTIONS_DATA_MAX_AGE=72— keeps execution data for 72 hours (adjust to your policy)EXECUTIONS_DATA_SAVE_ON_SUCCESS=none— do not persist payload data for successful runs if you don't need itN8N_DIAGNOSTICS_ENABLED=false— disable telemetry sent to n8n's serversN8N_VERSION_NOTIFICATIONS_ENABLED=false— optional, reduces outbound calls
Step 6 — Start the Stack
docker compose up -d- Watch logs:
docker compose logs -f n8n - Wait about 60 seconds for Postgres to initialise and n8n to run its migrations
- Open https://n8n.yourdomain.com in a browser — you should see the n8n setup wizard
Create your owner account. The credentials are stored in your Postgres database on the netcup VPS — nowhere else.
Step 7 — Persistent Backups
Schedule a daily Postgres dump to a local file and optionally sync it to a GDPR-compliant object storage bucket (e.g. netcup S3-compatible storage or a Hetzner Storage Box in Germany):
docker exec postgres pg_dump -U n8nuser n8n > /home/n8nuser/backups/n8n_$(date +%F).sql- Add this to a cron job via
crontab -e— e.g. daily at 02:00 - Keep backups for at least 30 days, or align with your data retention policy
Step 8 — First Workflow: Verify Everything Works
In the n8n editor, create a simple test workflow:
- Trigger: Manual trigger
- Node: HTTP Request to
https://httpbin.org/get - Node: Set node to extract the
originfield (this will show your VPS IP — confirming data leaves from your server, not a US cloud)
Run the workflow. The IP shown should match your netcup VPS address. That is your GDPR audit trail: all processing happens on EU soil.
Keeping n8n Up to Date
Pull the latest image and recreate the container with zero downtime:
docker compose pull n8ndocker compose up -d n8n
Postgres data persists in named volumes, so upgrades are non-destructive. Always back up before a major version bump.
Summary: What You Have Built
- A self-hosted n8n instance running on a German VPS
- HTTPS via automatic Let's Encrypt certificates through Caddy
- PostgreSQL for reliable, persistent workflow storage
- GDPR-aligned execution data pruning and telemetry disabled
- A daily backup routine you fully control
From here, you can build any workflow you like — connecting CRMs, sending emails, processing webhook data — with the confidence that personal data stays inside your infrastructure. For inspiration and ready-made workflow templates, n8n is the best starting point, with 400+ integrations and an active community template library.
If you want to run powerful workflow automation without sending personal data to third-party clouds, you can self-host the full platform via n8n — including 400+ integrations and free self-hosting — to keep every byte of your automation data GDPR-compliant on your own server.