
In this guide, I’ll cover two ways to install n8n on a VPS:
-
A manual setup for developers who prefer granular control
-
A Coolify-based deployment for a modern, self-hosted platform-as-a-service (PaaS)
-
Plus: how to configure a custom domain with HTTPS for both methods
You can watch my video tutorial on YouTube.
Option 1: Manual Installation of n8n on Contabo VPS
This approach is ideal if you want full control over your infrastructure.
Prerequisites
-
Ubuntu or Debian-based server. I’ll be using Contabo VPS.
-
Root or sudo access
-
A domain name (e.g., n8n.yourdomain.com)
-
Node.js v18 and npm
Step 1: Buy a VPS and a Domain
I’ll be using Contabo VPS and Namecheap domain.
If you don’t know how to setup Contabo VPS, check out this tutorial.
Step 2: Connect to Your Server
Use a free SSH client to connect to your server. I’ll be using Bitvise.
Step 3: Update Your Server
sudo apt update && sudo apt upgrade -y
Step 4: Install Node.js and npm
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash - sudo apt install -y nodejs
Step 5: Install n8n Globally
sudo npm install -g n8n
Step 6: Create a Dedicated User (Optional)
sudo adduser --disabled-password --gecos "" n8n sudo su - n8n
Step 7: Run n8n Locally
n8n
Step 8: Use PM2 for Process Management
npm install -g pm2 pm2 start n8n pm2 save pm2 startup
Step 9: Set Environment Variables
You can set these in .bashrc or an .env file.
export N8N_BASIC_AUTH_ACTIVE=true export N8N_BASIC_AUTH_USER=yourusername export N8N_BASIC_AUTH_PASSWORD=yourpassword export N8N_HOST=n8n.yourdomain.com export N8N_PORT=5678 export WEBHOOK_URL=https://n8n.yourdomain.com/
Reload your shell:
source ~/.bashrc
Step 10: Point Your Domain to the Server
In your DNS provider’s dashboard (e.g., Namecheap, Cloudflare):
- Create an A record:
- Host: n8n
- Points to: Your server’s IP
- TTL: Automatic or 30 minutes
Step 11: Configure Nginx Reverse Proxy + HTTPS
sudo apt install nginx certbot python3-certbot-nginx -y
Install Nginx and Certbot:
sudo apt install nginx certbot python3-certbot-nginx -y
Create Nginx config file:
sudo nano /etc/nginx/sites-available/n8n
Paste in:
server {
listen 80;
server_name n8n.yourdomain.com;
location / {
proxy_pass http://localhost:5678;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_http_version 1.1;
}
}
Enable and test:
sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl reload nginx
Set up HTTPS:
sudo certbot --nginx -d n8n.yourdomain.com
That’s it! Now your n8n is available at https://n8n.yourdomain.com.
Option 2: Deploying n8n with Coolify
What is Coolify?
Coolify is an open-source PaaS that makes it easy to self-host apps with Docker under the hood—but you don’t have to touch Docker directly.
What You’ll Love About Coolify
-
Visual dashboard
-
Built-in HTTPS
-
Automatic reverse proxy
-
No YAML or Docker commands needed
-
1-click app templates
Step 1: Set Up Your VPS and Install Docker
You can still use Contabo with this setup.
sudo apt update && sudo apt upgrade -y
Step 2: Install Coolify
Run the Coolify setup script:
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
Visit http://your-server-ip:8000 to set up your admin account.
Step 3: Access Coolify Dashboard
Open http://your-server-ip:8000 in your browser.
Create an admin account when prompted.
You can also follow this guide for installing Coolify step-by-step, including accessing it with a domain.
Step 4: Add Your Domain
In your domain registrar:
- Create an A record:
- Host: n8n
- Points to: Your server’s IP
- TTL: Automatic or 30 minutes
If using Cloudflare, make sure proxy is off (DNS only) during setup.
Step 5: Deploy n8n
In this part, we will install n8n.
Then search for n8n.
Go to Configuration > General.
Under Services, click Settings.
Add your domain and click Deploy. If you have a lot of services running on Coolify, you can add a Name for you n8n.
Now your n8n is running.
Visit your domain to access your newly installed n8n.
Manual vs. Coolify Quick Install
| Feature | Manual Setup | Coolify Quick Install |
|---|---|---|
| 🔧 Full Control | ✅ Yes | ✅ Docker-managed |
| 🖥️ Web Interface | ❌ CLI only | ✅ Beautiful dashboard |
| ☁️ App Templates | ❌ None | ✅ Yes (n8n built-in) |
| 🔐 HTTPS & Auth | ❌ Manual setup | ✅ Automatic with UI |
| 💻 Technical Skill Needed | 🧠 High | 🧠 Low–Medium |
| 🛠️ Process Management | ✅ PM2/Manual | ✅ Built-in |
Final Thoughts
Both installation paths lead to the same powerful n8n experience, but your choice depends on how hands-on you want to be:
-
Choose manual setup if you want full control and don’t mind managing processes and Nginx.
-
Choose Coolify Quick Install if you want speed, simplicity, and a modern web dashboard with SSL baked in.









