(Last Updated On: July 19, 2018)

ERPNext is a simple yet free and open source ERP system written using Frappe framework – a full-stack web app framework in Python & JavaScript. In this guide, we will cover How to Install ERPNext ERP System on Ubuntu 18.04. ERPNext is a feature-rich enterprise ready ERP system which has good features like:

  • Accounting Management
  • Inventory Management
  • Manufacturing Management
  • Customer Relationship Management system
  • Sales Management
  • Purchase Management
  • Project Management
  • Huma Resource Management System and more.

ERPNext ERP system is fit for both small and medium enterprises. It comes with a well-baked web interface with all functionalities of an ERP system.

ERPNext Setup Pre-requisites:

  • Updated Ubuntu 18.04 Bionic Beaver Linux
  • A user with sudo privileges
  • Python 2.7 [Python3.5+ also supported, but not recommended for production]
  • MariaDB Database Server
  • Nodejs, Nginx, yarn, redis, wkhtmltopdf

Install ERPNext ERP System on Ubuntu 18.04

Let’s start ERPNext installation by making sure our system is updated:

$ sudo apt-get update
$ sudo apt-get upgrade

It is recommended to reboot your system whenever you do upgrade:

$ sudo reboot

Step 1: Install Python Tools & wkhtmltopdf

Start the installation process by ensuring all Python build packages required to build and setup ERPNext are installed:

$ sudo apt-get install libffi-dev python-pip python-dev libssl-dev wkhtmltopdf

Step 2: Install Redis and Node.js

To install Redis and Node.js on Ubuntu 18.04, run the commands:

$ sudo curl --silent --location https://deb.nodesource.com/setup_8.x \
| sudo bash -
$ sudo apt-get install gcc g++ make
$ sudo apt-get install -y nodejs redis-server
$ sudo npm install -g yarn

Step 3: Install Nginx web server and MariaDB Database server

Next step is to Nginx and MariaDB for serving ERPNext and storing database data respectively.

Install Nginx using:

$ sudo apt-get install nginx

For installation of MariaDB server on Ubuntu 18.04, refer to our guide: Install MariaDB 10.3 on Ubuntu 18.04 and CentOS 7.

Ensure you have the following settings for mysqld and mysql client as provided:

$ cat /etc/mysql/mariadb.cnf 

# MariaDB-specific config file.
# Read by /etc/mysql/my.cnf

# Default is Latin1, if you need UTF-8 set this (also in server section)
#default-character-set = utf8 

character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

default-character-set = utf8mb4

# * Character sets
# Default is Latin1, if you need UTF-8 set all this (also in client section)
#character-set-server  = utf8 
#collation-server      = utf8_general_ci 
#character_set_server   = utf8 
#collation_server       = utf8_general_ci 
# Import all .cnf files from configuration directory
!includedir /etc/mysql/mariadb.conf.d/

After the installation of MariaDB database server, you should create a database for erpnext user.

Log in and Create Mysql Database

$ mysql -u root -p

Create a database and grant the user all permissions to manage the DB.

MariaDB [(none)]> create user [email protected] identified by 'password123';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> create database erpnext;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> grant all privileges on erpnext.* to 'erpnext'@'localhost' with grant option;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> \q;

Step 4: Install Bench and ERPNext

A bench is a tool used to install and manage ERPNext on your Ubuntu system. We will create a user that will run the ERPNext system, then configure the system.

$ sudo useradd -m -s /bin/bash erpnext
$ passwd erpnext
$ sudo usermod -aG sudo erpnext
$ su - erpnext
$ vim /home/erpnext/.bashrc

Create a directory for ERPNext setup and give erpnext user read and write permissions to the directory:

$ sudo mkdir /srv/bench
$ sudo chown -R erpnext /srv/bench

Next switch to erpnext user and install the application:

$ su - erpnext
$ cd /srv/bench

Clone Bench code from github using git

# git clone https://github.com/frappe/bench bench-repo
Cloning into 'bench-repo'...
remote: Counting objects: 5832, done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 5832 (delta 20), reused 20 (delta 6), pack-reused 5783
Receiving objects: 100% (5832/5832), 29.61 MiB | 17.62 MiB/s, done.
Resolving deltas: 100% (3720/3720), done.

Now install bench using pip command:

# sudo pip install -e bench-repo

The next step is to initialize the bench directory with frappe framework installed:

$ cd /srv/bench
$ bench init erpnext
$ cd erpnext

A sample output is:

Building frappe assets...

✔ Built js/print_format_v3.min.js
✔ Built js/web_form.min.js
✔ Built css/module.min.css
✔ Built css/form.min.css
✔ Built frappe/css/email.css
✔ Built js/dialog.min.js
✔ Built css/frappe-rtl.css
✔ Built css/web_form.css
✔ Built css/report.min.css
✔ Built css/list.min.css
✔ Built js/form.min.js
✔ Built js/report.min.js
✔ Built js/list.min.js
✔ Built css/frappe-web.css
✔ Built js/desk.min.js
✔ Built js/control.min.js
✔ Built css/desk.min.css
✔ Built js/frappe-web.min.js
✨  Done in 52.706s

Building frappe_io assets...

✔ Built frappe_io/js/docs.js
✨  Done in 7.336s
Done in 60.73s.
INFO:bench.utils:setting up backups
no crontab for erpnext
INFO:bench.utils:setting up auto update
Bench frappe-bench initialized

Create a new Frappe site.

$ bench new-site  erp.computingforgeeks.com 
MySQL root password: 

Installing frappe...
Updating DocTypes for frappe        : [========================================]
Updating country info               : [========================================]
Set Administrator password: 
Re-enter Administrator password: 
*** Scheduler is disabled ***

The above command will ask you to provide the MySQL root password and set a new password for the administrator account for the web interface.

Non-interactive commands will be like below:

bench new-site  erp.computingforgeeks.com --db-name erpnext \
--mariadb-root-username root --mariadb-root-password password \
--install-app erpnext --verbose --force

Wait for the new Frappe site to be created, then

Starting ERPNext application and access UI

Once the application is deployed, you can start it using the command:

$ bench start

When the program is running, you should get:

12:49:02 redis_queue.1    | 30491:M 18 Jul 12:49:02.630 * Ready to accept connections
12:49:03 socketio.1       | listening on *: 9000
12:49:08 web.1            |  * Running on (Press CTRL+C to quit)
12:49:09 web.1            |  * Restarting with inotify reloader
12:49:09 watch.1          | yarn run v1.7.0
12:49:09 watch.1          | $ node rollup/watch.js
12:49:09 web.1            |  * Debugger is active!
12:49:09 web.1            |  * Debugger PIN: 849-623-753
12:49:10 watch.1          | 
12:49:10 watch.1          | Rollup Watcher Started
12:49:10 watch.1          | 

From the output, you can confirm the service is running on To access the web interface, open the server IP address and port http://ip-address:8000.

You should get a page to login. Use the username Administrator and the password you provided during setup.

Select the language of your choice and click “Next“. Next select country, it will fill currency automatically.

Add the first user with email and password and click “Complete Setup” button.

When done, you should get to ERPNext web dashboard.