How to Install ERPNext on Ubuntu 18.04

We explain to you how to Install ERPNext on Ubuntu 18.04 manually. Specially for those who have facing issue while Install ERPNext on Ubuntu using script. But in this article, explain to you how to install ERPNext on Ubuntu 18.04 manually.

Install ERPNext on Ubuntu 18.04

Before we start installing, we have to know about what is ERPNext? ERPNext is a free and open-source integrated web-based ERP software developed by Frappe. ERPNext is used by manufacturers, distributors and services companies. In ERPNext offer large number of Apps like accounting, sales, CRM, purchasing, and many more. So let’s start how to install ERPNext on Ubuntu 18.04 manually.

Steps for Install ERPNext on Ubuntu 18.04

Step 1 Update and Upgrade APT

Update APT list of available packages and their versions. And use upgrade command to actually installs newer versions of the packages.

sudo apt-get update && sudo apt-get upgrade

Step 2 Install Python

First of all, you have to install Python 2.7 for ERPNext. Moreover, you can also verify Python version.

sudo apt -y install python-minimal
$ python -V
Python 2.7.15rc1

Step 3 Install Dependencies

You have to install the following dependencies.

sudo apt -y install git build-essential python-setuptools python-dev libffi-dev libssl-dev

Step 4 Install Python pip Tool

You need to execute the following command to install pip package manager.

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

Execute the following command to verify that you have the latest version of pip and setuptools.

sudo pip install --upgrade pip setuptools

Install the ansible module using pip. Ansible pip module automates manage Python libraries and configuration.

sudo pip install ansible

Step 5 Install curl and yarn

First, you have to install curl.

sudo apt -y install curl

Later you have to configure the yarn package repository.

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Next, execute the following command to install yarn.

sudo apt -y update && sudo apt -y install yarn

Step 6 Install MariaDB

You have to run the following command to install MariaDB.

sudo apt -y install mariadb-server libmysqlclient-dev

When creating ERPNext database, you need to enable barracuda storage engine. So you need first to configure MariaDB configuration my.cnf file.

sudo nano /etc/mysql/my.cnf

Add the following lines at the end of my.cnf file.

[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_unicode_ci

[mysql]
default-character-set = utf8mb4

Next, you have to restart MariaDB and enable it to auto start MariaDB at boot time.

sudo systemctl restart mariadb
sudo systemctl enable mariadb

Use the mysql_secure_installation tool to configure additional security options.

sudo mysql_secure_installation

This tool will ask if you want to set a new password for the MySQL root user and few security related questions.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!

Security questions, answer Y at the following prompts:

  • Remove anonymous users?
  • Disallow root login remotely?
  • Remove test database and access to it?
  • Reload privilege tables now?

Step 7 Install Nginx, Node.js and Redis

You have to add the Node source Node.js 8.x repository.

sudo curl --silent --location https://deb.nodesource.com/setup_8.x | sudo bash -

To install Nginx, Node.js and Redis on Ubuntu, run the commands below.

sudo apt -y install nginx nodejs redis-server

After installing, start and enable Nginx service to always start up with the boots.

sudo systemctl start nginx
sudo systemctl enable nginx

Start and enable Redis service to always start up with the boots.

sudo systemctl start redis-server
sudo systemctl enable redis-server

Step 8 Install wkhtmltopdf and fonts

Execute the following command to install wkhtmltopdf, fonts and other required dependencies.

sudo apt -y install libxrender1 libxext6 xfonts-75dpi xfonts-base

Download the compressed file of wkhtmltopdf and extract to /opt path.

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
sudo tar -xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -C /opt

Next, you have to create a soft link to access and execute wkhtmltopdf and wkhtmltoimage globally as a command.

sudo ln -s /opt/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
sudo ln -s /opt/wkhtmltox/bin/wkhtmltoimage /usr/bin/wkhtmltoimage

Even more, you can check version of wkhtmltopdf.

$ wkhtmltopdf -V
wkhtmltopdf 0.12.4 (with patched qt)

Step 9 Install and Create Virtual Environment

A virtual environment is a tool that helps to keep separate dependencies by different projects to creating isolated python virtual environments for them. A virtual environment is the essential tools that most of the Python developers use.

First of all, in your home directory create new folder. Go to that folder.

mkdir erpnext
cd erpnext/

Run below command to install virtual environment.

sudo apt install virtualenv

Furthermore, you need to create virtual environment on “erpnext” directory using the following command.

virtualenv .

Even more, you have to activate virtual environment using below command.

source ./bin/activate

Step 10 Install Bench

Bench is a command line utility to install, manage multiple sites and manage the ERPNext application on a Unix-based system.

git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo

Step 11 Create a new bench

The init command will create a bench directory with frappe framework installed.

bench init --frappe-branch master --frappe-path https://github.com/frappe/frappe.git frappe-bench

Now you have to go frappe-bench directory,

cd frappe-bench/

Step 12 Get ERPNext Apps

Bench get-app command gets remote frappe apps from a remote git repository and installs them.

bench get-app --branch master erpnext https://github.com/frappe/erpnext.git

Step 13 Create new site

Frappe sites run frappe apps. So you have to create at least one site. Using the following command to create a new site.

bench new-site testsite

Step 14 Install Apps (Install ERPNext on Ubuntu 18.04)

Use the bench install-app command to install an app on your site.

bench --site testsite install-app erpnext

Step 15 Start bench

Use the bench start command to start using the bench.

bench start

Finally, go to your web browser open your server IP address with 8000 port number http://0.0.0.0:8000 and you will see the ERPNext login screen. Here you have to log in with username “administrator” and password as per you set when you created the new site.

Final Thoughts (Install ERPNext on Ubuntu 18.04)

This article walked you through the install ERPNext on Ubuntu 18.04 manually with install all prerequisites install step by step guide you. However, you can go thru this article to install ERPNext using the installation script.

Here you can find a list of ERPNext bench command. Moreover, you can explore here other ERPNext related posts.

If you like our article, please consider buying a coffee for us.
Thanks for your support!

Support us on Buy me a coffee! Buy me a coffee!



18 Responses Leave a Comment

  1. I have follow above steps. But I’m stuck on Step 13. It throw me pymysql.err.InternalError: (1698, u”Access denied for user ‘root’@‘localhost’”)
    Any idea how to fix it?

    1. blank
      SpeedySense Editorial May 30, 2019 at 11:12 PM

      Probably, you enter the wrong password. Better to reset the root user password to solve this issue.

      Refer to this discussion and execute the query for update root user password.

      1. Yeah its works, Thanks

    2. Hi I stuck on level 14. It says erpnext not found

      1. blank
        SpeedySense Editorial February 29, 2020 at 10:12 AM

        Make sure you run step 12 or you should try same error in google.

  2. I stucked at Step 11, bench command doesnt work with root user, but we didnt create a user before.

    1. blank
      SpeedySense Editorial August 3, 2019 at 12:16 AM

      Bench command you can’t execute with root user. If you are try to installing locally then you might need to execute bench command with your system user.

      Or if you try to install on server you might need to follow Install ERPNext on Ubuntu 18.04 Server.

    2. #create a new user –
      adduser username

      #then add root permissions:
      usermod -aG sudo username

      #then login as that username
      su – username

      try the step again.

  3. hey,
    This steps if for installing Erpnext on VPS?

    1. blank
      SpeedySense Editorial December 23, 2019 at 7:18 PM

      Yes, you can follow this instructions to Install Erpnext in your VPS.

  4. Hi, I am stuck with Step 7 and can’t install the Redis server.

    1. blank
      SpeedySense Editorial January 4, 2020 at 6:47 PM

      Hi Mark, can you try to find this error reason on ERPNext communities and Google.

      1. hello, I really appreciate with your work. I have followed your steps for instaling erpnext. it worked and i am now using it. But, the erpnext which i am using is Version 11. I am thinking of upgrading from V11 to V12. i tried running this command-
        (erpnext)user@user-virtualbox:~/erpnext/frappe-bench$ bench switch-to-branch version-12 && bench update –patch
        It seems like i am getting errors.

        Please do suggest how to do so. I am hoping that you would come up with the solution. Thanks in advance.

  5. Hi
    Are they not moving their dependencies to python3?

  6. I appreciate your effort but this installation is pretty complicated. I was constantly getting python based errors during the installation. So I tried using bitnami version of ERPnext and It worked fine without much installation difficulties.

    This article is good for those are expert at solving mysterious bugs. Otherwise I’ll suggest to go with bitnami.

  7. Hi Is it possible if i can install ERPnext a new machine and mariadb on a new one then connect both of them.

  8. Hi is there any video to Install ERPNext on Ubuntu 18.04 ?
    please provide it would be very helpfull.

  9. Hi,
    i have followed all the steps correctly and everything went well. At the 15th step after installing ERPNext in ubuntu, when i run the command “bench start” i am getting this error. Please help..

    [ERROR] Procfile does not exist or is not a file

Join the Discussion.