Install n8n on cPanel
Install n8n on cPanel- If you are looking to automate workflows and supercharge your productivity, n8n is a fantastic open-source automation tool you should try. This comprehensive tutorial will walk you through installing n8n on your shared cPanel hosting account and getting it running smoothly with SSL support using a dedicated subdomain.
What is n8n?
n8n is an advanced workflow automation tool that lets you visually build complex workflows by integrating hundreds of apps and APIs without writing code. It’s a self-hosted alternative to Zapier that gives you full control over your data and workflows.
Prerequisites
Before you start, ensure you have:
- cPanel shared hosting account with Node.js support (minimum Node.js 20.17.0)
- Access to Terminal (Shell) via cPanel
- AutoSSL or valid SSL certificates enabled
- Basic knowledge of cPanel interface
Step 1: Create a Subdomain
We’ll set up a dedicated subdomain for n8n, e.g., n8n.yourdomain.com to avoid conflicts with your main website.
- Log in to your cPanel dashboard
- Navigate to Domains → Subdomains
- Enter
n8nas the subdomain - Select your main domain
- Document root will automatically populate – leave it as is
- Click Create
- Wait 10-15 minutes for DNS propagation
Step 2: Enable SSL for Your Subdomain
To secure your n8n instance:
- Go to Security → SSL/TLS Status in cPanel
- Find and select your new subdomain
n8n.yourdomain.com - Click Run AutoSSL
- Wait a few minutes for SSL to be issued
Step 3: Set Up Node.js Application
- Navigate to Software → Setup Node.js App in cPanel
- Click Create Application
- Choose Node.js version 20.x or above
- Set Application mode to Development (change later to Production)
- Application root set to your subdomain document root (e.g.,
n8n) - Application URL should show your subdomain
- Startup file defaults to
app.js– we’ll change this - Click Create
- Copy the environment activation command shown
Step 4: Install n8n Using Terminal
- Open Terminal from cPanel
- Paste the environment activation command copied in the previous step
- Confirm you are inside the application directory
- Initialize the project:
npm init -y - Install n8n:
npm install n8nIt may take several minutes. Retry if it times out - Confirm:
node_modules/n8n/bin/n8nexists
Step 5: Configure Application Settings
- Return to Node.js app settings
- Change Startup file to:
node_modules/n8n/bin/n8n - Set Application mode to Production
Step 6: Set Environment Variables
Add these critical variables
- N8N_BASIC_AUTH_ACTIVE:
true - N8N_BASIC_AUTH_USER:
[your_username] - N8N_BASIC_AUTH_PASSWORD:
[your_password] - N8N_HOST:
0.0.0.0 - N8N_PORT:
5678 - N8N_PROTOCOL:
https - N8N_PUSH_BACKEND:
websocket - VUE_APP_URL_BASE_API:
https://n8n.yourdomain.com/ - WEBHOOK_URL:
https://n8n.yourdomain.com - NODE_OPTIONS:
--max-old-space-size=512 - EXECUTIONS_DATA_SAVE_ON_ERROR:
none - EXECUTIONS_DATA_SAVE_ON_SUCCESS:
none
Step 7: Start the Application
- Click Restart or Start App in Node.js App
- Wait 2-3 minutes for it to fully start
- Access your instance at: text
https://n8n.yourdomain.com
You should see the login prompt. Use the credentials defined in environment variables.
Troubleshooting Common Issues
503 Service Unavailable Error
Ensure the app status is running
Verify the startup file is exactly node_modules/n8n/bin/n8n
Check all environment variables are correctly set
SSL Certificate Errors
Confirm AutoSSL is running and complete
Wait for DNS propagation (up to 24 hours)
Test DNS resolution using online tools
Installation Timeouts
Retry npm install n8n multiple timesn8n
Use the environment activation command before each retry
Try during off-peak hours for better performance
Node.js Version Warnings
Use Node.js 18.x or 20.x for best compatibility
Ignore EBADENGINE warnings – n8n will still function
Maintenance and Updates
To keep your n8n installation updated:
1. Access terminal with Node environment active
2. Run update command: bashnpm update n8n
3. Restart your Node.js application in cPanel
Limitations on Shared Hosting
Be aware of these shared hosting constraints:
- Memory limitations may restrict complex workflows
- Process timeouts can affect long-running operations
- WebSocket restrictions may impact real-time features
- Community nodes may not install due to compilation requirements