If you’ve ever wanted to host your own automation powerhouse like Zapier, you’ll love this guide.
In this tutorial, we’ll walk through installing n8n — the free and open-source workflow automation tool — on a VPS server using aaPanel, along with a ready-to-run installation script.
You’ll get everything you need:
✅ Install aaPanel
✅ Set up Node.js, PM2, and n8n
✅ Secure your instance with SSL (HTTPS)
✅ Access n8n via your domain
✅ Fix common setup errors
⚙️ What You’ll Need
-
A VPS server (I recommend Hostinger VPS Hosting)
-
A domain (example:
n8n.yourdomain.com
) -
Basic Linux terminal knowledge
-
Root SSH access
🧩 Step 1: Connect to Your VPS
Login to your VPS using SSH:
If you’re using Hostinger, you’ll find your IP and login credentials inside your VPS dashboard.
🖥️ Step 2: Install aaPanel
aaPanel is a free, user-friendly server management panel that makes it easy to handle web apps, databases, and security settings.
Run this single command to install aaPanel:
Once installed, you’ll get a login URL and credentials in the terminal — copy and save them.
Example:
🌐 Step 3: Add Your Domain & Set Up Environment
-
Log in to aaPanel.
-
Go to Website > Add Site.
-
Add your domain (e.g.,
n8n.yourdomain.com
) and select:-
PHP Version: None
-
Create FTP / Database: No
-
-
It will create a default directory like:
⚡ Step 4: Run the Ready-to-Use n8n Installation Script
Now it’s time to install Node.js, PM2, and n8n in one go.
Copy and paste this entire script below into your terminal:
💡 Tip: Replace
n8n.yourdomain.com
in the script with your actual domain before running.
Save and run the script:
🔒 Step 5: Secure Your n8n Instance with SSL (HTTPS)
-
In aaPanel, go to Website → n8n.yourdomain.com → SSL
-
Choose Let’s Encrypt
-
Add your email and issue the certificate
aaPanel will automatically configure your site to use HTTPS.
After that, your n8n instance will be available at:
🧭 Step 6: Access the n8n Dashboard
Visit your URL in the browser:
You’ll see the n8n editor interface — ready for building automation workflows.
To keep n8n running permanently, PM2 handles process restarts even after reboot.
🧰 Troubleshooting Common Errors
❌ Error: Port 5678 Already in Use
Run:
⚠️ Error: Can’t Access via Domain
-
Check your domain DNS points to your VPS IP.
-
Verify SSL certificate is active in aaPanel.
-
Confirm firewall allows port 80 & 443.
🔁 n8n Not Starting on Reboot
Run:
🚀 Bonus: Auto Start Script on Reboot
Add this to your crontab:
Then add the line:
🎉 Done!
You’ve successfully installed n8n on your VPS server using aaPanel, complete with HTTPS security, domain access, and auto restart with PM2.
Now you can start building automations — from WhatsApp bots to Google Sheets workflows — without relying on paid services.