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 n8n
inside the working directory (or create/updatepackage.json
withn8n
as 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.