I found some posts on the n8n community talking about the installation of n8n on Cpanel using node js so anyone has done it successfully? please yes if tell me how to do
Hey @Kanhaiya_Lal_Bohra, welcome to the community!
Afaik, cpanel doesn’t have any support for managing generic npm applications or docker containers. Meaning you would have to manually install n8n alongside cpanel on your server.
Hi!
I’m using n8n in my shared hosting with cPanel. II talked to the hosting tech support (LucusHost, a very good Spanish hosting) to see if I could install it on their “NodeJS” plan and their elastic hosting, and they solved it without any problem.
This is the configuration I have in my cPanel if this help you:
They told me that if more people needed it, just send them a ticket to support to install it.
And on top of that they gave me a discount coupon! ![]()
Hey guys! I know it’s been a super long time, but I just stumbled upon this thread, and I am also running n8n on a shared hosting (not cPanel, but very similar, it uses PassengerPhusion to manage node apps just like cPanel).
My setup is very similar to yours, but I switched “App root” and “Startup file”.
Just letting that here in case it can serve somebody in the future!
Steps :
- Create domain and relevant DNS config from xPanel
- Create new node app from xPanel :
a. Select domain
b. Select working directory for the app files
c. Startup file :node_modules/n8n/bin/n8n - Run
npm init && npm install n8ninside the working directory (or create/updatepackage.jsonwithn8nas dependency and run install command from the UI) - Run the app
- Enjoy!
I am also chiming in to contribute. I just solved this myself on a CloudLinux WHM/cPanel server.
The method I used was to use the CloudLinux Manager’s NodeJS selector tool to make the Node App Setup module available on my cPanel accounts, and then I installed N8N via cPanel Terminal. My method presupposes you have terminal access on the cPanel account. Have your host do this for you if you are on shared CloudLinux hosting or a VPS where you don’t have root level access.
Then, the process I followed was thus, building off of what lolcabanon said:
- Set up cPanel account with Shell Access enabled (terminal).
- Let AutoSSL run.
- Setup Node app in cPanel. Only input node version and application mode as development and then hit create, don’t add anything else or set application paths yet. The default startup file will be app.js. We’ll change this later. Copy the node virtual environment entry command from the top of the app page after creating the app.
- Go to cPanel terminal and paste this in. You’ll now have node environment access and be in the application folder.
- Initialize NPM with “npm init -y”
- Install N8N, this will take a while and might require some fussing with dependencie, etc, or running the command multiple times if the terminal times out. - “npm install n8n”
- After installing n8n, return to the node application page in cPanel. Change the application startup file to: “node_modules/n8n/bin/n8n”
- Then, Set environment variables in the node app, including webhook destination like such:
- N8N_BASIC_AUTH_ACTIVE - true
- N8N_BASIC_AUTH_USER - [username]
- N8N_BASIC_AUTH_PASSWORD - [password]
- N8N_HOST - set to 0.0.0.0
- WEBHOOK_URL - [https://your-installation-domain.com]
- Other Environment variables might be good to configure like max execution runtime (default 60 mins), saving execution data only on error to save disk space, etc. by default, it auto deletes executions after a couple weeks in a rolling window. Otherwise, everything else is good.
- Set environment to production.
- Open the domain and create an owner account for the N8N installation, these are the login credentials.
- Register community license if desired for the additional features.
- To keep N8N automatically up to date, you will create a workflow that uses the execute code module to run a shell script. Write that yourself or have ChatGPT assist. Then, set it to run the check every 24 hours. Update NodeJS version in cPanel every year or so to ensure you stay within the supported node versions.
Cheers.
You can also manually update N8N by navigating to the app folder directory in the terminal (displayed in the node app setup page) and running:
npm update n8n
Then, restart the node app.
Hello @MattH , I installed n8n on cPanel following your tips, but I have a problem and I have no idea how to solve it.
Every day when I access the URL of my installation for the first time, I get the following message:
“n8n is starting up. Please wait”
I don’t know if it has something to do with my cPanel server when it does a daily backup. I have the impression that this always happens when “the day changes”, my hosting runs other things besides n8n and a general backup is always done at 11 pm.
Is there any configuration that needs to be done to prevent this from happening, or to make n8n start up again by itself as a node app?
good morning,
I installed an n8n instance under node.js in Cpanel following your advice.
Everything went well.
Unfortunately, I can’t install community nodes. I get this message
Thanks
Hi
I’m new in n8n, and i need to hosting n8n in Cpanel.
I follow the steps, the 16 step, i do not understand this step, can help?
www.mydomain/n8n i have the msg:
" It works!"
nodeJS 14.21.2
Hi
First tell your hosting provider to update the Nodejs Minimum version Node 18.17.0.
Second on cpanel set Application startup file to node_modules/n8n/bin/n8n instead of app.js
And Last on Enviroment Variables add N8N_PORT 5678
Best regards
Hi, Try this manual for install n8n at Cpanel.
Environment variables:
N8N_BASIC_AUTH_ACTIVE true
N8N_BASIC_AUTH_PASSWORD [password]
N8N_BASIC_AUTH_USER [username]
N8N_HOST localhost
N8N_LOG_LEVEL debug
N8N_PORT 5678
N8N_PROTOCOL https
N8N_PUSH_BACKEND websocket
QUEUE_HEALTH_CHECK_ACTIVE true
VUE_APP_URL_BASE_API https://mysite.com/
WEBHOOK_URL https://mysite.com/
n8n Version 1.100.1 show error - Problem running workflow. Lost connection to the server.
#[details=“instance information”]
Debug info
core
- n8nVersion: 1.100.1
- platform: npm
- nodeJsVersion: 22.16.0
- database: sqlite
- executionMode: regular
- concurrency: -1
- license: enterprise (production)
storage
- success: all
- error: all
- progress: false
- manual: true
- binaryMode: memory
pruning
- enabled: true
- maxAge: 336 hours
- maxCount: 10000 executions
client
- userAgent: mozilla/5.0 (windows nt 10.0; win64; x64; rv:140.0) gecko/20100101 firefox/140.0
- isTouchDevice: false
Generated at: 2025-07-03T17:01:54.988Z}
[/details]
Thanks
I had successfull install n8n on cpanel but using npm global at SSH terminal, I run n8n with pm2 to keep running and setup .htaccess so it can run with port 80.
But the problem is after login and start create new workflow at toolbar info “Connection Lost”. like this
![]()
Information on my n8n setup
- n8n version: ? 1.102.4
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): pm2
- Running n8n via (Docker, npm, n8n cloud, desktop app): npm in cpanel
- Operating system: Linux hosted on cpanel 4.18.0-553.27.1.lve.1.el8.x86_64
setup file ecosystem.config.js for pm2
module.exports = {
apps : [{
name : "n8n",
script : "/home/pelitafa/agenai.host.com/node_modules/n8n/bin/n8n",
args : "start",
node_args: "--max-old-space-size=2048",
env: {
"N8N_HOST" : "localhost",
"N8N_PROTOCOL": "https",
"N8N_DIAGNOSTICS_ENABLED": "false",
"N8N_VERSION_NOTIFICATIONS_ENABLED": "false",
"EXTERNAL_FRONTEND_HOOKS_URLS": "",
"N8N_DIAGNOSTICS_CONFIG_FRONTEND": "",
"N8N_DIAGNOSTICS_CONFIG_BACKEND":"",
"N8N_ONBOARDING_FLOW_DISABLED": "true",
"N8N_PUBLIC_URL": "https://agenai.host.com",
"N8N_RUNNERS_ENABLED": "true",
"N8N_PUSH_BACKEND": "websocket",
"WEBHOOK_URL": "https://agenai.host.com",
}
}]
}
What you should suggest?
Thanks
I fixed the issue by adding a rule to set the “Origin” header for each HTTP request on the Apache (Passenger) web server.
Specifically, I added the following rules to the file /home/mysite/public_html/.htaccess:
SetEnvIf Host "^" ORIGIN=https://n8n.mysite.com
RequestHeader set Origin %{ORIGIN}e
Additionally, I also added CORS settings in the Nginx virtual host configuration.
Hi bro,
My hosting provider doesn’t provide 18.17.0 version so i have selected 18.20.8 now when i visit my domain it shows 503 error any solution?
I really appreciate your documentation and efforts. However, could you please guide us step-by-step on how to install n8n on cPanel, including the exact commands to use? I’m new to n8n and would greatly appreciate a detailed walkthrough.
Here are my cPanel specifications:
-
Node.js support: up to v24.6.0
-
Web server: LiteSpeed
-
PHP version: up to 8.2
Hi! Could you solve the 503 issue?
did you fixed it?
Hi. yes. in /etc/nginx/conf.d/users/startup/startup.site.com/proxy.conf
Add next configuration
proxy_http_version 1.1;
# WebSocket headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Standard headers
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 X-Forwarded-Proto $scheme;
# Important for SSE/WebSocket
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 3600s;
proxy_connect_timeout 3600s;
proxy_send_timeout 3600s;





