Steps to Install ERPNext v14 on Ubuntu v22.04 Successfully

Hello Frappe Family …

In this post, we will take a step-by-step approach to install ERPNext v14 in Ubuntu v22.04 OS without any problems and with providing the solutions to any problem you faced.

I decided to share the method with you, for two reasons, first to be as generous as the Frappe team and share the knowledge we have, and also because of noticing that recently several posts have been published for the same problems.


Installation Prerequisites:
These are the minimum prerequisites to get an optimal functionality of ERPNext on your server.

Software Requirements:
Updated Ubuntu 22.04
A user with sudo privileges
Python 3.10+
Node.js 16

Hardware Requirements:
4GB RAM
40GB Hard Disk

Common Errors:
1- error: <class ‘PermissionError’>, [Errno 13] Permission denied: file: /usr/lib/python3/dist-packages/supervisor/xmlrpc.py line: 560

2- INFO: App moved from apps/hrms to archived/apps/hrms-2022-09-08
Getting hrms
Please update your node version to 14 yarn run v1.22.19


Let’s Go …

1-sudo apt-get update -y && sudo apt-get upgrade -y
2- sudo adduser frappe
3- usermod -aG sudo frappe
4- su frappe
5- cd /home/frappe
6- sudo apt-get install git
7- sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils
8- sudo apt-get install python3.10-venv
9- sudo apt-get install software-properties-common
10- sudo apt install mariadb-server mariadb-client
11- sudo apt-get install redis-server
12- sudo apt-get install xvfb libfontconfig wkhtmltopdf
13- sudo apt-get install libmysqlclient-dev

14- sudo mysql_secure_installation

Enter current password for root: (Enter your SSH root user password)
-Switch to unix_socket authentication [Y/n]: Y
-Change the root password? [Y/n]: Y
It will ask you to set new MySQL root password at this step. This can be different from the SSH root user password.

-Remove anonymous users? [Y/n] Y
-Disallow root login remotely? [Y/n]: N
This is set as N because we might want to access the database from a remote server for using business analytics software like Metabase / PowerBI / Tableau, etc.

-Remove test database and access to it? [Y/n]: Y
-Reload privilege tables now? [Y/n]: Y

15- sudo nano /etc/mysql/my.cnf

Add the below code block at the bottom of the file:
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

16- sudo service mysql restart
17- sudo apt install curl
18- curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
19- source ~/.profile
20- nvm install 16.15.0
21- sudo apt-get install npm
22- sudo npm install -g yarn
23- sudo pip3 install frappe-bench
24- bench init --frappe-branch version-14 frappe-bench
25- cd frappe-bench
26- chmod -R o+rx /home/frappe
27- bench new-site site1.local
28- bench get-app payments
29- bench get-app --branch version-14 erpnext
30- bench get-app hrms
31- bench --site site1.local install-app erpnext

32- bench --site site1.local install-app hrms

(If you faced error in HRMS installation)

32.1- sudo npm cache clean -f
32.2- sudo npm install -g n
32.3- sudo n stable
32.4- sudo n latest

(If you faced error permission 560)
Go to:
sudo nano /etc/supervisor/supervisord.conf

(Add these lines under [unix_http_server])

chmod=0760
chown=frappe:frappe

and repeat the 26 line:

26- chmod -R o+rx /home/frappe

33- bench start
34- bench --site site1.local enable-scheduler
35- bench --site site1.local set-maintenance-mode off

Here the system will be installed successfully but in developer mode, to convert it to Production complete the following steps:

“Switch to Production”

36- sudo bench setup production frappe
37- bench setup nginx
38- sudo supervisorctl restart all
39- sudo bench setup production frappe

And here we will be able to installed ERPNext with HRMS without any errors, if all the previous steps are applied without skipping any step.

9 Likes

You miss payments app to install after erpnext and before hrms.

32 - bench --site site1.local install-app payments

Hi,

This post is an exact copy-paste duplicate of the original post here :point_down:

Please avoid creating duplicate threads.

The post is not a copy-paste of the same referenced post, It just seems to have been copied and that is a sure thing because it is the same steps.
There are many posts and many external sites with the same steps and the same order, only I have added solutions to the problems that anyone who installs may encounter.

This is one of the sites that the steps were quoted from.

And there are many websites that have the same steps, and as I mentioned earlier, that is because it is normal for the same steps to be repeated because the system needs the same programs and utilities.

I hope you understand before you rush into making decisions.

Thank you

Hi,

That article link that you have shared is in itself copied from the original post. You can see that from the mysql installation section where explanation for the questions were given.

Article date: 18-Aug-22. This :point_down:

Which again is exactly copied in your post above (date 11-Oct-22). This :point_down:

And the original post was dated (06-Aug-22). This :point_down:

There is nothing against sharing information as long as it’s useful to the community users but just blatantly copying it around and re-sharing it doesn’t help anyone here and creates unnecessary duplicates and adds to the further confusion.

Dear @shashank_shirke,

First, thank you for your clarification. I agree with you that it is possible that he copied your article, but it is possible that I took it from his article and not your article, because it is more recent and the first thing that appears to me in the research.
As it is possible to quote some things from outside the forum without mentioning the source, but because I took something from the same place without mentioning the source.

I want to make it clear that there is no need to argue, especially since the issue is for the benefit of all.

Thank you for your understanding.

Thank you so much for having a complete setup instructions with the fixes. I was running frustrated with the errors. Your contribution is a life saver.

1 Like

@shashank_shirke, Are there any minimal steps available to get rid of V14?
I struggle to install it and faced an issue at many steps. Maybe my OS issues or Steps?

is this the issue? > No VM guests are running outdated hypervisor (qemu) binaries on this host.

Please make a post of Guide.

Thanks,
Suresh

@Suresh_Thakor Try this script:

Minimal effort with guaranteed install success.

2 Likes

Great effort. But it doesn’t work. I followed the instructions installing it on unbuntu 22.04 but it doesn’t work. At end the SH just auto closes but i can’t access the installation either with the IP or the web URL.

This is due to the way the error handler works. I am working to refactor the error handler but in the mean time the script closing means there was an error encountered during the install. I have disabled the error handler now and if you download the latest version and run it you will be able to see at what point the install failed for you. You can then share the error with me to help you identify why you are facing an error with the install.