Requirements
n8n is usually more sensitive to memory than CPU. Monitor actual workflow usage before increasing concurrency or adding queue-mode workers.
Install n8n
1
Deploy Ubuntu 24.04
Deploy a server, choose a plan that fits the workload, and select Ubuntu 24.04.
2
Connect over SSH
Find the server IP address in the Arct Cloud console, then connect:See Connect via SSH for key and username help.
3
Point a domain to the server
Create an
A record such as n8n.example.com that points to the server’s public IPv4 address. Add an AAAA record only when IPv6 is configured and reachable on the VPS.Wait for the record to resolve to this server before starting Traefik:4
Install Docker Engine and Compose
Install Docker from Docker’s official Ubuntu repository:
5
Create the n8n configuration
Create a protected project directory, generate an encryption key, and create temporary proxy credentials for the first-owner setup:
htpasswd prompts for a temporary password without echoing it. Save that password until the owner account exists. Copy the generated encryption-key value, then create .env, replacing every example value:N8N_ENCRYPTION_KEY encrypts stored credentials. Keep a secure copy outside the VPS; an n8n database backup is not useful for encrypted credentials without the matching key.6
Create the Docker Compose project
This Compose file follows n8n’s official Traefik setup. It exposes only ports
80 and 443; n8n port 5678 is bound to loopback.7
Create the owner behind temporary authentication
Start the containers, then confirm an unauthenticated request receives Do not continue unless the last command returns Reconcile the stack and verify the proxy prompt is gone while the n8n login remains:The response must no longer be If n8n shows its owner-creation screen again, stop and inspect the persistent
401 from Traefik:401. Open https://n8n.example.com, enter the temporary setup proxy credentials, create the instance owner with a different unique password, and enable two-factor authentication in personal settings. Invite only trusted users; workflow nodes can access credentials and make network requests.After confirming that the owner can sign in with MFA, remove these three temporary lines from compose.yaml:401. After confirming the n8n login page appears instead of the owner-creation screen, delete the temporary proxy credential file:n8n_data volume before exposing the route.8
Verify the deployment
Confirm that both containers are running, n8n is healthy locally, and the public HTTPS endpoint responds:Create a manual test workflow, run it once, and confirm that a webhook node displays the public
https://n8n.example.com/ URL.Data, Secrets, and Network Security
Only SSH, HTTP, and HTTPS need inbound access. Restrict SSH to trusted source addresses where possible. Do not publish port
5678; the loopback mapping is for local health checks only.
n8n stores secrets used by workflows. Use least-privilege API credentials, review community nodes before installation, prune unnecessary execution data, and run n8n’s built-in security audit after initial setup and major configuration changes.
Back Up and Restore
Create portable workflow and encrypted-credential exports regularly:n8n-data.tgz into a new empty volume, restore the exact .env encryption key and Compose file, start the same n8n version used for the backup, then verify login, credentials, workflows, and webhooks before updating.
Never export credentials with
--decrypted into routine backups. The default encrypted export is safer, provided you preserve N8N_ENCRYPTION_KEY separately.Update and Roll Back Safely
- Read the n8n release notes for breaking changes and update at least monthly rather than skipping many releases.
-
Record the running version and image digest:
-
Create and verify a full backup, including
.envandn8n_data. -
Pull the current stable image and recreate the containers:
- Verify login, credentials, a manual workflow, and a public webhook before pruning old images.
Troubleshooting
Traefik returns 404 or the certificate is not issued
Traefik returns 404 or the certificate is not issued
Confirm the
A record resolves to this VPS and ports 80 and 443 are reachable. Check sudo docker compose logs --tail 100 traefik. Remove a stale AAAA record if IPv6 does not reach the server.The page returns 502 Bad Gateway
The page returns 502 Bad Gateway
Run
sudo docker compose -f /opt/n8n/compose.yaml ps and inspect sudo docker compose -f /opt/n8n/compose.yaml logs --tail 100 n8n. Confirm curl -fsS http://127.0.0.1:5678/healthz succeeds.Webhook URLs use localhost or the wrong scheme
Webhook URLs use localhost or the wrong scheme
Confirm
N8N_WEBHOOK_URL=https://.../ and N8N_PROXY_HOPS=1 are present in the rendered container environment, then recreate n8n with sudo docker compose up -d. Avoid the deprecated WEBHOOK_URL variable.n8n restarts or workflows fail with out-of-memory errors
n8n restarts or workflows fail with out-of-memory errors
Check
sudo docker stats --no-stream, reduce workflow concurrency or binary-data size, and review execution-data retention. Resize the VPS before adding workers or memory-heavy AI and file-processing workflows.Credentials cannot be decrypted after a restore
Credentials cannot be decrypted after a restore
Stop n8n and restore the exact
N8N_ENCRYPTION_KEY used by the backup. Recreating a key cannot decrypt existing credential records.Official Resources
n8n Docker Compose Guide
Official Docker Compose, DNS, Traefik, and HTTPS setup.
n8n on GitHub
Source code, security policy, and issue tracker.
n8n Releases
Stable releases, fixes, and upgrade notes.
n8n is developed by n8n GmbH. Arct Cloud is an independent infrastructure provider and is not affiliated with, sponsored by, or endorsed by n8n GmbH.