Cloudways Install

Hello,

I would like to test out the self host option. I use cloudways (4GB Vultr server) and was wondering how I would go about installing it there and if its possible or a good idea to do so.

I am looking at the instructions here but it’s all gibberish to me lol: Server Setup | Docs

In cloudways I can add application but then I see wordpress, woocomm, php, laravel, magento, thats all. Is the the PHP custom app option I need? I dont even see a linux option sigh…

Please could you point me in the right direction? Thanks!

Hi @jay377, welcome to the community :tada:

I am not familiar with custom apps on Cloudways but n8n would not be a PHP app (it’s a Node.js application, but this shouldn’t matter). So I suspect the option “PHP custom app” would not apply here. You might want to reach out to Cloudways and let them know n8n is something you’d be interested in, maybe they can point you in the right direction?

Of course, we also offer hosted instances ourselves at n8n.cloud.

As for self hosting, the link you have shared is the right one for an installation on Ubuntu Linux using Docker. As you have noticed though, this can be complicated if you are new to the shell.

So maybe our desktop app would be a suitable alternative for you?

Appreciated thanks. I am going to test out cloud first then, see if it can do what I need then investigate self host later if need. No need to overcomplicate things to start with i guess :slight_smile:

2 Likes

I am trying to do the same thing. I will keep you posted if I get it working.
I know others have installed n8n on CloudWays.

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.

3 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.