A Docker Compose setup for running n8n workflow automation with Traefik as a reverse proxy.
This project provides a ready-to-use Docker Compose configuration for n8n that works both in local development and production environments. It uses Traefik as a reverse proxy to handle routing and optional TLS certificate management.
- Docker and Docker Compose installed
- Basic understanding of Docker concepts
- Domain name (for production deployment)
-
Clone this repository:
git clone https://github.com/getsomewolf/n8n-compose.git cd n8n-compose
-
Configure the environment:
# Copy and modify the example .env file cp .env.example .env # (if not already present) # Edit .env to match your requirements
-
Start the services:
docker-compose up -d
-
Access n8n at: http://n8n.localhost (for local development)
To use the .localhost
domain on Windows, you need to add it to your hosts file:
- Open Notepad as Administrator (right-click Notepad and select "Run as administrator")
- Open the file:
C:\Windows\System32\drivers\etc\hosts
- Add the following line at the end of the file:
127.0.0.1 n8n.localhost
- Save the file and close Notepad
- You may need to flush your DNS cache by running
ipconfig /flushdns
in Command Prompt
Now you'll be able to access the n8n interface at http://n8n.localhost in your browser.
The following environment variables can be configured in the .env
file:
Variable | Description | Default |
---|---|---|
SUBDOMAIN | Subdomain for n8n | n8n |
DOMAIN_NAME | Domain name | localhost |
GENERIC_TIMEZONE | Timezone for n8n | UTC |
PROTOCOL | HTTP protocol | http |
ENABLE_TLS | Enable HTTPS | false |
SSL_EMAIL | Email for Let's Encrypt | [email protected] |
For local development, use:
DOMAIN_NAME=localhost
PROTOCOL=http
ENABLE_TLS=false
For production, uncomment and set these values:
DOMAIN_NAME=yourdomain.com
PROTOCOL=https
ENABLE_TLS=true
[email protected]
n8n-compose/
├── docker-compose.yml # Docker Compose configuration
├── .env # Environment variables
├── local-files/ # Directory mounted to n8n container
└── LICENSE # Apache 2.0 License
You can customize the n8n instance by modifying the environment variables in the docker-compose.yml
file or by adding additional services as needed.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.