Written by 7:22 am How-tos, Modern Business, Show me the code

Install ErpNext on Ubuntu 20.04

Introduction

ERPNext is a free and open source ERP based on Frappe framework.

This text is about installing ErpNext in an Ubuntu machine.

Prerequisites

123456789101112131415# you may want to update the systemsudo apt-get update -y && sudo apt-get upgrade -y # prerequisites 1sudo apt install git curl libffi-dev python-dev build-essential python3-distutils python3-setuptools python3-pip python3-testresources libssl-dev wkhtmltopdf redis -y # prerequisites 2sudo apt-get install xvfb libfontconfig # NodeJScurl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get install -y nodejs sudo npm install -g yarn         # yarn package manager, npm alternative

MariaDB

You may find instructions on how to install MariaDB in a previous post.

Remember to not leave a blank password for the MariaDB’s root account. ErpNext uses username and password of the root account in order to connect to the database.

Also you need to configure MariaDB’s character-set and collation.

Use a text editor to open the file /etc/mysql/my.cnf and add the following lines.

1234567[mysqld]character-set-client-handshake = FALSEcharacter-set-server = utf8mb4collation-server = utf8mb4_unicode_ci [mysql]default-character-set = utf8mb4

Save the file and restart the MariaDB service.

1service mysql restart

Ensure services are running

1234service mysql restartservice redis restart service --status-all    # check running services

Linux user for ErpNext

12345678910111213141516171819# add the usersudo useradd -m -s /bin/bash erpnext sudo passwd erpnext         # password is set to erpnext # add to sudoerssudo usermod -aG sudo erpnext # update the path variable for the user erpnextsudo su - erpnextwhoami                          # just to check # copy and paste all the following 3 lines to terminaltee -a ~/.bashrc<<EOFPATH=\$PATH:~/.local/bin/EOF # activate the environment variablesource ~/.bashrc

ErpNext folder

123456# switch to root  su - root # create a folder for ERPNext setup and give erpnext user read and write permissions sudo mkdir /opt/benchsudo chown -R erpnext /opt/bench

Frappe-Bench

1234567891011sudo su - erpnextcd /opt/bench # install benchsudo pip3 install frappe-bench # initialize benchbench init erpnext # display the versionbench --version

Create a new Frappe site

123456cd erpnext # WARNING: MariaDB root user should have a NOT BLANK password # bench new-site YOUR_DOMAIN --admin-password 'ERP_NEXT_ADMIN_PASSWORD' --mariadb-root-username 'MARIA_DB_ROOT' --mariadb-root-password 'MARIA_DB_ROOT_PASSWORD'bench new-site my-site.my-company.com

Download and install ErpNext

123bench get-app erpnext https://github.com/frappe/erpnext.git bench --site my-site.my-company.com install-app erpnext

The currentsite.txt must exist

Go to /opt/bench/erpnext/sites. If there is not a currentsite.txt file, create it with the following content.

1my-site.my-company.com

Start the site

1bench start

A series of messages is displayed in the terminal and after a while a message saying that ErpNext is waiting for changes, e.g. Waiting for changes.... You now may open a browser and connect to you ErpNext site.

To connect locally use any of the following:

12http://localhost:8000http://127.0.0.1:8000

The default user-name and password are:

12Administratoradmin

To stop the site just type Ctrl + C

To start the site any other time

12345sudo su - erpnext cd /opt/bench/erpnext bench start

Tested on:

  • Ubuntu 20.04
  • ErpNext 13
(Visited 35 times, 1 visits today)
Share the Post
Last modified: May 24, 2022
Close