DEV Community

Sanghun Yun
Sanghun Yun

Posted on Edited on Originally published at gearflowlab.com

How to Migrate Local Docker & n8n from WSL2 to a $6 DigitalOcean Droplet

Moving a Dockerized n8n instance from Windows 11 WSL2 to an always-on Ubuntu Droplet breaks every saved OAuth token, API key, and webhook secret if you only export workflow JSON files—or let the new container boot once before restoring your volume's 32-character encryptionKey.

Lab Cutover Findings (WSL2 Kernel 6.6.87.2 + n8nio/n8n:1.76.1)

  • First-Boot Ciphertext Trap: If the destination container starts with an empty /home/node/.n8n/config, n8n generates a random key that permanently mismatches imported SQLite or PostgreSQL 16.6 credentials (Credentials could not be decrypted).
  • Clean Volume Snapshot: Running docker compose stop before archiving the named volume via read-only alpine:3.20 (tar -czf) prevents active SQLite WAL corruption during scp transfer.
  • Loopback + TLS Cutover: Binding "127.0.0.1:5678:5678" behind caddy:2.8.4-alpine blocks UFW port leaks while preserving production /webhook/ URLs.

Full Backup Commands, Production Compose File & Converter

Top comments (0)