This repository provides a quick setup for running n8n locally with MongoDB integration using Docker Compose.
- N8N workflow automation platform
- MongoDB database with authentication
- Persistent data storage
- Docker-based setup for easy deployment
- SSL/TLS support with Traefik and Let's Encrypt
- Docker
- Docker Compose
- Git (optional)
- Domain name pointing to your server (for SSL)
- Clone this repository or copy the
docker-compose.ymlfile:
git clone https://github.com/clawstudios/n8n.git- Ensure acme.json is created and has the right permissions for Traefik:
chmod 600 traefik-data/acme.json- Run the Docker Compose setup:
docker compose up -d- Access N8N at https://your-domain.com (or http://localhost:5678 for local development).
- Host:
localhost - Port:
27017 - Root Username:
root - Root Password:
root - Default Database:
n8n
- URL:
https://your-domain.comorhttp://localhost:5678(local development) - Default credentials will be created on first launch
- Automatically handles SSL certificates via Let's Encrypt
- Redirects HTTP to HTTPS
- Manages routing to the n8n service
The setup uses three Docker volumes:
mongo_data: Stores MongoDB datan8n_data: Stores n8n configurations and workflows- Local directory
traefik-data: Stores Traefik configuration and SSL certificates
- The MongoDB credentials in this setup are for development purposes only
- Change the default credentials before using in a production environment
- Consider implementing additional security measures for production use
- The
chmod 600 traefik-data/acme.jsonstep is critical for security and proper functioning of SSL
Feel free to submit issues, fork the repository, and create pull requests for any improvements.
[Your chosen license]
This is a development setup and should be properly secured before using in a production environment.
