This guide covers how to install and execute n8n in a Docker container on Windows, macOS and Linux platforms.
System Requirements for n8n
Windows:
Confirm installation by checking the Docker version.
docker --version
macOS:
brew install --cask docker
docker --version
Linux (Ubuntu/Debian):
Check for updates and run up-grade for improvements <sudo apt update && sudo apt upgrade -y>
Install docker with <-y > flag which automatically confirms anything needed <sudo apt install docker.io -y>
For the most part, when you are through enabling, you can just tell the computer to enable the feature and it will fill in the blanks it needs<div> <sudo systemctl enable --now docker</div></div>
Confirm the installation by verifying the docker version <docker --version>
If you would like to run n8nin with Docker, you will have to input the command below:
If you want it to run for a long time without connection issues, it is best to someone meddling with it, so leave it unattended with <-rm > flag <docker run -it --rm \> < If you don't want it accessible for others when they can <n8nio/n8n>
To run n8n as a containerized service, execute the following command in a terminal:
docker run -d --name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
It's better to set environment variables for production. Create an .env file as follows:
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=securepassword
Then run n8n with:
docker run -d --name n8n \
--env-file ./.blog/envs/n8n.env \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
When the container is up, you can visit:
http://localhost:5678
Using the container.
To suspend the active container, use:
docker stop n8n
To resume the stopped container, use:
docker start n8n
To remove the container from the system entirely, use:
docker rm n8n
By following this guide, you can easily install n8n in Docker on Windows, macOS, or Linux. This is a flexible and scalable way to get started with n8n, and it makes it easy to keep n8n up to date. Whether you are a developer, marketer, founder, or anything in between, you will be able to save time and improve your processes by using automation with n8n docker.
Ready to transform your business with our technology solutions? Contact Us today to Leverage Our AI/ML Expertise.