Skip to content

About

erpnext 16 docker compose settings

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

ERPNext Docker Production Deployment

Production-ready Docker Compose configuration for ERPNext v16, based on the official Frappe Docker repository.

🎯 Project Overview

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.

πŸ“‹ Prerequisites

System Requirements

  • 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

Quick Check

docker --version      # Should be 24.0+
docker compose version  # Should be v2.x

πŸš€ Quick Start

1. Configure Environment

# Copy environment template
cp .env.example .env

# Edit with your values (REQUIRED: SITE_NAME, ADMIN_PASSWORD, DB_ROOT_PASSWORD)
nano .env

2. Create Data Directories

mkdir -p data/{sites,logs,db,redis_queue}
sudo chown -R 1000:1000 data/

3. Deploy

# 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

4. Access ERPNext

πŸ“¦ For detailed setup: See SETUP.md
πŸš€ For server deployment: See DEPLOYMENT.md
⬆️ Upgrading from v15: See UPGRADE.md

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Host Nginx    │─────────│           Docker Network                β”‚
β”‚  (SSL + Proxy)  β”‚  :8080  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚  β”‚Frontend │──│ Backend │──│Websocketβ”‚  β”‚
                            β”‚  β”‚ (Nginx) β”‚  β”‚(Gunicorn)β”‚ β”‚(Node.js)β”‚  β”‚
                            β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                            β”‚                    β”‚                     β”‚
                            β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
                            β”‚  β”‚ MariaDB β”‚  β”‚  Redis  β”‚  β”‚Schedulerβ”‚  β”‚
                            β”‚  β”‚  10.6   β”‚  β”‚  Cache  β”‚  β”‚& Workersβ”‚  β”‚
                            β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

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

πŸ”’ Security Best Practices

Docker Security

  • 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 Security

  • Environment variables: Never commit .env file
  • 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

Data Protection

  • Backups: Automated daily backups configured
  • Encryption: Database and volume encryption recommended
  • Access control: Implement proper user permissions
  • Audit logging: Enable comprehensive logging

πŸ”§ Configuration

Environment Variables

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

Docker Compose Services

ERPNext Application

  • 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

Database (MariaDB)

  • Image: mariadb:10.6
  • Purpose: Database server (officially recommended by Frappe)
  • Volumes: Persistent database storage
  • Security: Custom user, health checks, connection limits

Redis Cache & Queue

  • Image: redis:7-alpine
  • Purpose: Caching, session storage, and background job queue
  • Security: No external exposure, memory limits, persistence for queue

πŸ”„ Maintenance

Regular Tasks

# 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

Monitoring

  • Health checks: Configured for all services
  • Log rotation: Automatic log rotation enabled
  • Resource monitoring: Use docker stats to monitor usage
  • Alerts: Configure monitoring for disk space, memory, CPU

🚨 Troubleshooting

Common Issues

  1. Container won't start: Check logs with docker compose logs [service]
  2. Database connection failed: Verify environment variables and network connectivity
  3. Site not accessible: Check Nginx proxy configuration and firewall rules
  4. Performance issues: Monitor resource usage and scale accordingly

Debug Mode

# Enable debug mode
docker compose -f docker-compose.yml -f docker-compose.debug.yml up -d

# Access container shell
docker compose exec erpnext bash

πŸ“š Project Documentation

πŸ“– Configuration Guides

  • SETUP.md - Quick setup and installation guide
  • SECURITY.md - User management, passwords, and port configuration
  • DEPLOYMENT.md - Transfer files from local to production server

πŸ”— External Resources

🀝 Contributing

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/improvement)
  3. Commit your changes (git commit -am 'Add improvement')
  4. Push to the branch (git push origin feature/improvement)
  5. Create a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

⚠️ Important Notes

  • 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

About

erpnext 16 docker compose settings

Resources

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages