Install N8n on Docker in cyberpanel

Hi, good morning!

I am installing n8n on docker in my cyberpanel, but, without sucess.

I dont’t make SSL work e etc…

Can someone help me?

A tutorial link or a other solution…

I know this might not be the right place, but I’m asking in hopes of finding someone who has done this.

Thanks!

Hey @Everton_Augusto,

There was someone else trying to install n8n with Cyperpanel but there were some issues. If Cyperpanel lets you use a compose file that would be the easiest way to do it but I have never actually seen Cyperpanel so I am not sure what a correct process would look like. Assuming it is just standard docker it should just be a case of following the normal guide for Docker then using a reverse proxy infront of n8n to handle the SSL / TLS side.

1 Like

Hi @jon ! Thanks for your answer.

I got it after a few tries, it’s working perfectly!

Actually, N8N in cyberpanel is a bit tricky to make it work.

STEPS:

1 - Create a Website, which will redirect to your n8n container (such as n8n.yourdomain.com), do not forget to enable SSL for it.

2 - Create a folder with name “files” on public_html

3 - Pull the n8n image and create the container with name “myn8ndocker”. Some relevant information to add to your env data:

N8N_BASIC_AUTH_ACTIVE  -   TRUE // If you what to use login credentials
N8N_BASIC_AUTH_USER  -   USERNAME // Used with above information
N8N_BASIC_AUTH_PASSWORD  -   PASSWORD // Same as last one
WEBHOOK_URL  -   YOUR N8N URL // your full n8n url here, to enable webhooks, make sure you add https
VUE_APP_URL_BASE_API  -   YOUR N8N URL // same as above

Do not forget to add a persistent volume, in volumes, add:

/home/node/.n8n  -  /home/n8n.yourdomain.com/public_html/files

4 - Get it mind your forward port added and login into your ssh. Edit your /usr/local/lsws/conf/httpd_config.conf file with your favorite editor and add the following code in the end of the file:

extprocessor myn8ndocker {
  type                    proxy
  address                 http://yourcyberpanelip:yourport (Example: http://123.123.345:3334)
  maxConns                100
  pcKeepAliveTimeout      60
  initTimeout             60
  retryTimeout            0
  respBuffer              0
}

Save your file!

5 - Go back to your website created in the first step and edit it’s .htacess, adding the following code:

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
REWRITERULE ^(.*)$ http://myn8ndocker/$1 [P]

6 - Restart litespeed service and be happy!

Specialy thanks for GABRIEL the of cyberpanel forum for this tutorial!

3 Likes

dear @Everton_Augusto
Thank you! it worked for me. I’m on a VPS at Hostinger.
However I’m facing an issue : each time I start a workflow (even as simple as just a Set node) it takes all the CPU and never ends.
Do you have any idea why?

1 Like

Hello!
how much ram does your vps have?

1GB…
perhaps I should begin with updating n8n to the last version? do you know what is the best process to do this on cyberpanel?

Yes, update n8n to the latest version.
Pull the image “n8nio/n8n:latest”.

Then delete the current container, don’t worry, your projects are saved and will be restored. Before deleting, be sure to save your current container information.

Then create a new container with the last image you took from n8n. The ENV information must be identical to the previous container, including the container name.

Limit the N8N to use 256 or 512 mb of RAM.

Well, I’m not an IT professional, but I would!

Good luck

thanks for your help.
With the last version installed it works ok.
thanks again

1 Like

Hi man, Thanks for your tuto about the install of n8n in docker on cyberpanel .

I guess that another way to update is more easily.

Just open SSH, run the following command: docker pull n8nio/n8n:latest (or the image version you are using)…

After Pull complete, you go to Docker Container Manager (in CyberPanel)

Just recreate the container.

No need to delete container and set all configs again. Only “recreate” and start your container.

2 Likes

Great guy! I didn’t know that, it was a very valuable comment from him. Thanks for the info!

1 Like