Docker n8n, selfhosted Ubuntu, webserver failed

Hey, guys!

Describe the problem/error/question

I have Ubuntu 24 on my server (2 CPU, 4GB Ram, 50GB SSD, Node.js installed 18 version) and also installed docker. I was trying to start n8n in docker. I used the following comand to run image:
docker run -it --rm --name n8n -p 5678:5678 -e GENERIC_TIMEZONE=“Europe/Moscow” -e TZ=“Europe/Moscow” -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true -e N8N_RUNNERS_ENABLED=true -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n

Port 5678 I suppose is free.

What is the error message (if any)?

But I received the following error:

Last session crashed
Initializing n8n process
n8n webserver failed, exiting

what can I do with it?

I’d recommend installing n8n with Docker compose:

1 Like

Using compose way more better for your selfhosted Ubuntu version:)

I’m not sure if this will help but I use Easypanel (not an advertisement). I’m not good with coding so having an interface felt like a gift. It is much more easy to press a button to build an app than using commands.

1 Like

Thanks for instruction! It is pretty complex for me. I can do all steps, but I dont have understading about of comands’ meaning. So I started n8n but It doesnt work from browser. I suppose the main problem is absent of https for my server. I dont have expereince of using SSL certificates

Nevertheless, version 1.46 works pretty well with http connection. Not good I know.

I faced the same issue and struggled with it for a while,
but I finally figured it out.

In my case, the problem was that IPv6 was disabled in my kernel.

Since at least version 1.107.4, the default listen address is ::.

That means n8n tries to bind to an IPv6 address and ends up throwing the same error.

Solution:
Run the container with the environment variable:
-e N8N_LISTEN_ADDRESS=0.0.0.0

After that, it worked fine!

Tip 1:
For more details about the error, you can also enable debug logs:
-e N8N_LOG_LEVEL=debug

Tip 2:
If using docker compose, set this too to avoid express trust proxy errors:
N8N_PROXY_HOPS=1

Hope this helps!

1 Like

Thanks everyone! I solved issue with instruction provided by @markup . Also I had the same issue as @ddangjin had and solved it by insert N8N_LISTEN_ADDRESS=0.0.0.0 in docker compose config.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.