Deploy on docker with different port

Hello

I am trying to run n8n on docker running on ubuntu as root user

here is my commands

docker volume create n8n_data

docker run -it --rm --name n8nNEW -p 5566:5566 -v n8n_data:/root/node/.n8n docker.n8n.io/n8nio/n8n
n8n_data

I made two changes

  • the port from 5678 to 5566 as i have this port used
  • the data folder instead of home i used root " n8n_data:/root/node/.n8n"

the docker run correctly with below log showing.

Editor is now accessible via:
http://localhost:5678/

Press "o" to open in Browser.

despite that the port assigned to the container is as i set it “5566”
but the log show the default port

and when i opened the browser to the port 5566 the page show error as noting on this port

Hi @scropion86,

Since default defined n8n port is 5678, you have to expose 5678 with your desired port. Instead of 5566:5566, you have to set port as 5566:5678.

If you also want to change default port, you need to set N8N_PORT in your .env. Here is the page you may want to take a look at.

Hope it helps.

1 Like