In the world of workflow automation, n8n stands out as a powerful, open-source alternative to Zapier. With no restrictions on workflows, full data privacy, and complete customization, it's no surprise developers and businesses are choosing to self-host n8n.
In this tutorial, we’ll show you how to install n8n on an Ubuntu server using Node.js (without Docker). Whether you’re deploying on a VPS or dedicated server (like those offered by Hostomy), this guide has everything you need.
Before diving into installation, here’s why self-hosting n8n makes sense:
Whether you're automating marketing tasks, syncing data between platforms, or building internal tools — self-hosted n8n on Ubuntu gives you power and flexibility.
Ensure you have the following:
sudo apt update && sudo apt upgrade -y
Use NodeSource to install the latest LTS version (v22.x):
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejs build-essential
Verify versions:
node -v npm -v
sudo npm install -g n8n
This will make the n8n
command available system-wide.
We’ll use environment variables to configure authentication, port, host, and webhook URL.
Create a .env
file in your home directory:
nano ~/.n8n.env
Paste the following (update values as needed):
N8N_PORT=5678 N8N_HOST=yourdomain.com WEBHOOK_URL=https://yourdomain.com/ N8N_BASIC_AUTH_ACTIVE=true N8N_BASIC_AUTH_USER=admin N8N_BASIC_AUTH_PASSWORD=strongpassword
We’ll use PM2 to keep n8n running in the background and auto-restart it on reboot.
sudo npm install -g pm2
Start n8n with environment file:
pm2 start n8n --env ~/.n8n.env --name n8n
PM2 will load the environment and run n8n in the background.
Save the process list and enable startup:
pm2 save pm2 startup
Follow the printed instructions to complete startup setup (usually copy-paste a sudo
command).
If you're not using a domain, access it via:
http://your_server_ip:5678
If you’re using a domain and want HTTPS, proceed to the next step.
At Hostomy, our blazing-fast SSD-based VPS servers are perfect for self-hosting tools like n8n. With full root access, instant deployment, and optimized Ubuntu stacks — your automation setup will be smooth and secure.Explore Hostomy VPS Hosting
You’ve now successfully installed and self-hosted n8n on Ubuntu using Node.js — with full control, no containers, and complete freedom.
Whether you're automating email parsing, syncing CRMs, or managing internal alerts — n8n gives you unlimited flexibility.
Host it your way. Host it with Hostomy.