DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk4 min

How to Deploy n8n on a VPS with Docker Compose and a Custom Domain

A practical guide to running n8n on a Linux VPS with Docker Compose, Traefik, a custom HTTPS domain, and persistent application data.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To deploy n8n on a Linux VPS with a custom domain, run n8n and a reverse proxy as Docker Compose services, point your domain to the server, configure HTTPS and the public webhook URL, and persist n8n’s data. The official n8n example uses Traefik for routing and TLS; this guide follows that approach without assuming a particular VPS provider.

What you need before you start

  • A Linux VPS with Docker Engine and the Docker Compose plugin installed. Use the Docker installation instructions for your Linux distribution; n8n does not prescribe a particular VPS vendor in its Docker Compose deployment guide.
  • A domain name and a hostname for n8n, such as n8n.example.com.
  • An email address for the certificate configuration.
  • Inbound web traffic on ports 80 and 443 allowed through the VPS firewall and any provider-level firewall.

The hostname must resolve to the VPS before the public HTTPS endpoint can work. This setup uses Traefik as a separate proxy service in front of n8n; the proxy handles incoming web traffic and TLS.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Point your domain to the VPS

At your DNS provider, create a record for the chosen hostname that points to the VPS’s public IP address. For example, if you plan to use n8n.example.com, its DNS record must lead to the server where Compose will run. DNS changes may take time to become visible, so check that the hostname resolves to the correct server before diagnosing n8n itself.

Allow inbound ports 80 and 443 to reach the VPS. The official example uses these ports for web access and HTTPS certificate handling. If either DNS or firewall routing is incorrect, changing n8n’s application settings will not make the hostname reachable.

Configure the Compose project

Create the project and environment file

Install Docker Engine and the Compose plugin using the current instructions for your Linux distribution, then create a project directory on the VPS. The n8n Compose example uses an .env file to supply the domain, subdomain, and certificate contact email. Substitute your own values rather than copying example placeholders.

Keep the environment file protected: it contains deployment configuration and may also be used for sensitive settings. The complete service definitions and current variable names are maintained in the official n8n Docker Compose guide; use that page’s current Compose configuration rather than an unverified template.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the public host and webhook URL consistently

Configure n8n’s public host from the same subdomain and domain used in DNS, declare HTTPS as the public protocol, and set WEBHOOK_URL to the complete public HTTPS address. For example, for n8n.example.com, the webhook base address should be https://n8n.example.com/. The key point is that external services must call the public URL, not an internal Docker service name or container address.

The official example also configures Traefik to route the hostname to n8n and obtain TLS certificates using ACME. Traefik listens on ports 80 and 443 and redirects HTTP traffic to HTTPS. n8n’s SSL guidance likewise describes terminating SSL/TLS with a reverse proxy or network load balancer in front of n8n.

Rank #3
HP MicroServer Gen10 Plus Mini Tower Server, Intel Xeon E-2224 3.4GHz, 32GB RAM, 16TB Storage, RAID, Windows Server 2019
  • HP MicroServer Gen10 Plus Tower Server for Business with Microsoft Windows Server 2019 OS!
  • Intel Xeon E-2224 Quad-Core 3.4GHz 8MB CPU, Up To 4.6GHz Turbo
  • 32GB (2 x 16GB) DDR4 PC4-21300 2666MHz Unbuffered Memory
  • 16TB (4 x 4TB) 7.2K 6Gb/s SATA 3.5" HDDs in RAID
  • Hard drives and memory upgrades included separately NOT installed, installation required.

Persist n8n and proxy data

Keep the Compose volume mounted at /home/node/.n8n. In the basic example, n8n stores its SQLite database and encryption key there; without a persistent volume, replacing the container can discard application state. Also retain Traefik’s certificate data in its own persistent volume so certificate files survive container replacement.

SQLite is the database in the basic Compose example, not the only supported deployment pattern. The official n8n hosting examples include a separate Compose setup using PostgreSQL. Choose and configure a database based on your deployment needs; these sources do not establish a universal user-count threshold or a requirement that every self-hosted instance use PostgreSQL.

Start the stack and verify HTTPS

  1. From the project directory containing the Compose file and its environment configuration, run docker compose up -d.
  2. Open the configured hostname in a browser using https://. Confirm that the n8n interface loads over HTTPS.
  3. Check that workflows which use webhooks expose URLs based on the public HTTPS hostname, not an internal container address.

The official Compose guide describes the endpoint as the HTTPS address formed from the configured subdomain and domain. If it is not reachable, first confirm the DNS record points to the VPS and ports 80 and 443 are permitted through the relevant firewalls. Then check the proxy and Compose configuration against the current official example.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose self-hosting or n8n Cloud

Option Who maintains the infrastructure When it fits
Self-hosted Docker on a VPS You maintain the Linux server, Docker deployment, proxy, TLS configuration, and persistent data. You want control over the runtime and are prepared to operate the server.
n8n Cloud n8n provides the managed service rather than requiring you to operate your own VPS stack. You prefer not to maintain the underlying server infrastructure.

n8n lists both Docker and Cloud among its deployment options in its deployment overview. The cited documentation does not provide a current plan-price comparison or quantify the total cost of running a VPS, so compare current terms directly if cost is decisive.

Review security after deployment

Once the instance is running, use n8n’s security audit and review its findings. The audit can identify credential and database-query risks, file-system interactions, risky community or custom nodes, unprotected webhooks, missing security settings, and outdated instances. See the n8n security audit documentation for how to run and interpret it. Keep access to environment secrets restricted and retain the persistent data volumes as part of your operating plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.