Running n8n on Docker
οΏ½ How to Run n8n Using Docker π³
Running n8n (a powerful workflow automation tool) using Docker is simple and efficient. You have two main options: using a basic Docker command or setting up a more robust environment with Docker Compose. Below, weβll walk you through both methods step by step. π
π Option 1: Running n8n with Docker
1οΈβ£ Create a Docker Volume for Persistent Data π
To ensure your n8n workflows and credentials are saved even after restarting the container, create a Docker volume for persistent data.
docker volume create n8n_data
This command creates a volume named n8n_data to store your n8n data securely. π
2οΈβ£ Run the n8n Docker Container πββοΈ
Use the following command to start the n8n container:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8n
-
-p 5678:5678: Maps port 5678 on your host machine to the containerβs port 5678. -
-v n8n_data:/home/node/.n8n: Mounts then8n_datavolume to the containerβs data directory.
Once the container is running, you can access n8n by navigating to:
π http://localhost:5678
For more details, check out the official documentation: n8n Docs. π
π³ Option 2: Running n8n with Docker Compose
For a more advanced setup, especially in production environments, Docker Compose is the way to go. It allows you to define and manage multi-container Docker applications with ease. π οΈ
1οΈβ£ Install Docker Compose β¬οΈ
Ensure Docker Compose is installed on your system. If not, follow the official Docker Compose installation guide. π₯
2οΈβ£ Create a Docker Compose File π
Create a docker-compose.yml file with the following configuration:
version: '3.7'
services:
n8n:
image: docker.n8n.io/n8nio/n8n
ports:
- "5678:5678"
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
-
image: Specifies the n8n Docker image. -
ports: Maps port 5678 on your host to the container. -
volumes: Uses then8n_datavolume for persistent storage.
3οΈβ£ Start the n8n Service π
Run the following command in the directory where your docker-compose.yml file is located:
docker-compose up -d
This will start the n8n service in detached mode. You can access it at:
π http://localhost:5678
π Youβre All Set! π
Whether you choose the simple Docker command or the more advanced Docker Compose setup, you now have n8n up and running! Enjoy automating your workflows with ease. π€β¨
Feel free to customize this content further to match your WordPress theme or audience preferences! ποΈ
Imported from rifaterdemsahin.com Β· 2025