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 system sudo apt-get update -y && sudo apt-get upgrade -y # prerequisites 1 sudo apt install git curl libffi-dev python-dev build-essential python3-distutils python3-setuptools python3-pip python3-testresources libssl-dev wkhtmltopdf redis -y # prerequisites 2 sudo apt-get install xvfb libfontconfig # NodeJS curl -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 = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci [mysql] default-character-set = utf8mb4 |
Save the file and restart the MariaDB service.
1 | service mysql restart |
Ensure services are running
1234 | service mysql restart service redis restart service --status-all # check running services |
Linux user for ErpNext
12345678910111213141516171819 | # add the user sudo useradd -m -s /bin/bash erpnext sudo passwd erpnext # password is set to erpnext # add to sudoers sudo usermod -aG sudo erpnext # update the path variable for the user erpnext sudo su - erpnext whoami # just to check # copy and paste all the following 3 lines to terminal tee -a ~/.bashrc<<EOF PATH=\$PATH:~/. local /bin/ EOF # activate the environment variable source ~/.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/bench sudo chown -R erpnext /opt/bench |
Frappe-Bench
1234567891011 | sudo su - erpnext cd /opt/bench # install bench sudo pip3 install frappe-bench # initialize bench bench init erpnext # display the version bench --version |
Create a new Frappe site
123456 | cd 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
123 | bench 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.
1 | my-site.my-company.com |
Start the site
1 | bench 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:
The default user-name and password are:
12 | Administrator admin |
To stop the site just type Ctrl + C
To start the site any other time
12345 | sudo su - erpnext cd /opt/bench/erpnext bench start |
Tested on:
- Ubuntu 20.04
- ErpNext 13