Skip to content
Back to the blog

How to host n8n on a VPS: quick install or Docker Compose

Compare installing n8n from the marketplace with running it yourself on a VPS. Check HTTPS, webhook URLs, persistent data, backups and operations.

  • n8n
  • VPS
  • Docker Compose

n8n can automate forms, notifications and workflows across external services, but a loaded editor does not mean the instance is production-ready. You must keep it available, expose it over HTTPS, publish the correct webhook URL and protect credentials and execution data. This guide helps you choose between a marketplace deployment and operating n8n on your own VPS.

Choose how much infrastructure you will operate

If you want to start without manually assembling Docker and a reverse proxy, see the n8n app in the marketplace. Its listing shows the recommended VPS, resources and current price; review checkout before ordering. Initial installation is not a managed service: verify the result, configure your domain and maintain the application and server under the current product terms.

If you want control over the operating system, Compose, proxy, database and update cycle, compare VPS plans. You then operate Docker, the firewall, backups, patching and recovery. Our Docker Compose VPS deployment guide covers private networks, a proxy and data; this guide focuses on n8n-specific requirements.

Set the domain, TLS and webhook URL before activating workflows

Create a subdomain such as automation.example.com and point its DNS record to the server. Put a reverse proxy in front of n8n to provide HTTPS and renew certificates. The official n8n TLS guide recommends this approach. Keep n8n’s internal port reachable only by the proxy; do not expose 5678 to the internet without a specific reason.

When the proxy terminates HTTPS and forwards requests to n8n on its internal port, set N8N_WEBHOOK_URL to the public URL with a trailing / and set N8N_PROXY_HOPS=1. The official reverse-proxy webhook guide says N8N_WEBHOOK_URL replaces WEBHOOK_URL, deprecated since n8n 2.35.0, and that the final proxy must forward X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto. Change the hop count if your actual path has more proxies; do not copy 1 blindly.

After deployment, open the public test URL generated by a Webhook node and send a request from outside the VPS. The editor’s test mode and production webhook have different paths and activation requirements. If the editor displays http://localhost:5678 or an internal hostname, check the domain, environment variables and forwarded headers before enabling external integrations.

Preserve data and encryption keys during updates

n8n stores configuration, encrypted credentials and other instance data. Use persistent storage for /home/node/.n8n; recreating a container without its volume can make the instance look like a fresh installation. Keep a stable N8N_ENCRYPTION_KEY securely if your installation procedure supports setting one. Losing it can prevent existing credentials from being decrypted. Never commit it, paste it in a public issue, or share it with users who do not need it.

Before an update, read the release notes and n8n’s official Docker Compose instructions. Pin a version or digest deliberately; do not automatically follow latest without a maintenance window and a post-update check. Back up the data and database consistently, store a copy outside the VPS and test a restore. A backup on the same disk does not protect against server loss.

A small workflow may fit the database supported by your chosen installation. If executions grow or you need to separate services, evaluate PostgreSQL and resources using real usage. There is no universal server size: saved executions, binary data, workflow frequency and AI nodes all affect memory, CPU and disk. Set an execution-retention policy too, so stored history does not grow without limit.

Limit access and test failure modes

Use a unique owner password, enable two-factor authentication where available and limit who can create credentials or run nodes with filesystem and network access. Treat n8n credentials as secrets with access to real APIs: rotate any exposed credentials and do not commit workflow exports containing secrets to a public repository. Review what input and output data each execution stores.

After each change, check separately: editor loads over HTTPS, login works, a test webhook responds, an active production webhook responds, a container restart retains configuration and disk has free space. If a webhook does not arrive, check DNS, TLS, public route, N8N_WEBHOOK_URL, N8N_PROXY_HOPS, proxy headers and firewall. If it works manually but not on schedule, check the timezone, workflow activation and execution logs.

The marketplace helps start the deployment; it does not replace verified backups, an update policy or monitoring of your workflows. Review n8n and its recommended VPS and current prices with the required resources and responsibilities in mind.

Manage your sites, servers and email.

Forgot your password?

Free, and it takes a minute.

At least 8 characters. Not all digits, not a common one.

We'll email you to confirm the account.