Self-host n8n on Linode with Dokploy (2026 guide)
Deploy n8n on a Linode VPS with Dokploy. Set up Docker, HTTPS, and webhooks, then run a test workflow.
I use Dokploy to deploy n8n on a Linode VPS. n8n is a fair-code automation platform with a visual workflow builder, over 400 integrations, and nodes for AI workflows. Dokploy runs the n8n container and handles routing and certificates.
Hosting cost
The prices below are the ones I used for this guide. With self-hosted n8n, you pay for the server and set your own execution capacity with the resources you give it. You also run the instance that stores your workflow data.
| Plan | Monthly cost | Workflow executions | Where data lives |
|---|---|---|---|
| Zapier Starter | $29.99 | 750 tasks | Zapier’s servers |
| n8n Cloud Starter | $24 | 2,500 executions | n8n’s servers |
| Self-hosted on a 4 GB Linode | About $24 | Limited by server capacity | Your instance |
| Self-hosted on a Linode Nanode | About $6 | Limited by server capacity | Your instance |
I use the 4 GB plan for this guide. A $6 Nanode can handle low-volume workflows if you’re trying out n8n before committing to a larger instance.
What you’ll need
- A Linode account. Check whether you qualify for the $100 new-account credit.
- A domain or subdomain you can point to the server.
- Ubuntu 22.04 or Debian 11. Allow at least 2 GB of RAM and 30 GB of disk space. The walkthrough uses 4 GB of RAM.
- A terminal and about 30 minutes.
Step 1. Set up your Linode server
Create a Linode instance
- In your Linode account, click Create Linode.
- Choose Ubuntu 22.04 LTS and select a region close to you or your users.
- Select the Shared CPU 4 GB plan for the setup in this guide.
- Set a strong root password and store it in your password manager. Add your SSH key if you have one.
- Click Create Linode. Copy the instance’s IP address after it boots.
Connect and update the system
Open a terminal or PuTTY and connect over SSH.
ssh root@YOUR_LINODE_IP
On the first connection, SSH asks you to confirm the server’s fingerprint. Compare it with the instance’s fingerprint before accepting it.
Update the system packages.
apt update && apt upgrade -y
Step 2. Point your domain to Linode
Set DNS while the packages update.
- Open the DNS dashboard for your domain.
- Create an A record named
@for the root domain orautomationfor the subdomain. - Use the Linode IP address as the value. Set the TTL to 300 seconds or the provider’s automatic setting.
- If you use multiple subdomains and want them to resolve to this Linode, add an A record for
*.yourdomain.compointing to the same IP.
DNS changes can show up within 15 minutes, but allow up to 24 hours for propagation.
Step 3. Install Dokploy
Run Dokploy’s installer on the Linode.
curl -sSL https://dokploy.com/install.sh | sh
The installer sets up Docker, Docker Compose, Traefik, and the Dokploy dashboard. After it finishes, open the dashboard in your browser.
http://YOUR_LINODE_IP:3000
Create an admin account with your email address, a strong password, and an organization name.
Step 4. Deploy n8n from the Dokploy template
Create a project
- In Dokploy, open Projects and click Create Project.
- Name it
n8n-automationor choose your own name. - Add a description if you want one, then click Create.
Choose the n8n template
- Open the project and click Create Service.
- Select Templates, search for n8n, and choose the template.
The Docker Compose configuration looks like this.
version: "3.8"
services:
n8n:
image: docker.n8n.io/n8nio/n8n:latest
restart: always
ports:
- "5678:5678"
environment:
- N8N_HOST=${N8N_HOST}
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://${N8N_HOST}/
- GENERIC_TIMEZONE=Europe/Berlin
volumes:
- n8n_data:/home/node/.n8n
Set environment variables
In Environment, set the following values.
| Variable | Value |
|---|---|
N8N_HOST | Your hostname, such as automation.yourdomain.com |
GENERIC_TIMEZONE | Your time zone, such as Asia/Kolkata or America/New_York |
N8N_ENCRYPTION_KEY | A random key. Generate one with openssl rand -hex 32. |
Keep a copy of the encryption key. n8n uses it to encrypt saved credentials and needs the same key to read them.
Add the domain and enable HTTPS
- Open the service’s Domains tab and click Add Domain.
- Enter your domain, such as
automation.yourdomain.com. - Turn on HTTPS and Generate SSL Certificate.
Traefik requests and renews the certificate through Let’s Encrypt.
Deploy the service
Click Deploy. Watch the service logs for Docker to pull the image, start the container, and report that n8n is listening on port 5678.
Pulling image docker.n8n.io/n8nio/n8n:latest...
Starting container...
n8n ready on port 5678
Step 5. Create your n8n owner account
Open https://automation.yourdomain.com. If Let’s Encrypt is still issuing the certificate, give it a few minutes and try again. At the welcome screen, enter your email, first and last name, and a strong, unique password. Click Continue to open the workflow canvas.
Step 6. Run a test workflow
- Click New Workflow and add a Manual Trigger node.
- Add a Code node and enter
return [{json: {message: "Hello from my self-hosted n8n!"}}]; - Click Execute Workflow. The Code node’s output should contain the test message.
Backups, scaling, and updates
Set up volume backups
Open Volume Backups in the n8n service. Choose a schedule, such as once a day, and a destination such as S3-compatible storage.
Migrate from SQLite to PostgreSQL
n8n starts with SQLite. For a larger production workload, you can use PostgreSQL.
-
In Dokploy, choose Create Service → Database → PostgreSQL. Set a strong password and save the service name, such as
postgres. -
Add these variables to the n8n service’s environment.
DB_TYPE=postgresdb DB_POSTGRESDB_HOST=postgres DB_POSTGRESDB_PORT=5432 DB_POSTGRESDB_DATABASE=n8n DB_POSTGRESDB_USER=postgres DB_POSTGRESDB_PASSWORD=your_postgres_password -
Before switching databases, export your existing workflows as JSON through Settings → Import/Export in n8n.
-
Redeploy n8n. It creates its tables in PostgreSQL on the first start.
-
Import the workflows through Settings → Import/Export → Import from file.
Keep the SQLite volume mounted for a few days so you have a fallback during the migration.
Monitor CPU and memory
Check both in the Dokploy monitoring dashboard. As a starting estimate, allow 200 to 500 MB for a light load and 1 to 2 GB under heavier use. If your instance is running out of memory, check which workflows are running and consider a larger Linode plan.
Run executions in queue mode
If many workflows run at once, queue mode lets the main instance receive requests while worker instances execute workflows.
- Add Redis using the Dokploy Redis template.
- Set
EXECUTIONS_MODE=queue,QUEUE_BULL_REDIS_HOST=redis, andQUEUE_BULL_REDIS_PASSWORD=your_redis_passwordin the n8n environment. - Start worker instances that use the same PostgreSQL database, Redis connection, and encryption key as the main instance.
See the full setup in the n8n queue mode documentation.
Update n8n
Check the n8n release notes, set your service’s image tag to the version you want, and click Deploy. For example, the image name with a version tag takes the form docker.n8n.io/n8nio/n8n:1.104. Check the service logs after the deploy.
Troubleshooting
Cloudflare 522 and 524 timeouts
A 522 means Cloudflare timed out contacting the origin. Check that the A record points to the Linode IP and that the Linode firewall allows ports 80 and 443. You can check Cloud Firewall in the dashboard or run ufw status on the server.
A 524 can occur when Cloudflare reaches the origin and waits too long for its response. If a webhook takes longer than the proxy allows, have the workflow return a response before it finishes the longer task. Changing n8n’s execution timeout leaves the proxy’s timeout in effect.
Let’s Encrypt certificate is missing
- Make sure ports 80 and 443 are reachable. Let’s Encrypt needs port 80 for the HTTP-01 challenge.
- Check Domains → your domain → Logs in Dokploy for
acmeerrors. If Let’s Encrypt rate-limited a request, wait until the limit resets before trying again. - Check whether the DNS record resolves to your server with
dig +short automation.yourdomain.com. - If you proxy the domain through Cloudflare, try setting the hostname to DNS only during certificate setup. Re-enable the proxy with Full (strict) after confirming that the origin serves a valid certificate.
The n8n container keeps restarting
Check Dokploy → your Compose service → Logs.
- If n8n reports an encryption key mismatch, restore the key that encrypted the saved credentials. If you supply no key on a fresh install, n8n generates one and saves it to its data folder. See n8n’s encryption key documentation.
- If another service uses host port 5678, change the host port in the Compose file.
- If n8n can’t write to its data volume, check that the
nodeuser with UID 1000 owns it. On a reused volume, you can correct ownership withdocker exec -u root <container_id> chown -R node:node /home/node/.n8n.
Webhooks don’t fire
- Set
WEBHOOK_URLto the public URL, including the trailing slash, such ashttps://automation.yourdomain.com/. - Make sure
N8N_HOSTuses the same hostname. - Redeploy after changing the environment variables.
- Test an active workflow with
curl -X POST https://automation.yourdomain.com/webhook/test-path. If you get a 404, check the path and whether the workflow is active. If the connection fails, check DNS, routing, and the firewall.
SQLite reports “database is locked”
SQLite can lock the database while one process writes and another tries to write. If you suspect corruption after an unclean shutdown, run an integrity check.
# SSH into your server, then:
docker exec -it <n8n_container_name> sh
cd /home/node/.n8n
sqlite3 database.sqlite "PRAGMA integrity_check;"
If SQLite returns anything other than ok, restore from your last Dokploy volume backup.
The domain doesn’t load
- Use
nslookup automation.yourdomain.comto check DNS. - Confirm that Linode Cloud Firewall allows incoming traffic on ports 80 and 443.
- Check the Dokploy logs and make sure the hostname in Traefik matches the domain you opened.
The instance uses too much memory
You can restart the n8n service from Dokploy if it stops responding. For ongoing pressure, give the instance more RAM or use queue mode to move workflow executions to workers.
A first workflow to run
Try a task you do by hand. You could sync a Google Sheet with Airtable or your database, schedule posts on Twitter, LinkedIn, or Instagram, or send a message when a deployment fails. You can also call a model for part of a workflow or automate invoice generation and onboarding.
I like this setup because I can deploy from a template, see what is running, and decide how much server capacity to buy. The same Dokploy project workflow also works for services you might want alongside n8n, such as a database or an API.