How to add n8n as docker container startup

Hi,

I tried to install n8n using docker but as of now I need to manually run a command to start the n8n docker container may I know what I need to install and add to my installation for me to automatically run the n8n docker image and can access it even I close the SSH?

In addition, I also tried this command to add the n8n image in docker then I restart it, n8n image automatically start but not accessible

docker run -d --restart unless-stopped n8nio/n8n

Hey @rodskie123,

Using --restart always should do the job, You can find the docker manual that covers the options here: Start containers automatically | Docker Documentation

1 Like

Thank you for your help @Jon I can now access the n8n in docker

I use this command.

docker run -d --restart unless-stopped --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8nio/n8n
1 Like