I followed the server setup documentation here and installed n8n on a subdomain say flow.example.org. We’re already running 2 other virtual hosts troy.example.com and janice.example.com in the same server.
When I try to visit flow.example.org I see troy.example.com.
I have never used docker, but I have double-checked the docker-compose file and .env file, the URLs are configured correctly. Can you please explain what went wrong?
Honestly no. Is sadly impossible to answer. There is simply way to much unknown here. Like how is “troy” or “janice” set up? Via the same docker-compose setup via traefik or totally differently? If it is separate do they all use the same port (like 443?) because that will cause problems as two different applications try to access the same port. So assume only one starts properly and the other one fails.
If it is all via docker and traefik then I guess something is wrong in the setup.
Sorry, my bad. Troy and Janice are PHP and Python apps. They run without any containerisation. Yes, they all use same ports (80 and 443), configured as two different virtual hosts.
My understanding about docker and this traefik is very basic. I have never used them until today.
So if the PHP application already uses port 80 and 443 I would expect that it is not possible to start docker compose at all. Does it not display you a lot of error messages if you try to?
Best to see them directly is if you stop the setup again with:
sudo docker-compose stop
and then start the up command with the -d so just:
sudo docker-compose up
It should then directly output everything into the terminal and if there are issues you should see it. You can then stop it again with ctrl+c.
Anyway I guess you would need to free up port 443 no matter what. Here are some similar issues which partly also talk about possible solutions:
The challenge that you are running into is that your VPS is technically running two different web servers; the (I’m assuming) Apache server which is serving up your main sites and the n8n “server” giving out the n8n piece. And, these two servers are unaware of each other.
What you may wish to look into is a proxy/load balance system (e.g. NGINX) that knows about both of the servers and then redirects the requests to the proper site. This would take some work to get running properly but would produce the results you are looking for.
This makes sense, a bit. Is there a way to make Apache and n8n’s server to know about each other? And by NGINX, you mean placing another web server in between Apache and n8n? If you could tell me the logical part of it, I’ll be able to grasp it and try it.
Thanks. How do I uninstall the existing docker version? Sorry to keep asking basic questions, I am really new to these new technologies like docker and I am not sure what folders need to be removed and if there is a neat way to do it.
Also, running npm install n8n -g throws these errors. I tried with sudo but still shows permission errors.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: This version of pg-promise is obsolete. You should update to a newer version.
/usr/bin/n8n -> /usr/lib/node_modules/n8n/bin/n8n
> [email protected] install /usr/lib/node_modules/n8n/node_modules/mmmagic
> node-gyp rebuild
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/home/claudia/.cache/node-gyp/12.16.3"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/n8n/node_modules/mmmagic/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/n8n/node_modules/mmmagic/.node-gyp'
gyp ERR! System Linux 4.15.0-96-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/n8n/node_modules/mmmagic
gyp ERR! node -v v12.16.3
gyp ERR! node-gyp -v v5.1.0
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/claudia/.npm/_logs/2020-05-08T19_05_30_392Z-debug.log
The problem that you are running into with the errors has to do with the combination of installing NodeJS globally (often with sudo) and then n8n globally is that the user does not have proper permissions to the global folders. Take a look here:
Following these instructions will hopefully resolve the issues.
That is the nice thing about docker. You do not really have to uninstall anything there. If you however want to save some disk-space you can remove the docker images you do not need anymore.
For n8n and traefik that would be:
I used a fresh server and got it working. Thanks. I have a small feedback. It would be nice if the installation documentation covers n8n setup on existing servers too. Perhaps someone from the community can help it. Thanks much.
The problem is just that just one guide would not cover it, as each existing setup would be different. That would mean that multiple guides have to get created and then still some technical knowledge would be needed as not everything can be anticipated or document for every case. But it would be great if people who added n8n to their existing setup would write a short write-up to build a library like this.
We are also currently working hard on the hosted version of n8n. This will then hopefully reduce the need for the own manual setup for many people.
I’m working on a couple of n8n based projects right now and one of the byproducts of these projects is an installation script. It will probably be targeted to a specific environment to begin with but could potentially be generalized to multiple environments.
I’ll make sure to release it to the community once it is ready for public consumption.