Install ErpNext with docker

Step-by-step process of installing the ERPNext application using Docker, a powerful platform for containerization. By the end of this tutorial, you will have two containers up and running seamlessly on your system:

ERPNext Application (Version 14)

First and foremost, we'll set up the ERPNext application, an open-source and feature-rich enterprise resource planning solution. With version 14, you'll get access to the latest enhancements, features, and security updates, ensuring a smooth and efficient experience for your business processes.

MariaDB (Latest Version)

Additionally, we will deploy a MariaDB container, which is a robust and high-performance open-source database management system. You also have the flexibility to choose any specific version of MariaDB according to your requirements. This containerized database will seamlessly integrate with ERPNext, ensuring reliable data storage and retrieval.

Throughout this tutorial, I will walk you through the entire installation process, explaining each step in detail. By the end, you'll have a fully functional ERPNext application environment, ready to streamline your business operations.

Setup

Create docker network

docker network create erpnet

Run MariaDB container

copy the below content at in my case /home/ubuntu/conf or create a file mariadb.cnf & paste in it.

[mysqld]

# GENERAL #
user                           = mysql
default-storage-engine         = InnoDB
socket                         = /var/lib/mysql/mysql.sock
pid-file                       = /var/lib/mysql/mysql.pid

# MyISAM #
key-buffer-size                = 32M
myisam-recover                 = FORCE,BACKUP

# SAFETY #
max-allowed-packet             = 256M
max-connect-errors             = 1000000
innodb                         = FORCE

# DATA STORAGE #
datadir                        = /var/lib/mysql/

# BINARY LOGGING #
log-bin                        = /var/lib/mysql/mysql-bin
expire-logs-days               = 14
sync-binlog                    = 1

# REPLICATION #
server-id                      = 1

# CACHES AND LIMITS #
tmp-table-size                 = 32M
max-heap-table-size            = 32M
query-cache-type               = 0
query-cache-size               = 0
max-connections                = 500
thread-cache-size              = 50
open-files-limit               = 65535
table-definition-cache         = 4096
table-open-cache               = 10240

# INNODB #
innodb-flush-method            = O_DIRECT
innodb-log-files-in-group      = 2
innodb-log-file-size           = 512M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table          = 1
innodb-buffer-pool-size        = 5462M
innodb-file-format             = barracuda
innodb-large-prefix            = 1
collation-server               = utf8mb4_unicode_ci
character-set-server           = utf8mb4
character-set-client-handshake = FALSE
max_allowed_packet             = 256M

# LOGGING #
log-error                      = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes  = 0
slow-query-log                 = 1
slow-query-log-file            = /var/lib/mysql/mysql-slow.log

# CONNECTIONS #

pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
bind-address    = 0.0.0.0

[mysql]
default-character-set = utf8mb4

[mysqldump]
max_allowed_packet=256M

[client]
default-character-set = utf8mb4		

Now run the below command

set the database root password, otherwise pass will be 1QWERT2
docker run -it --net erpnet --name erpdb -e MYSQL_ROOT_PASSWORD=1QWERT2 -v /home/ubuntu/conf:/etc/mysql/conf.d -d 1devops2/erpnextdb:14

Run Frappe container

docker run -it --network erpnet --name erp -p 8000:8000 -p 9000:9000 -p3306:3306 -d 1devops2/erpnext:14

Exec into frappe container

docker exec -it erp bash

run below commands, one by one:

cd frappe-bench && bench new-site erp.net --admin-password '321' --mariadb-root username root --db-host erpdb
it will ask for database password, so as mentioned above pass 1QWERT2
Install the erp-app
bench --site erp.net install-app erpnext

erp.net is the site name whatever u can select <your-domian.com>

Install posawesome

bench get-app branch version-14 https://github.com/yrestom/POS-Awesome.git
bench setup requirements
bench build --app posawesome
bench --site erp.net install-app posawesome

start the bench

cd /home/frappe/frappe-bench/sites && echo 'erp.net' >currentsite.txt 
cd /home/frappe/frappe-bench && bench start

Access Points

http://<your-ip>:8000

Ports

3306 8000 9000