N8n on cpanel

Hi dear @jan

I have Cpanel shared host
It has features that I can create node.js webapplications.

I try to install n8n on it via its virtual environment (like SSH) but it show below error.
Could you please help me?

Best regards;

/home/.../nodevenv/.../.../lib/bin/n8n -> /home/.../nodevenv/.../.../lib/lib/node_modules/n8n/bin/n8n
npm WARN lifecycle The node binary used for scripts is /home/.../nodevenv/.../.../bin/node but npm is using /opt/alt/alt-nodejs10/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] install /home/.../nodevenv/.../.../lib/lib/node_modules/n8n/node_modules/mmmagic
> node-gyp rebuild

 make: Entering directory `/home/.../nodevenv/.../.../lib/lib/node_modules/n8n/node_modules/mmmagic/build'
  CC(target) Release/obj.target/libmagic/deps/libmagic/src/apprentice.o
make: execvp: cc: Permission denied
make: *** [Release/obj.target/libmagic/deps/libmagic/src/apprentice.o] Error 127
make: Leaving directory `/home/.../nodevenv/.../.../lib/lib/node_modules/n8n/node_modules/mmmagic/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/build.js:193:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 2.6.32-954.3.5.lve1.4.63.el6.x86_64
gyp ERR! command "/opt/alt/alt-nodejs10/root/usr/bin/node" "/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/.../nodevenv/.../.../lib/lib/node_modules/n8n/node_modules/mmmagic
gyp ERR! node -v v10.17.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/...

Sorry no experience with cpanel and how they set up the environment and how Node.js runs in it.

The first line however:

/home/.../nodevenv/.../.../lib/bin/n8n -> /home/.../nodevenv/.../.../lib/lib/node_modules/n8n/bin/n8n
npm WARN lifecycle The node binary used for scripts is /home/.../nodevenv/.../.../bin/node but npm is using /opt/alt/alt-nodejs10/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

Sounds like there is probably something wrong.

So maybe something like that:

1 Like

Hey mooghermez,
Plesk is kinda similar to cpanel. I created a doc on installing on Plesk, maybe it helps you:
https://github.com/n8n-io/n8n/issues/9#issuecomment-522746909

3 Likes

Thank you my frind
I try to install n8n according to your doc but unfortunately I see below error:

npm WARN lifecycle The node binary used for scripts is /home/mydir/nodevenv/n8n.mysite.com/10/bin/node but npm is using /opt/alt/alt-nodejs10/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] install /home/mydir/nodevenv/n8n.mysite.com/10/lib/node_modules/mmmagic
> node-gyp rebuild

node[435392]: pthread_create: Resource temporarily unavailable
gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/configure.js:344:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
1 Like

It’s a very old version, too. Try nodejs v12

Hi, please look into this. I have tried to setup n8n on cPanel, but not able to do so due to this error. Or it will be great if you can share simple steps to follow for the same. The steps in the documentation do not work without error. Thanks

Have tried with Node 12.x too, but it does not work.

I had to install build essential on debian for mmmagic to work. Also check if --unsafe-perm flag (npm i -g n8n --unsafe-perm) works for you

1 Like

I got an error when installing an additional module on the docker image (Alpine Linux)

Resolution

apk --no-cache --virtual build-dependencies add
python
make
g++
&& npm i -g n8n-nodes-YOURMODULE --unsafe-perm
&& apk del build-dependencies

replace n8n-nodes-YOURMODULE with the module you want to install

I managed to install n8n on cpanel, node.js 14.x, but don’t know what startup file to use in the node.js app to open it… anybody managed to successfully install and use n8n on cpanel hosting ?

Hi,
I haven’t done it recently. Try finding n8n file in node_modules/n8n/bin, that should be the startup file. As cpanel is quite similar to plesk you might find help here:
https://github.com/n8n-io/n8n/issues/9

1 Like

Hi,

I’m trying too to install n8n via cPanel, but I don’t know what type on the “Application root” field (I can’t download files for n8n server and I don’t have the link to a repository). And same thing for “Application startup file”.

Can someone help me please ?

Hey guys! I know it’s been a super long time, but I just stumbled upon this thread, and I am running n8n on a shared hosting (not cPanel, but very similar, it uses PassengerPhusion to manage node apps just like cPanel).

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, any empty directory is good (“Application root”)
    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!
1 Like

I have installed n8n on my Cpanel server. How can I update it?

Hello,
I installed n8n on Cpanel with this configuration

When I connect to the server, I get a blank screen.
In the debug, I see that it doesn’t look for files in the right domain.
It looks in www.xxxx.fr instead of www.xxxx.fr/n8n as defined in the Cpanel.

If I go directly to the 3rd file (semtry.js) file with the correct url https://xxxx.fr/n8n/semtry.js it finds it fine.

I suppose it’s a configuration problem, but I can’t find out which one.

Thanks for your help.

I find the solution !!!
just creat Ă  sub domaine like n8n.mydomaine.com and select it in the application URL. And call the application with https://n8n.mydomaine.com

I get so many errors and then crash when trying to install n8n with npm install n8n on Node.js version 22.14.0, but always different errors trying different versions of Node.js

npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @n8n/[email protected]
npm warn Found: [email protected]
npm warn node_modules/@n8n/n8n-nodes-langchain/node_modules/mongodb
npm warn mongodb@“6.11.0” from @n8n/[email protected]
npm warn node_modules/@n8n/n8n-nodes-langchain
npm warn @n8n/n8n-nodes-langchain@“1.93.0” from [email protected]
npm warn node_modules/n8n
npm warn 1 more (@langchain/community)
npm warn
npm warn Could not resolve dependency:
npm warn peerOptional mongodb@“^5.8.0” from @n8n/[email protected]
npm warn node_modules/@n8n/n8n-nodes-langchain/node_modules/@n8n/typeorm
npm warn @n8n/typeorm@“0.3.20-12” from @n8n/[email protected]
npm warn node_modules/@n8n/n8n-nodes-langchain
npm warn
npm warn Conflicting peer dependency: [email protected]
npm warn node_modules/mongodb
npm warn peerOptional mongodb@“^5.8.0” from @n8n/[email protected]
npm warn node_modules/@n8n/n8n-nodes-langchain/node_modules/@n8n/typeorm
npm warn @n8n/typeorm@“0.3.20-12” from @n8n/[email protected]
npm warn node_modules/@n8n/n8n-nodes-langchain
â ŹKilled

1 Like

Am running Node.js v20.19.0 quite smooth tbh, btw I think the support for npm is being limited soon, and would push toward dockers or k8s if you can.

Best regards,

Samuel

1 Like

Probably be easier too. that’s how I installed it locally, but now I want to try to run it on my channel and don’t want to pay hostinger for another hosting plan just for this, although they do docker too. Now to see if there’s a way to install docker on my cpanel :grinning:

1 Like

hi/Ola

You have some steps that you follow, that you can share?