Production-ready Docker Compose stack for deploying multiple business and workflow applications on Dokploy.
Version: 1.0 Created: December 15, 2025 Author: tgunawan
- PostgreSQL 16 - Primary database for Authentik, n8n, Kestra
- Redis 7 - Cache and queue for multiple services
- MariaDB 11.3 - Database for Odoo and Frappe
- ClickHouse - Analytics database
- Authentik - SSO & Identity Provider (server + worker)
- n8n - Workflow automation platform
- Kestra - Data orchestration platform
- Odoo 17 - Open-source ERP system
- Frappe/ERPNext - Business management framework
┌─────────────────────────────────────────────────────┐
│ dokploy-network │
│ (External network for Dokploy integration) │
└─────────────────────────────────────────────────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
┌───▼────┐ ┌────▼─────┐ ┌────▼────┐
│ Authen-│ │ n8n │ │ Kestra │
│ tik │ │ :5678 │ │ :8080 │
│ :9000 │ └──────────┘ └─────────┘
└────────┘ │ │
│ │ │
│ ┌──────────┴────────────┐ │
│ │ │ │
┌───▼─────┐ │ ┌────────┐ ┌─────▼────┐ │
│Postgres │◄─┴──┤ Redis │◄───┤ MariaDB │◄─┘
│ :5432 │ │ :6379 │ │ :3306 │
└─────────┘ └────────┘ └──────────┘
│
┌────────────────┼────────────┐
│ │ │
┌───▼────┐ ┌───▼─────┐ ┌──▼──────┐
│ Odoo │ │ Frappe │ │ClickHse │
│ :8069 │ │ :8000 │ │ :8123 │
└────────┘ └─────────┘ └─────────┘
- Docker Engine 27.x or later
- Docker Compose v2
- Dokploy installed and running
- Minimum 8GB RAM, 4 CPU cores
- 50GB+ disk space
cd ~/projects
git clone https://github.com/tgunawan/dokploy-stack.git
cd dokploy-stack# Copy example environment file
cp .env.example .env
# Edit environment variables
nano .envRequired Changes:
- All passwords (search for
your_strong_) AUTHENTIK_SECRET_KEY(generate with:openssl rand -hex 32)- Hostnames and ports if needed
- Database names if desired
Before starting services, create databases for applications:
# Start only database services first
docker compose up -d postgres mariadb redis clickhouse
# Wait for databases to be ready (30 seconds)
sleep 30
# Create application databases
docker compose exec postgres psql -U postgres -c "CREATE DATABASE authentik;"
docker compose exec postgres psql -U postgres -c "CREATE DATABASE n8n;"
docker compose exec postgres psql -U postgres -c "CREATE DATABASE kestra;"# Start all services
docker compose up -d
# View logs
docker compose logs -f
# Check status
docker compose ps| Service | URL | Default Credentials |
|---|---|---|
| Authentik | http://localhost:9000 | Setup wizard on first visit |
| n8n | http://localhost:5678 | N8N_BASIC_AUTH_USER / N8N_BASIC_AUTH_PASSWORD |
| Kestra | http://localhost:8080 | KESTRA_BASIC_AUTH_USER / KESTRA_BASIC_AUTH_PASSWORD |
| Odoo | http://localhost:8069 | Create database on first visit |
| Frappe | http://localhost:8000 | Administrator / FRAPPE_ADMIN_PASSWORD |
- Login to Dokploy dashboard
- Create New Application → Select "Docker Compose"
- Repository Settings:
- Repository:
https://github.com/tgunawan/dokploy-stack.git - Branch:
main - Compose File:
docker-compose.yml
- Repository:
- Environment Variables: Paste contents of
.envfile - Deploy: Click "Deploy"
# SSH into devops workspace
coder ssh my-devops-ws
# Clone repository
cd ~/projects
git clone https://github.com/tgunawan/dokploy-stack.git
cd dokploy-stack
# Configure environment
cp .env.example .env
nano .env
# Deploy to Dokploy
docker compose --project-name dokploy-stack up -dInitial Setup:
- Access http://localhost:9000
- Create admin user (email + password)
- Configure SSO providers (Google, GitHub, etc.)
- Set up applications for n8n, Kestra, Odoo, Frappe
Integration:
- All services can use Authentik for authentication
- Configure OAuth2/OIDC in each application
- Use single sign-on across all services
Features:
- Visual workflow builder
- 200+ integrations (Slack, Email, HTTP, etc.)
- PostgreSQL backend for persistence
- Redis queue for background jobs
Common Workflows:
- Data synchronization between Odoo and Frappe
- Automated email notifications
- Webhook processing
- Scheduled data exports to ClickHouse
Features:
- Code-first data pipelines
- Support for Python, Node.js, SQL, Bash
- Built-in scheduler and triggers
- PostgreSQL backend
Use Cases:
- ETL pipelines
- Database migrations
- Scheduled reports
- Data validation workflows
Included Apps:
- CRM, Sales, Inventory
- Accounting, HR, Project Management
- eCommerce, Manufacturing
Configuration:
- Database: MariaDB
- Workers: 4 (for production performance)
- Max connections: 500
Features:
- Complete ERP suite
- Custom app development framework
- REST API
- Real-time updates via Socket.IO
Configuration:
- Database: MariaDB
- Cache: Redis (database 0)
- Queue: Redis (database 1)
- Socket.IO: Redis (database 2)
- CPU: 4 cores
- RAM: 8GB
- Disk: 50GB SSD
- CPU: 8+ cores
- RAM: 16GB+
- Disk: 100GB+ NVMe SSD
- Network: 1Gbps
| Service | Idle | Active | Peak |
|---|---|---|---|
| PostgreSQL | 200MB | 500MB | 1GB |
| MariaDB | 500MB | 1GB | 2GB |
| Redis | 50MB | 100MB | 512MB |
| ClickHouse | 200MB | 500MB | 2GB |
| Authentik (server+worker) | 300MB | 500MB | 1GB |
| n8n | 200MB | 400MB | 800MB |
| Kestra | 300MB | 600MB | 1.5GB |
| Odoo | 400MB | 800MB | 2GB |
| Frappe | 500MB | 1GB | 3GB |
| TOTAL | ~2.5GB | ~5.5GB | ~14GB |
All data is persisted in Docker volumes:
postgres_data - PostgreSQL database files
mariadb_data - MariaDB database files
redis_data - Redis persistence files
clickhouse_data - ClickHouse database files
authentik_media - Authentik uploaded files
n8n_data - n8n workflow data
kestra_data - Kestra flow storage
odoo_web_data - Odoo filestore
odoo_addons - Odoo custom addons
frappe_sites - Frappe site files
frappe_apps - Frappe applications
# Backup databases
docker compose exec postgres pg_dump -U postgres authentik > backup_authentik_$(date +%Y%m%d).sql
docker compose exec postgres pg_dump -U postgres n8n > backup_n8n_$(date +%Y%m%d).sql
docker compose exec mariadb mysqldump -u root -p${MYSQL_ROOT_PASSWORD} --all-databases > backup_mariadb_$(date +%Y%m%d).sql
# Backup volumes
docker run --rm -v dokploy-stack_postgres_data:/data -v $(pwd):/backup ubuntu tar czf /backup/postgres_data_$(date +%Y%m%d).tar.gz /data
# Automated backup script (add to cron)
./scripts/backup.sh- dokploy-network: External network for Dokploy integration
- internal: Internal network for service communication
| Service | Internal Port | External Port (default) |
|---|---|---|
| PostgreSQL | 5432 | 5432 |
| MariaDB | 3306 | 3306 |
| Redis | 6379 | 6379 |
| ClickHouse HTTP | 8123 | 8123 |
| ClickHouse Native | 9000 | 9000 |
| Authentik HTTP | 9000 | 9000 |
| Authentik HTTPS | 9443 | 9443 |
| n8n | 5678 | 5678 |
| Kestra | 8080 | 8080 |
| Odoo | 8069 | 8069 |
| Odoo Longpolling | 8072 | 8072 |
| Frappe | 8000 | 8000 |
| Frappe Socket.IO | 9000 | 9000 (conflicts with Authentik!) |
FRAPPE_SOCKETIO_PORT in .env to avoid conflicts.
- Strong Passwords: All services require unique, strong passwords
- Internal Network: Services communicate via internal network
- Health Checks: All databases have health checks
- Resource Limits: Memory limits prevent resource exhaustion
- Secrets Management: Credentials via environment variables (not hardcoded)
-
Enable HTTPS:
- Use Traefik or nginx reverse proxy
- Install SSL certificates (Let's Encrypt)
- Force HTTPS redirects
-
Firewall Configuration:
# Only expose necessary ports ufw allow 80/tcp ufw allow 443/tcp ufw deny 5432/tcp # PostgreSQL ufw deny 3306/tcp # MariaDB ufw deny 6379/tcp # Redis
-
Database Security:
- Change default PostgreSQL user
- Disable remote root login for MariaDB
- Use separate database users per application
-
Regular Updates:
# Update images docker compose pull docker compose up -d -
Monitoring:
- Enable Grafana (uncomment in docker-compose.yml)
- Set up log aggregation (Loki, ELK)
- Configure alerts (disk space, memory, CPU)
Check Logs:
docker compose logs <service-name>Common Causes:
- Port conflicts (change
EXTERNAL_PORTin.env) - Missing environment variables
- Database not ready (increase sleep time in init script)
Verify Database Health:
docker compose exec postgres pg_isready -U postgres
docker compose exec mariadb mysql -u root -p${MYSQL_ROOT_PASSWORD} -e "SELECT 1;"Reset Databases:
# ⚠️ WARNING: This deletes all data
docker compose down -v
docker volume prune -f
docker compose up -dCheck Resource Usage:
docker statsReduce Resource Consumption:
- Stop unused services
- Reduce Odoo workers (
--workers=2) - Lower database buffer pools
Optimize Databases:
# MariaDB
docker compose exec mariadb mysql -u root -p${MYSQL_ROOT_PASSWORD} -e "OPTIMIZE TABLE;"
# PostgreSQL
docker compose exec postgres psql -U postgres -c "VACUUM ANALYZE;"Check Disk I/O:
iostat -x 1# Pull latest images
docker compose pull
# Restart services with new images
docker compose up -d
# Clean up old images
docker image prune -f# Scale n8n workers
docker compose up -d --scale n8n-worker=3
# Scale Frappe workers
docker compose up -d --scale frappe-worker=2# All services
docker compose logs -f
# Specific service
docker compose logs -f n8n
# Last 100 lines
docker compose logs --tail=100 authentik-server# Use docker-compose.dev.yml override
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -dChanges:
- Debug logging enabled
- Auto-reload for Odoo and Frappe
- Port forwarding for all services
- No resource limits
# Use docker-compose.prod.yml override
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -dChanges:
- Production logging levels
- Resource limits enforced
- Health checks with restart policies
- Only expose required ports
- Fork the repository
- Create feature branch (
git checkout -b feature/improvement) - Commit changes (
git commit -am 'Add improvement') - Push to branch (
git push origin feature/improvement) - Create Pull Request
MIT License - See LICENSE file for details
- Issues: https://github.com/tgunawan/dokploy-stack/issues
- Discussions: https://github.com/tgunawan/dokploy-stack/discussions
- Documentation: https://github.com/tgunawan/dokploy-stack/wiki
Last Updated: December 15, 2025 Version: 1.0 Maintained By: tgunawan