1. Install n8n
Run once to check:
2. Set Up pm2 Process Manager
Install pm2 if not already installed:
3. Create n8n Config Directory
4. Create Ecosystem Config for pm2
Create the file:
Paste this:
5. Start n8n with pm2
Check running processes:
Check environment variables:
👉 You should see WEBHOOK_URL
and N8N_EDITOR_BASE_URL
.
6. Configure LiteSpeed for WebSockets
Since n8n relies on WebSockets, configure LiteSpeed:
-
Virtual Host → Web Socket Proxy → Add
-
URI:
/
-
Address:
127.0.0.1:5678
-
-
Proxy Context → Header Operations (add):
-
Disable response buffering.
-
Restart LiteSpeed.
7. Webhook URLs
-
n8n generates two webhook URLs:
-
Test URL → works only when editor is open.
-
Production URL → works when workflow is activated.
-
Example:
👉 Always activate workflows (toggle ON) to use production webhooks.
8. Branding (Optional)
Add to .env
or ecosystem env
block:
Restart pm2 after changes:
9. Useful Commands
-
Restart n8n:
-
Stop n8n:
-
View logs:
✅ Summary
-
Installed n8n with npm.
-
Used pm2 +
ecosystem.config.js
to manage and persist environment variables. -
Configured LiteSpeed WebSocket proxy for stable workflow execution.
-
Set
WEBHOOK_URL
andN8N_EDITOR_BASE_URL
so webhooks show the correct public domain. -
Optional branding applied with env variables