N8N 2.0 Docker Setup Tutorial

If you don’t have Docker setup already I have a tutorial here

The Docker Compose file on my github

The .env file on my GitHub

You can use curl to get the files

curl -o .env https://raw.githubusercontent.com/lawrencesystems/n8n/refs/heads/main/.env
curl -o compose.yaml https://raw.githubusercontent.com/lawrencesystems/n8n/refs/heads/main/compose.yaml

For simplicity I prefer bind mounts so all the data stays within the directory so we need to create those so they will have the proper permissions.

mkdir -p data/n8n local-files

Then run docker compose up to start the container and watch the output. You could start it with the -d for detached mode but I prefer to watch for errors the first time I run it and modern docker allows you to press D to detach.

Nginx Proxy Manager Tutorial

1 Like

The video has a note that n8n isn’t using a classic OSI license, but doesn’t elaborate further. What’s missing from n8n’s license vs a proper open-source project?

I’m currently using node-red, but I’ll admit it doesn’t have quite as many integrations & polish as n8n seems to have.

They have page detailing out the license: Sustainable Use License | n8n Docs

Because they offering hosting and some other features as a way to sustain the project their license has clauses that stop people from competing with them in that way. So the code is open and free for you to use, but you can not setup a hosting option and resell it to others.

Here are the traditional OSI approved Licenses Licenses – Open Source Initiative

1 Like

Really nice tutorial and nice docker compose files. My only question in your docker compose is what is purpose of the n8n-worker, n8n-runners-main and n8n-runners-worker services? Clearly they are for task running, but they seem to be pulling duplicate images. Thanks

As I think understand it (I am not an n8n expert) In n8n 2.x, execution is split into control and execution:

  • n8n (main)
    → UI, API, workflow orchestration, credentials, webhooks
  • n8n-runners (execution layer)
    → actually runs workflow steps in isolated workers

This separation allows:

  • horizontal scaling
  • better security isolation
  • crash containment

I think the worker is still there for backwards compatibility

Hey @LTS_Tom - Wanted to stop by here and say THANKS again for another awesome video… The files for this one, however, have changed quite a bit since the video, and I’m struggling to get it going. In the ENV file… Are the username and passwords supposed to be different, because if I use 2 different postgres usernames I can’t get anything to work. If I set both variables to the same username and same password, then the system starts. Note that there are a couple typos in the compose.yaml also that need to be fixed.

I am working today to review and fix the changes. Matt Fox had made changes that seems to have broke this so I am reverting back to the original and testing.

1 Like

Sorry for the issues, I reverted it back to the version in the video, tested it on a new clean server and it worked as expected. If you have any other issues let me know.