# ERPNext

> Full-featured open-source ERP system.

- Category: E-Commerce & Business
- Difficulty: advanced
- Components: erpnext, mariadb, redis
- Tags: erpnext, erp, frappe, business
- Source: https://docker.recipes/ecommerce/erpnext

## Overview

ERPNext is a comprehensive open-source Enterprise Resource Planning (ERP) system built on the Frappe framework, designed to handle all aspects of business operations from accounting and HR to manufacturing and project management. Originally developed by Frappe Technologies in India, ERPNext has grown into one of the most feature-complete open-source ERP solutions available, offering modules for accounting, inventory management, CRM, human resources, manufacturing, asset management, and project tracking. This Docker stack combines ERPNext with MariaDB as the primary database backend and Redis for caching and queue management, creating a robust three-tier architecture optimized for business operations. MariaDB provides the transactional reliability needed for financial data and business records, while Redis handles session management, real-time notifications, and background job queues that power ERPNext's workflow automation. This configuration is ideal for small to medium-sized businesses looking to implement a complete ERP solution, development teams building custom business applications on the Frappe framework, or organizations migrating from proprietary ERP systems to an open-source alternative that can be fully customized and extended.

## Features

- Complete business suite with 15+ integrated modules including accounting, inventory, HR, manufacturing, and CRM
- Frappe framework foundation enabling custom app development and workflow automation
- MariaDB backend with Aria storage engine optimized for business transaction processing
- Redis-powered real-time notifications and background job processing for workflow automation
- Multi-company and multi-currency support with automated exchange rate updates
- Role-based permissions system with granular access control for business data
- Built-in REST API and webhook system for third-party integrations
- Responsive web interface with offline-capable Progressive Web App features

## Use cases

- Small to medium manufacturing companies needing integrated production planning and inventory management
- Service-based businesses requiring project management with time tracking and billing integration
- Retail operations needing point-of-sale integration with inventory and accounting systems
- Growing startups transitioning from spreadsheets to integrated business management software
- Educational institutions managing student records, fee collection, and academic planning
- Non-profit organizations tracking donors, grants, and program management
- Development agencies building custom ERP solutions for clients on the Frappe framework

## Prerequisites

- Minimum 4GB RAM (8GB+ recommended for production environments with multiple users)
- Docker and Docker Compose installed with adequate storage for business data growth
- Port 8080 available for ERPNext web interface access
- Basic understanding of ERP concepts and business process workflows
- MariaDB administration knowledge for backup and maintenance procedures
- Familiarity with Frappe bench commands for site management and app installation

## docker-compose.yml

```yaml
services:
  erpnext:
    image: frappe/erpnext:latest
    container_name: erpnext
    restart: unless-stopped
    environment:
      DB_HOST: mariadb
      DB_PORT: 3306
      REDIS_CACHE: redis://redis:6379/0
      REDIS_QUEUE: redis://redis:6379/1
      SOCKETIO_PORT: 9000
    volumes:
      - erpnext_sites:/home/frappe/frappe-bench/sites
    ports:
      - "8080:8080"
    depends_on:
      - mariadb
      - redis
    networks:
      - erpnext

  mariadb:
    image: mariadb:10.6
    container_name: erpnext-mariadb
    environment:
      MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
    volumes:
      - mariadb_data:/var/lib/mysql
    networks:
      - erpnext

  redis:
    image: redis:alpine
    container_name: erpnext-redis
    networks:
      - erpnext

volumes:
  erpnext_sites:
  mariadb_data:

networks:
  erpnext:
    driver: bridge
```

## .env

```bash
DB_ROOT_PASSWORD=changeme
```

## Usage notes

- Docs: https://frappeframework.com/docs/, https://docs.erpnext.com/
- Access at http://localhost:8080 after bench setup
- Initialize: bench new-site site1.local, bench install-app erpnext
- Modules: accounting, HR, manufacturing, CRM, projects, assets
- Frappe framework underneath - extensible with custom apps
- Resource intensive: recommend 4GB+ RAM for production

## Troubleshooting

- Site creation fails with database connection error: Ensure MariaDB container is fully started and DB_ROOT_PASSWORD environment variable is set correctly
- ERPNext shows 'Redis connection failed' error: Verify Redis container is running and accessible on the configured ports 6379/0 and 6379/1
- Bench commands not working after container restart: Re-run 'bench new-site' and 'bench install-app erpnext' commands to properly initialize the site
- Performance issues with large datasets: Increase MariaDB memory allocation and enable Redis persistence for better caching performance
- Module installation fails with permission errors: Check that erpnext_sites volume has proper ownership and the frappe user can write to the sites directory
- Background jobs not processing: Restart the Redis container and verify REDIS_QUEUE connection string points to the correct Redis database index

