Install ERPNext with Docker and Docker Compose tutorial

ERPNext is an open-source enterprise resource planning (ERP) platform that is designed to be a comprehensive solution for managing various business processes such as accounting, inventory, sales, purchasing, human resources, and more. Developed by Frappe Technologies, ERPNext is built on the Frappe Framework and provides a modular approach to business management, making it a flexible choice for organizations of all sizes.

It is known for its user-friendly interface, extensive feature set, and ability to be customized to fit specific business needs. ERPNext also supports multi-company setups, multi-currency transactions, and integrates well with various third-party services, making it a popular choice for businesses around the world.

Installing ERPNext with Docker and Docker Compose

This tutorial will guide you through the steps to install ERPNext using Docker and Docker Compose. By the end of this tutorial, you will have a fully functional ERPNext instance running in Docker containers.

Prerequisites

  • Docker installed on your system
  • Docker Compose installed on your system

Setting Up the Directory Structure

Create a new directory for ERPNext and navigate into it:

mkdir erpnext-docker
cd erpnext-docker

Create the docker-compose.yml File

Create a docker-compose.yml file in the directory with the following content:

version: '3.1'

services:
  erpnext:
    image: frappe/erpnext:latest
    container_name: erpnext
    environment:
      - SITE_NAME=erp.example.com
      - DB_ROOT_USER=root
      - MYSQL_ROOT_PASSWORD=admin
      - ADMIN_PASSWORD=admin
      - INSTALL_APPS=erpnext
    volumes:
      - ./sites:/home/frappe/frappe-bench/sites
    ports:
      - "80:80"
    depends_on:
      - mariadb
      - redis-cache
      - redis-queue
      - redis-socketio

  mariadb:
    image: mariadb:10.5
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=admin
    volumes:
      - ./mariadb-data:/var/lib/mysql

  redis-cache:
    image: redis:6.0-alpine
    container_name: redis-cache
    volumes:
      - ./redis-cache-data:/data

  redis-queue:
    image: redis:6.0-alpine
    container_name: redis-queue
    volumes:
      - ./redis-queue-data:/data

  redis-socketio:
    image: redis:6.0-alpine
    container_name: redis-socketio
    volumes:
      - ./redis-socketio-data:/data

volumes:
  mariadb-data:
  redis-cache-data:
  redis-queue-data:
  redis-socketio-data:
  sites:

Configure the Environment Variables

In the docker-compose.yml file, update the following environment variables as per your needs:

  • SITE_NAME: The domain or subdomain where ERPNext will be accessible.
  • MYSQL_ROOT_PASSWORD: The root password for the MariaDB database.
  • ADMIN_PASSWORD: The admin password for ERPNext.

Start the Docker Containers

Run the following command to start all the services:

docker-compose up -d

This command will pull the necessary Docker images and start the containers for ERPNext, MariaDB, and Redis.

Access ERPNext

Once the containers are up and running, open your web browser and navigate to http://localhost. If you set a different port in the docker-compose.yml file, use that port instead.

Initial Setup

On your first visit, ERPNext will guide you through the initial setup process where you can configure company details, users, and other settings.

Stopping the Containers

To stop the running containers, use the following command:

docker-compose down

This command will stop and remove the containers, but the data will remain intact in the volumes.

Conclusion

With Docker and Docker Compose, installing ERPNext becomes straightforward and efficient. This setup provides an easy way to manage and scale your ERPNext instance, making it ideal for both development and production environments.








Open-source Apps

9,500+

Medical Apps

500+

Lists

450+

Dev. Resources

900+

Read more