Installation is messy in the folders, best would be one docker-compose.yml

Hi,

Can you please tell me what I need to do to get n8n installed with one docker-compose.yml.

I try to get the n8n postgres up and running but then you guys have a .sh file that creates the none root user, would not be better to just have it as a “command” input into the docker-compose.yml?

Another thing is that I found out that it seems that the DB schema doesn’t get created by the webapp so it seems there another script somewhere that I need to find to install the postgres DB schema… it would be best to have all of the DB steps either inside the command in the docker-compose.yml or having the web-apps do the DB configuration and doing the non-root user configuration having this the way it’s I don’t think makes it easy for us to install it.

The installation documentation is not rich either it’s almost kind of hidden there so it would be nice to do a revamp in that landscape if someone who knows n8n can because I’m still trying to understand how n8n works to get these things fixed/going with one docker-compose.yml

Requirements for installation:

  1. Ports: 80 or 5678
  2. Have volumes for web and db.
  3. Run the following script for DB creation after postgres is up and running

I have a swarmpit up and running so I just basically feed the docker-compose.yml and swarmpit does the rest for the stack.

I loved the look and feel of the project in the videos but for now I only see the videos I didn’t get it running just yet it’s complaining about lack of database in the web service.

Welcome to the community @Ramonck!

A full setup guide on how to get n8n running on a server can be found in the documentation here:

An example on how to run Postgres with n8n can be found here (you need every file in the folder to run n8n except the README.md file):

What you probably need is a combination of both (unless something else is setting up SSL). We will sadly never be able to have a perfect step-by-step guide for every combination as there are simply way to many. So some basic docker knowledge will always be required to run n8n yourself. If you do not have that you will sadly probably either have to hire somebody who does or wait for the hosted version we will release in the next weeks.

What you call “messy” with the different files is actually best practice for docker-compose. Esp. the separate .env file. Like that it is possible to tell people to not touch any file except that single one where they are supposed to make changes. That reduces the chance that people mess with things they are not supposed to mess with unless they know what they are doing.

Btw. your requirements sound problematic to me as n8n should for a production deployment run on 443 (SSL).

Hi Jan,

Thanks for the quick response.

I got the n8n working just on the plain SQLite and with the user and password but I wanted to get it working with the Postgres.

I even wrote an article to help others getting the n8n up and running: Workflow on Docker Swarm - DEV Community

When I have time I will look into this postgres setup and maybe do another write up on the docker-compose.yml I think just a pure yml with the postgres should be a great setup.

Regarding production and SSL I’m not there yet and not even thinking about how this would work in a production environment I’m just trying to get things going and see it working and all for now all I can say is I loved the UI the look and feel it reminds me a lot of the facilities of Nintex Workflows but the great twist here is the open source approach.

Is great too that you guys already thinked about the marketplace and stuff to help folks that’s just great stuff maybe when I have some time I can help with another write up on a pure docker-compose.yml with postgres I will get there later will first test the tool and see it in the works and all and then think about that other stuff.

My setup is basically a docker swarm so I will no work with the mkdir approach as in your tutorial but rather a volume approach instead so that’s what I was saying basically is instead of focusing on a docker run “setup”, you guys should focus more on pre-reqs like docker does so it doesn’t matter if it’s kubernetes or whatever they know what they have to do or to link or scripts to run, etc. I will dig deeper later in that setup approach I will focus on seeying if it works for now and how well it works. So yes I can do the docker-compose myself later no worries I just wanted to help with insights to you guys for you to think there.

Best Regards,

2 Likes

Really cool with the write-up! Great to have you hear and already helping the community like this. One thing I saw is that you can remove the “sleep 5”. If you use SQLlite or if you know that the database n8n connects with is already running that is not required. Another thing is that we are not OSI approved open-source we are Fair-Code licensed instead.

SSL is incredibly important because a lot of the services n8n integrates with only work if the callback URL is SSL protected. So really depends on how people use n8n. If they use it for example only for cron-jobs it will be fine like this, if however any triggers from external services (like Pipedrive) is required then they will probably run into problems.

Have sadly not enough experience with docker swarm to know how setup-scripts get handled there but I know that the data that is normally in the .env file gets handled securely via docker-secrets. That will work fine with n8n as everything can not just be set as environment variable also as file by adding “_FILE” and then set the file path from where the data can be read.

Hi Jan,

I just updated the licensing and title in the article to reflect the Fair-code.

Thanks for the heads up.

Best Regards,

2 Likes