Easy install setup guide for erpnext installation on Ubuntu 20.04 LTS

Hello friends,

I am recreating this post because the existing post was too long to follow :

I was struggling to install ERPNEXT with easy install method. I almost spend 3-4 days to know why it is not working finally with lots of tweaks and turns i managed to install it. (Thanks to the lockdown i was able to spare the time to troubleshoot the issue in detail.)

  1. Fresh installation of Ubuntu 20.04
  2. Creations of user with sudo rights.
     sudo adduser *Your_USERNAME* 
     sudo usermod -aG sudo *Your_USERNAME*
  1. Use this cmd to get your install.py
wget https://raw.githubusercontent.com/frappe/bench/develop/install.py
  1. Updating the install.py in order to support Ubuntu 20.04, by default the script is made for Ubuntu <=18.04.
    By the way with ubuntu 20.04 python 3.8 comes installed. And hence the platform.dist() is no more supported by the python3.8.

To help the installation we have to do the following modifications in the install.py,

On line 81 : Change ’ ubuntu’: [14, 15, 16, 18, 19], to ‘ubuntu’: [14, 15, 16, 18, 19, 20],
On line 100 : Change current_dist = platform.dist() to current_dist = [“Ubuntu”, “20.04”]

This will get you started with installation.

  1. Always install it with --verbose on to know where the problem is occurring.

The famous “returned non-zero exit status 1” error will bother you but don’t worry --verbose will tell you why this is not working.

In my case I used following cmd : sudo python3 install.py --production --user Your_USERNAME --mariadb-version 10.5 --verbose

Note mariadb version 10.5 was used since default 10.2 is not supported by ubuntu 20.04

Lot of people is having this error but nobody was able to knows where does this error come from. Thanks to --verbose it will help troubleshooting.

In my case i had to tweak the following files to make it through.

Note : Every time the installation fails solve the error and rerun the sudo python3 install.py --production --user Your_USERNAME --mariadb-version 10.5 --verbose

Most of the errors were coming from playbooks

  1. If you get libssl error.

Since libssl1.0-dev is not supported by Ubuntu 20.04 you need to do following.

go to /tmp/ .bench/playbooks/roles/common/tasks/ubuntu.yml

sudo nano ubuntu.yml

Line 36 : Change from - libssl1.0-dev to - libssl1.1

Again libssl1.0 does not support ubuntu 20.04. Ubuntu 20.04 comes installed with libssl1.1, if not install it.

  1. If you get Nodejs error, “Error mentioning no supported version found for the distribution”

Nodejs version 12.x works with ubuntu20.04. We need to fix playbook for this.

go to /tmp/ .bench/playbooks/roles/nodejs/tasks/ debian_family.yml

sudo nano debian_family.yml

Line 6 : Change from - "curl --silent --location https://deb.nodesource.com/setup_ {{ node_version }}.x | bash -"
TO "curl --silent --location https://deb.nodesource.com/setup_12.x | bash -"

Line 8 : Change from - name: Install nodejs {{ node_version }}

TO

- name: Install nodejs 12

--------------------------------------------//--------------------------------------------------------------------

go to /tmp/ .bench/playbooks/roles/nodejs/tasks/ redhat_family.yml

sudo nano redhat_family.yml

Line 6 : Change from "curl --silent --location https://rpm.nodesource.com/setup_{{ node_version }}.x | sudo bash -"
TO "curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -"

Line 8 : Change from - name: Install node v{{ node_version }}
TO - name: Install node v12

  1. If you get wkhtmltopdf error.

Then go to https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb
download the wkhtmltox_0.12.5-1.focal_amd64.deb file rename it to wkhtmltox.deb

And the copy or move this file to /tmp folder.

I am not a professional coder so any mistakes or wrong way of doing things in above method should be highlighted and your feedback is appreciated.

  1. If you face ModuleNotFoundError: No module named ‘erpnext .

Follow this https://medium.com/@binodpaneru23/setting-up-erpnext-in-mac-os-c475466f5403

Based on this doc I used

frappe-bench/env/bin/pip3 install -U -e ./apps/erpnext

Thanks @arun992 for steps 5 and 6

  1. if you get stuck with Cython is required to compile pandas from a development branch. error.
    Check this post [https://github.com/frappe/erpnext/issues/22424 ]

Based on this doc use the following commands:

frappe-bench/env/bin/pip3 install pandas==0.24.2
frappe-bench/env/bin/pip install numpy==1.18.5

After this use

frappe-bench/env/bin/pip3 install -U -e ./apps/erpnext

Oncef inished the erpnext installationcontinue with the command

sudo frappe-bench/env/bin/python3 temp --production --user frappe --mariadb-version 10.5 --verbose

Hope this will help people to enjoy the sweet fruit of ERPNEXT.

7 Likes