If you are a non-techy or do not want the headache, I can offer to install it for you. You can just put a comment on this post or reach me out on Twitter at @ghulamostafa.
For ERPNext REST API calls please click here.
ERPNext is a free, open-source ERP system written in the Frappe framework. Simple yet powerful, it is designed for small and medium businesses that support retail, trading, services, manufacturing, distribution, non-profits and other sectors.
It is built with open source tools and offer features that can be used to run your business and collaborate with your customers and employees.
It also comes with a simple and user-friendly web interface with all functionalities of an ERP system.
DigitalOcean Droplet
We will go through a step by step tutorial on installing ERPNext on Ubuntu 20.04. For this article, we will use a virtual machine (droplet) from DigitalOcean. We will install a production version of ERPNext with 2GB RAM and 2 CPUs.

On creation of the Droplet, we will be a given a public IP address and we will access our virtual machine using Putty.

On logging in the machine run the following commands to upgrade all installed packages:
apt-get update -y
apt-get upgrade -y
Install required dependencies
First, you will need to install Python and other packages required to build and set up ERPNext. You can install them using the following command:
apt-get install libffi-dev python3-pip python3-dev python3-testresources libssl-dev wkhtmltopdf gcc g++ make -y
Install Node.js
ERPNext uses Node.js for its frontend, therefore you will need to install it on your server. First, add the Node.js version 12 repository using the following command:
curl -sL https://deb.nodesource.com/setup_12.x | bash -
Once the repository is added, run the following command to install Node.js and Redis server in your system.
apt-get install nodejs redis-server -y
Once both packages are installed, you can verify the Node.js version using the following command:
node --version
Next, install the Yarn package by running the following command:
npm install -g yarn
Install and Configure MariaDB Server
First, install the MariaDB server by running the following command:
apt-get install mariadb-server mariadb-client -y
Once installed, secure the MariaDB and set the MariaDB root password with the following command:
mysql_secure_installation
Answer all the questions as shown below to set the MariaDB root password and secure the installation:
Enter current password for root (enter for none): Press your [Enter] key, there is no password set by default
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
Once the MariaDB is secured, log in to the MariaDB console with the following command:
mysql -u root -p
After login, change the MariaDB authentication plugin with the following command:
> USE mysql;
> UPDATE user SET plugin=\'mysql_native_password\' WHERE User=\'root\';
Next, flush the privileges and exit from the MariaDB shell with the following command:
> FLUSH PRIVILEGES;
> EXIT;
Next, you will need to change MariaDB Innodb file format to Barracuda. You can configure it by editing the file /etc/mysql/mariadb.conf.d/50-server.cnf
:
nano /etc/mysql/mariadb.conf.d/50-server.cnf
Add/Modify the following lines:
[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unipre_ci
In the same file, below you will find:
collation-server = utf8mb4_general_ci
Replace it with
collation-server = utf8mb4_unicode_ci
Save and close the file, then restart the MariaDB service to implement the changes:
systemctl restart mariadb
Create a User for ERPNext
Before starting, you will need to create a user to run the ERPNext.
Create a new user named erpnext
by running the following command:
useradd -m -s /bin/bash erpnext
Next, set the password with the following command:
passwd erpnext
Next, add the erpnext
user to the sudo
group so that it can run the superuser command:
usermod -aG sudo erpnext
Next, log in to the erpnext
user and set up the environment variables with the following command:
su - erpnext
nano ~/.bashrc
Add the following line (anywhere):
PATH=$PATH:~/.local/bin/
Save and close the file, then activate the environment variable with the following command:
source ~/.bashrc
Install ERPNext
Next, you will need to install bench tool to install and manage ERPNext on your system.
This should be done using the erpnext
user. Switch to erpnext
if you are still on root:
su - erpnext
Create a new directory for ERPNext setup with the following command:
sudo mkdir /opt/bench
Next, change the ownership to the erpnext
user:
sudo chown -R erpnext:erpnext /opt/bench
Next, change the directory to /opt/bench
and clone the bench repository from Git:
cd /opt/bench
git clone https://github.com/frappe/bench bench-repo
Next, install the bench repo using the pip3
command:
pip3 install -e bench-repo
Once installed, initialize the bench directory with Frappe framework using the following command:
bench init erpnext
You should see the following output:
✔ Built <many .js files will appear one by one> INFO:bench.utils:setting up backups SUCCESS: Bench erpnext initialized
Next, change the directory to erpnext
and download the erpnext app from GitHub with the following command:
bench get-app erpnext https://github.com/frappe/erpnext
After downloading the app, create a new frappe site with the following command:
bench new-site erpnext.example.com
You will be asked to provide your MariaDB root password, as shown below:
WARN: bench is installed in editable mode! This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench` MySQL root password:
Provide your password and hit Enter to create a new Frappe site:
Installing frappe... Updating DocTypes for frappe : [========================================] 100% Updating country info : [========================================] 100%
Next, you will be asked to set an administrator password, as shown below:
Set Administrator password: Re-enter Administrator password:
Then install ERPNext on Frappe
bench --site erpnext.ghulamustafa.com install-app erpnext
Now we have everything installed. It is time to set the production environment.
Production Environment and Public Access
In this section, we will install Supervisor to manage the ERPNext process and Nginx as a reverse proxy to access the ERPNext without using port 8000.
sudo apt-get -y install supervisor nginx
Next, install the frappe-bench add-on with the following command:
sudo pip3 install frappe-bench
Then change the path to to ERPNext folder by running the following command:
cd /opt/bench/erpnext
Next, run the following command to configure ERPNext for a production environment:
sudo /home/erpnext/.local/bin/bench setup production erpnext
You should see the following output:
Site erpnext.example.com assigned port: 80 $ sudo /usr/bin/supervisorctl reread erpnext-redis: available erpnext-web: available erpnext-workers: available $ sudo /usr/bin/supervisorctl update erpnext-redis: added process group erpnext-web: added process group erpnext-workers: added process group nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful $ sudo systemctl reload nginx
Now you should be able to access your ERPNext application using the DigitalOcean IP Address from a browser.
After the step by step configurations in browser for ERPNext, you should see the following:

Sometimes due to server load, the Setup of ERPNext may fail. For that purpose, you may increase the http_timeout value. Run the following commands inside erpnext folder:
Time Out Increase -bench config http_timeout 6000 -bench setup supervisor -bench setup nginx -sudo supervisorctl reload -sudo service nginx reload
Thank you for reading this article.
For mapping your DigitalOcean to your subdomain, please read the following article:
Leave a Reply