How to install n8n on cpanel succesffuly

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! :slight_smile:

1 Like

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 :

  1. Create domain and relevant DNS config from xPanel
  2. 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
  3. Run npm init && npm install n8n inside the working directory (or create/update package.json with n8n as dependency and run install command from the UI)
  4. Run the app
  5. 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:

  1. Set up cPanel account with Shell Access enabled (terminal).
  2. Let AutoSSL run.
  3. 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.
  4. Go to cPanel terminal and paste this in. You’ll now have node environment access and be in the application folder.
  5. Initialize NPM with “npm init -y”
  6. 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”
  7. After installing n8n, return to the node application page in cPanel. Change the application startup file to: “node_modules/n8n/bin/n8n”
  8. Then, Set environment variables in the node app, including webhook destination like such:
  9. N8N_BASIC_AUTH_ACTIVE - true
  10. N8N_BASIC_AUTH_USER - [username]
  11. N8N_BASIC_AUTH_PASSWORD - [password]
  12. N8N_HOST - set to 0.0.0.0
  13. WEBHOOK_URL - [https://your-installation-domain.com]
  14. 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.
  15. Set environment to production.
  16. Open the domain and create an owner account for the N8N installation, these are the login credentials.
  17. Register community license if desired for the additional features.
  18. 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.