Self-Hosting n8n with Docker Compose: Complete Guide for German Servers
How to install n8n with Docker Compose: Postgres instead of SQLite, .env, volumes and updates step by step.
Guide to changing servers for self-hosted n8n: blue-green approach with data migration, DNS switchover and minimal downtime.
A server change for self-hosted n8n succeeds without noticeable downtime if you follow the blue-green principle: the new server is built completely in parallel to the old one and tested with the migrated data before the DNS switch redirects traffic. It is crucial that workflows, credentials and the n8n database are transferred completely and with the same encryption key to the new server, because n8n uses the N8N_ENCRYPTION_KEY to decrypt stored credentials. Anyone who forgets this key during the move loses access to all stored credentials, even if the workflows themselves could be imported. As of: July 2026.
Before you migrate anything, the new server (for example a fresh Hetzner Cloud instance) should be set up and operational, including Docker or Docker Compose, reverse proxy and firewall rules for ports 80 and 443. For Hetzner setups, the n8n documentation on hosting on Hetzner describes the setup with Docker Compose and Caddy as reverse proxy, including persistent volumes for the n8n data.
n8n offers dedicated commands for export and import via the CLI commands for export and import that handle workflows and credentials separately. A complete backup can be created with the flags --backup and --output, and restored on import with --input and --separate.
According to the n8n documentation, these commands also export the internal IDs of workflows and credentials. If records with the same IDs already exist on the target server, they are overwritten during import, an important point if the new server is not set up completely empty. Imported workflows are also disabled by default and must be deliberately reactivated after checking.
After the import: manually test critical workflows via the test subdomain, check triggers, webhooks and connections to external services, and spot check the number of workflows and credentials between the old and new server.
Only once the new server runs reliably under the test subdomain is the actual domain switched over. Beforehand, lower the TTL of the affected DNS entry to a low value (for example 300 seconds), so that the switch takes effect quickly. Then change the A record of the main domain to the IP address of the new server. During the transition period, the old and new instance run in parallel, so that incoming requests can briefly be distributed to both servers depending on the DNS cache state. For webhook-driven workflows, this can mean that individual calls reach the old instead of the new server during the switchover window, which is why webhook-intensive workflows should be monitored especially closely during this phase.
After the DNS switch, wait at least the old TTL time plus a safety buffer before shutting down the old server. During this time, check the logs of the new server for incoming traffic and make sure that no important executions are still running on the old system. Only once the new server has been handling all traffic stably for a longer period should you stop the old server and archive one last backup before it is permanently deleted. NordFlux applies this approach by default for server changes for customers with self-hosted n8n to continuously maintain German data sovereignty and control over the infrastructure.
This depends on the number of workflows, the amount of data and the TTL of the DNS entries. The actual migration of the data is usually done within minutes, the DNS switch with a safety buffer can take a few hours depending on the TTL configuration.
Without the identical N8N_ENCRYPTION_KEY, imported credentials cannot be decrypted. Workflows do appear, but connections to external services fail until the credentials are re-entered.
For a complete migration, you should export both the workflows and the credentials via the dedicated n8n CLI commands, in addition to the actual database folder or an external PostgreSQL instance, if one is in use.
No. With the blue-green approach, the old server remains active and usable until the DNS switch is successful. The actual downtime is, in the ideal case, limited to the brief DNS switchover moment.
Founder of NordFlux. Spent four years automating processes at enterprise scale at Dräger, and now brings that depth to the mid-market — pragmatic and with full data sovereignty.
Certifications
How to install n8n with Docker Compose: Postgres instead of SQLite, .env, volumes and updates step by step.
Preparing the new server, migrating workflows and credentials, and cutting over DNS with a blue-green approach: each step carries its own pitfalls when production workflows have to keep running throughout. NordFlux plans and accompanies your n8n server migration so your automations continue running without noticeable interruption.