Self-Hosting n8n on a Zenbyte Cloud VPS
This guide explains how to self-host n8n on a Cloud VPS. The setup uses:
-
Caddy as a reverse proxy to expose n8n securely to the internet
-
Docker Compose to define and run all required services
This approach is suitable for users who want full control over their n8n environment on their own VPS.
Prerequisites & Required Knowledge
Self-hosting n8n requires solid technical knowledge, including:
-
Linux server administration
-
Docker and Docker Compose
-
Resource management and scaling
-
Securing servers and web applications
-
Configuring and maintaining n8n
Stable and Beta Versions
n8n releases new versions frequently:
-
Stable version – recommended for production use
-
Beta version – contains the latest features but may be unstable
Use the stable version for live environments. Issues with beta versions should be reported via the official n8n community forum.
Create a Cloud VPS
-
Log in to your VPS control panel
-
Create a new Cloud VPS or select an existing project
-
Choose a Linux distribution that supports Docker (Ubuntu LTS is recommended)
-
If available, select a Docker-enabled image
VPS Size
For most use cases, an entry-level or mid-range Cloud VPS with sufficient CPU and memory is adequate. n8n scales well, but heavier workflows require more resources.
Authentication
Use SSH key authentication instead of password login for better security.
This guide assumes SSH access is enabled.
Log in to the Server
Connect to your VPS using SSH from a terminal:
Install Docker Compose
If Docker Compose is not installed, update the system and install it:
Verify installation:
Clone the Configuration Repository
This setup uses a ready-made Docker Compose configuration for n8n and Caddy.
Clone the repository:
Default Folders and Files
The configuration includes two important folders that will be mounted into Docker containers:
-
caddy_config – contains the Caddy configuration
-
local_files – stores files uploaded or generated by n8n
These ensure data persists outside the containers.
Create Docker Volumes
Create a volume for Caddy data (TLS certificates, cache):
Create a volume for n8n data:
Set Up DNS
n8n typically runs on a subdomain, for example:
Create an A record with your DNS provider that points the subdomain to your VPS IP address.
Open Required Ports
n8n is accessed via HTTP and HTTPS. Make sure the firewall allows:
-
Port 80 (HTTP)
-
Port 443 (HTTPS)
If using UFW:
Configure n8n Environment Variables
n8n uses environment variables defined in the .env file.
Open the file:
Replace the placeholder values with your own configuration.
Inline comments explain each variable.
For a complete list of available options, refer to the official n8n Environment Variables documentation.
Docker Compose Configuration
The docker-compose.yml file defines two services:
-
Caddy
-
Exposes ports 80 and 443
-
Manages HTTPS certificates automatically
-
-
n8n
-
Runs the n8n application
-
Uses environment variables from
.env -
Stores data in persistent volumes
-
You normally do not need to edit this file, but you can review it:
Configure Caddy
Edit the Caddy configuration file:
Replace the placeholder domain with your own subdomain:
This tells Caddy to forward incoming traffic to the n8n container.
Start n8n and Caddy
Start the services:
Initial startup may take a few minutes, especially while SSL certificates are issued.
Test the Installation
Open your browser and go to:
Log in using the credentials defined in the .env file.
If everything is configured correctly, the n8n interface will load.
Stop the Services
To stop n8n and Caddy:
Updating n8n
To update n8n when using Docker Compose:
Final Notes
-
Always back up your n8n data before upgrading
-
Monitor server resources for growing workflows
-
Secure your VPS properly (firewall, SSH hardening, updates)
This setup gives you full control over your n8n environment on your Zenbyte Cloud VPS.