Cloudways Install

I contacted Cloudways support and they directly said it was not possible, they dont allow it :-(.
You cannot install a linux server with direct or root access or something like that.

Would love to know how others have done it because i have a server there that’s super underutilized it would be ideal.

If that was not an option i was recommended contabo.com

@jay377 It sounds like this guy got it working!
You can read his workaround here - Create environment with access to n8n self host - #3 by Anderson_Rogerio_Gab

He said he did this —

I installed with ‘npm install n8n’ without -g because I’m hosting on Cloudways and it not possible install globally."

Yep i read that post myself (have no idea what it actually means, he doesn’t explain what he did in detail, the whole process, do you know what means?) so I assumed it was possible, then asked cloudways and they said no. So i dont know what to think? Can you figure it out and if you do let me know, that would be appreciated. I am not technical so i probably wont be able to figure it out if cloudways doesn’t assist me which they say they cant but maybe there is a loophole somewhere.

Ill hold off on ordering the VPS for a while to see if this is possible…

Edit, what I think he mght have done i installed a PHP application which is one option on cloudways and then used SSH access to access the server and run commands to do the rest? Anybody have any ideas? I messaged him to ask.

image

Yes - that is exactly what he did (to my understanding)

And the other change he did was ‘npm install n8n’ without -g because I’m hosting on Cloudways and it not possible install globally…

So, just SSH in the directory of your app and give it try :slight_smile:

As the cloudways support agent told you " You cannot install a linux server with direct or root access or something like that."

You don’t need root access to install without the -g …

Ok awesome I will give it a try (or get somebody that knows what they are doing to try it for me) thanks!

Amazing! please keep me posted how or if is works out :slight_smile:
I want to do the same.

Hi there,
Exactly, I have a application in PHP, for this work there are some settings, here we go:

In .htaccess file:

# Redirect traffic to your port 5678
DirectoryIndex
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)?$ http://127.0.0.1:5678/$1 [P,L]

Access your server by SSH, so you run npm install n8n
To run you should use the command: $(npm bin)/n8n start
I use the pm2 npm install pm2
I have a file called n8n.sh
So I run $(npm/bin)/pm2 start n8n

Example the file n8n.sh

export N8N_PROTOCOL=https
export N8N_HOST=YOUR_DOMAIN
export N8N_PORT=5678

export N8N_BASIC_AUTH_ACTIVE=true
export N8N_BASIC_AUTH_USER=USERNAME_CONFIG_HERE
export N8N_BASIC_AUTH_PASSWORD=PASSWORD_CONFIG_HERE

export DB_TYPE=mariadb
export DB_MYSQLDB_DATABASE=DATABASE_NAME
export DB_MYSQLDB_HOST=localhost
export DB_MYSQLDB_PORT=3306
export DB_MYSQLDB_USER=DATABASE_USER
export DB_MYSQLDB_PASSWORD=DATABASE_PASSWORD

$(npm bin)/n8n start

I think so, that’s all.
If you would need help, send me a message.
Thanks

2 Likes

Awesome thank you! If I wanted to could I install this on a subdomain and still have the main www and root hosting something else? What would the difference in my setup be then? Appreciate it.

Nice.
Yes you can do this.
It’s necessary setting DNS, and in your application there is "DOMAIN MANAGEMENT’, add your subdomain there. So you can setting the DNS appoint to ip of your application.
This video: How to Manage Your Domain DNS Records | Cloudways - YouTube maybe help you with this task.

And n8n.sh in line about N8N_HOST you put your subdomain, like this:
export N8N_HOST=n8n.meusite.com

Hi all,

I wanted to update you on the success of installing n8n on cloudways, its working now.

It was quite a nightmare to get resolved. I had a technical person assist me but there were many issues and needed multiple support requests with cloudways to assist.

I wanted to thank everybody who assisted here and especially Anderson_Rogerio_Gab who has assisted me over PM about this alot as well.

I want to give some info here for others that want to do this install successfully and the problems that may need to be addressed

So the basic process is like so:

  1. You need to install a basic php application on cloudways to get started with.

  2. You then need to upgrade Node and and NPM on the new application instance itself, not on your main master credentials. Ask support to do this for you, upgrade to latest versions.

  3. You then need to try install n8n with ‘npm install n8n’ without -g because cloudways does not provide root access or the correct permissions for some things.

But the install wont work because it needs to create 2 folders in your application root and even your cloudways master credentials dont allow that level of access.

So you need to get support to create 2 directories (.n8n and .pm2) for you here:

/applications/YOURAPPLICATIONDIR/.N8N
/applications/YOURAPPLICATIONDIR/.pm2

Then support needs to give permissions to the credentials of that application instance to access or execute files in those directories (i think they did that at least)

Once that is done you can actually install n8n with ‘npm install n8n’ successfully. But then there is more:

  1. Here is a good resource on how to install a node app on cloudways: How to host a nodejs app on Cloudways - The Cloud Keeper

Basically you cannot access certain ports on cloudways so the solution is that you need to reroute the traffic from default port (i.e from 80 or 443) to port on which your app is running (5678 for n8n) using Apache mod_proxy module.

So your htaccess looks like this:

DirectoryIndex
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)?$ http://127.0.0.1:5678/$1 [P,L]

The problem is cloudways does not have have the Apache mod_proxy module enabled so you need to get support to enable it for you, then it will work.

So I think that is all the important factors. It seems like n8n runs now but I need to still use it and see if there are any problems in operation. If there is any way to test this the fastest please let me know.

It is awesome that I can now use my existing wordpress website hosting server which is grossly underutilised to host n8n as well instead of needing to pay for a new server.

Note: Everybody should be hosting with cloudways anyways (vultr high frequency or DO) because the website speed/performance is amazing, the support is instant and incredible and the price is great :-).

Let me know if you have any questions.

4 Likes

@jay377 Amazing work! and thanks for following up on this!
I am going to give it a try : )

Did you need to SSH to the root user to install n8n or did you use the login from the PHP app?

Just use the php user, there are a few guides out there for installing npm apps along side a php instance if it helps.

What do you mean "php user?

There was no php login or app as far as I known, it was just a homepage with links to guides, its like an empty php shell, though i dont know anything about this stuff so not sure.

The only reason you setup a php app is because it generates a debian install with a tech stack you need, you never do anything with php after the app is created.

Then you need to create new application credentials for that application for everything you do in SSH, not use your master server credentials, then my process works. I did some stuff like upgrade node with my master and then support had to redo it with the app credentials because the stuff i did on master didnt effect the app.

Hope that makes sense.

2 Likes

I would have thought the master account would have worked for a lot of it for the application user.

That cloud keepers sure has another article where they talk about updating and installing pm2 using the master account.

Could be worth setting up a clean instance and running through it again to see if anything was missed or didn’t run properly.

Handy guide for those using Cloudways though.

Yeah I have no idea. The only reason I used the app credentials was because i didnt want a fiverr freelancer who was helping me do the installation to have access to all my sites, just in case something got broken and affected my other stuff.

I have never really trusted anything on Fiverr, I wouldn’t let any of them access a server but at least you can run the history command and see what they have done.

Just make sure you check the ssh keys and change passwords :slightly_smiling_face:

1 Like

Yeah I hear you, always re-secure stuff after and thats why i wasnt willing to give out master creds.

Usually i try and do everything myself but as a solo founder these days your really cant do everything yourself if you want quality, so I sometimes invest hours and hours researching freelancers on fiverr for certain things because you can get great deals and great quality there, and you have the feedback to filter out the shit, and the search functions are much better these days to filter further to see only the top talent. Its much better these days then even a little while back and prices vs quality are way better then upwork for certain things.
Anyway getting off topic haha

2 Likes

please guys i followed the guide , but now im getting connection list in the us because it can’t connect with the websockt do i need to add something to the htaccess ?

Hey @Mehdi_YAHIA_CHERIF,

This post is 2 years old now, Can you open a new one and include what you have done and what the error is?