Production-ready Docker Compose configuration for ERPNext v16, based on the official Frappe Docker repository.
This project provides a secure, scalable, and maintainable Docker-based deployment for ERPNext v16 in production environments. It follows Docker Compose best practices and integrates seamlessly with existing Nginx reverse proxy infrastructure on Debian 12.
- Operating System: Debian 12 (or compatible Linux distribution)
- Docker: v24.0+ with Compose v2
- RAM: Minimum 4GB, recommended 8GB+
- Storage: Minimum 20GB free space
- Network: Nginx reverse proxy on host for SSL termination
docker --version # Should be 24.0+
docker compose version # Should be v2.x# Copy environment template
cp .env.example .env
# Edit with your values (REQUIRED: SITE_NAME, ADMIN_PASSWORD, DB_ROOT_PASSWORD)
nano .envmkdir -p data/{sites,logs,db,redis_queue}
sudo chown -R 1000:1000 data/# Pull images and start
docker compose pull
docker compose up -d
# Monitor site creation (wait for completion)
docker compose logs -f create-site
# Check status
docker compose ps- URL: http://localhost:8080
- Username: Administrator
- Password: (your ADMIN_PASSWORD from .env)
π¦ For detailed setup: See SETUP.md
π For server deployment: See DEPLOYMENT.md
β¬οΈ Upgrading from v15: See UPGRADE.md
βββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββ
β Host Nginx βββββββββββ Docker Network β
β (SSL + Proxy) β :8080 β βββββββββββ βββββββββββ βββββββββββ β
βββββββββββββββββββ β βFrontend ββββ Backend ββββWebsocketβ β
β β (Nginx) β β(Gunicorn)β β(Node.js)β β
β βββββββββββ ββββββ¬βββββ βββββββββββ β
β β β
β βββββββββββ ββββββ΄βββββ βββββββββββ β
β β MariaDB β β Redis β βSchedulerβ β
β β 10.6 β β Cache β β& Workersβ β
β βββββββββββ βββββββββββ βββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
erpnext-docker/
βββ docker-compose.yml # Main Docker Compose configuration (v16)
βββ .env.example # Environment variables template
βββ .env # Your configuration (git-ignored)
βββ data/ # Persistent data volumes
β βββ sites/ # ERPNext sites and uploads
β βββ logs/ # Application logs
β βββ db/ # MariaDB data
β βββ redis_queue/ # Redis queue persistence
βββ SETUP.md # Quick setup guide
βββ DEPLOYMENT.md # Server deployment guide
βββ UPGRADE.md # v15 to v16 upgrade guide
βββ SECURITY.md # Security configuration
βββ README.md # This file
- Non-root containers: All containers run as non-root users
- Read-only filesystems: Applied where possible
- Resource limits: CPU and memory limits configured
- Network isolation: Custom Docker networks with minimal exposure
- Secrets management: Use Docker secrets for sensitive data
- Environment variables: Never commit
.envfile - Strong passwords: Use complex, unique passwords
- Regular updates: Keep Docker images and host system updated
- Firewall: Configure iptables/UFW to restrict access
- SSL/TLS: Always use HTTPS in production
- Backups: Automated daily backups configured
- Encryption: Database and volume encryption recommended
- Access control: Implement proper user permissions
- Audit logging: Enable comprehensive logging
All configuration is managed through environment variables defined in .env:
| Variable | Description | Example | Required |
|---|---|---|---|
DB_ROOT_PASSWORD |
Database root password | super_secure_password |
Yes |
DB_PASSWORD |
Application database password | app_secure_password |
Yes |
DB_NAME |
Database name | erpnext_db |
Yes |
SITE_NAME |
Primary site domain | erp.company.com |
Yes |
ADMIN_PASSWORD |
ERPNext admin password | admin_secure_password |
Yes |
LETSENCRYPT_EMAIL |
Email for SSL certificates | admin@company.com |
Yes |
- Image:
frappe/erpnext:v16.0.1 - Purpose: Main application server (backend, frontend, workers)
- Volumes: Site data, logs
- Security: Non-root user, resource limits, no-new-privileges
- Image:
mariadb:10.6 - Purpose: Database server (officially recommended by Frappe)
- Volumes: Persistent database storage
- Security: Custom user, health checks, connection limits
- Image:
redis:7-alpine - Purpose: Caching, session storage, and background job queue
- Security: No external exposure, memory limits, persistence for queue
# View logs
docker compose logs -f erpnext
# Backup database
docker compose exec db mysqldump -u root -p erpnext_db > backup_$(date +%Y%m%d).sql
# Update containers
docker compose pull
docker compose up -d
# Clean unused resources
docker system prune -a- Health checks: Configured for all services
- Log rotation: Automatic log rotation enabled
- Resource monitoring: Use
docker statsto monitor usage - Alerts: Configure monitoring for disk space, memory, CPU
- Container won't start: Check logs with
docker compose logs [service] - Database connection failed: Verify environment variables and network connectivity
- Site not accessible: Check Nginx proxy configuration and firewall rules
- Performance issues: Monitor resource usage and scale accordingly
# Enable debug mode
docker compose -f docker-compose.yml -f docker-compose.debug.yml up -d
# Access container shell
docker compose exec erpnext bash- SETUP.md - Quick setup and installation guide
- SECURITY.md - User management, passwords, and port configuration
- DEPLOYMENT.md - Transfer files from local to production server
- Fork this repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit your changes (
git commit -am 'Add improvement') - Push to the branch (
git push origin feature/improvement) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Production Use: This configuration is optimized for production environments
- Security: Always change default passwords and keep systems updated
- Backups: Implement automated backup strategies before going live
- Monitoring: Set up proper monitoring and alerting
- Documentation: Keep this documentation updated as your setup evolves
Version: ERPNext v16.0.1 (Frappe Framework v16)
Last Updated: January 2026
Maintainer: Your Organization
Support: Create an issue in this repository for support