Installing ERPNext version 14 on Ubuntu 22+

ERPNext 14 released, and here the updated installation document. As CentOS dead ( or killed by IBM), Ubuntu becomes the de-facto OS for ERPNext hosting. These are the steps to install Frappe & ERPNext

 · 3 min read




An updated verion of this document is here https://cloud.erpgulf.com/blog/support-forum/installing-erpnext-version-15-on-ubuntu-23+

The new updated document covers Ubuntu 23+ and ERPNext and Frappe Version 15, along latest python and other components. If you are planning a new installation with new server environment, please use that link.



( If Ubuntu version of your instance is 20+, most probably your Python is 3.8 and node is 12. For Frappe and ERPNext version 14, it is mandatory to have Python 3.10 and Node 16+. We have explained the upgrading procedures in this document ( https://cloud.erpgulf.com/blog/support-forum/erpnext-upgrade-from-version-13-to-version-14-ubnutu . Use that document to prepare server. Please do that and come back here to continue. If you are not sure about Ubuntu version please type this command cat /etc/os-release )



Number Fourteen Rounded - Free vector graphic on Pixabay



( commands are in blue letters )


apt-get update -y

init 6  ( will restart )


sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils software-properties-common xvfb libfontconfig wkhtmltopdf libmysqlclient-dev -y

sudo apt-get install python3.10-venv -y


sudo apt install python-is-python3 -y


Test python installation and version at this stage

python3 -V ( result Python 3.10.4 )

python -V ( resulat Python 3.10.4 )


curl -sL https://deb.nodesource.com/setup_16.x | bash -

apt-get install nodejs redis-server -y


apt-get install cron git -y


Test NODE version at this stage, to make sure you have properly installed Node-16

node --version ( result must be : v16.17.0 )



npm install -g yarn

npm install -g npm@8.19.1


Check NPM version at this statem and make sure you installed npm properly

npm --version ( result must be : 8.19.1 )


Install Mariadb

apt-get install mariadb-server mariadb-client -y


check MariaDB version here

mariadb --version ( result must be mariadb Ver 15.1 Distrib 10.6.7-MariaDB, )


Set Mariadb security features correct

mysql_secure_installation


Enter current password for root (enter for none): Press your [Enter] key, there is no password set by default

Switch to unix_socket authentication N

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



Set Mariadb formats.


vim /etc/mysql/mariadb.conf.d/erpnext.cnf


Add these 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_unicode_ci


[mysql]

default-character-set = utf8mb4



systemctl restart mariadb


Next, we are going to create a user called "erpgulf" . Set its password, usermod, and sudo prvilege.


useradd -m -s /bin/bash erpgulf


passwd erpgulf


usermod -aG sudo erpgulf


su - erpgulf


Now you are inside the new user. Now let us set it's path.



vim ~/.bashrc

add this line

PATH=$PATH:~/.local/bin/




source ~/.bashrc


su - erpgulf

sudo mkdir /opt/bench


sudo chown -R erpgulf:erpgulf /opt/bench


cd /opt/bench

yarn add node-sass



Check yarn and node-sass at this point

yarn --version ( result must be:1.22.19 )

/opt/bench/node_modules/.bin/node-sass -v ( result must be: node-sass 7.0.1 (Wrapper) [JavaScript]

libsass 3.5.5 (Sass Compiler) [C/C++] )

npm node-sass -v ( Result must be: 8.19.1 )


Check pip3 version

pip3 --version ( Result must be pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )

pip --version ( Result must be pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )


Now we are entering to Frappe installation. Before that finish all the following tests ( in violet letters ) . Otherwise installation will fail

****************************************************

python -V ( result Python 3.10.4 )

node --version ( result must be : v16.17.0 )

npm --version ( result must be : 8.19.1 )

mariadb --version ( result must be mariadb Ver 15.1 Distrib 10.6.7-MariaDB, )

yarn --version ( result must be:1.22.19 )

/opt/bench/node_modules/.bin/node-sass -v ( result must be: node-sass 7.0.1 (Wrapper) [JavaScript] libsass 3.5.5 (Sass Compiler) [C/C++] )

npm node-sass -v ( Result must be: 8.19.1 )

pip3 --version ( Result must be pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )

pip --version ( Result must be pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )

redis-server --version (Redis server v=6.0.16 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=a3fdef44459b3ad6)

wkhtmltopdf —version ( wkhtmltopdf 0.12.6 )

git —version (git version 2.34.1)

/opt/bench/frappe-bench/env/bin/gunicorn --version ( result gunicorn (version 20.1.0)

***************************************************




pip3 install --user frappe-bench

 bench init frappe-bench --frappe-branch version-14


cd frappe-bench

 sed -i '/web:/ s/$/ --noreload/' Procfile

 bench start




While you are running the above command , you can see below

* Running on http://127.0.0.1:8000

14:29:30 web.1      | * Running on http://45.56.78.183:8000 (Press CTRL+C to quit)

Also, you can telnet to port 8000 to this server from outside.

telnet v14.erpgulf.com 8000 ( port will show open )


Press CTRL+C to return to CLI



bench new-site yourhost.example.com


At this point we have a frappe site running - bench start and you will get the website on port 8000. But ERPNext not yet installed. Let's continue


bench get-app erpnext --branch version-14

bench get-app payments --branch version-14

bench get-app hrms --branch version-14

 bench --site yourhost.example.com install-app erpnext

bench --site yourhost.example.com install-app hrms


( we found an error after installing hrms at this stage. You can ignore it . Check the installation with following command


bench version --format table



bench start



Now you have ERPNext on port 8000. ( http://yourhost.example.com:8000 )

You can run the setup-wizard on the browser.


----- NOW deploy it in production mode - on nginx server -------


Continues in this article ( https://cloud.erpgulf.com/blog/blogs/erpnext-version-14-install-in-production-mode-nginx-supervirso-gunicorn )


Team ERPGulf

The team behind ERPGulf blogs here, expresses their thoughts, shares the experience, often show the frustrations. Contact us on support@ERPGulf.com

5 comments
Ali Shk October 15, 2023

Having same problem. 404 error after bench start

Suresh Parvathareddy July 15, 2023

Hi, after installation, I realised that bench starting on private IP whereas my installation is done on cloud platform. Is there a way to change the starting on ip to Public IP instead of Private IP?

@Mohammed, Did you manage to find a solution? if yes could you please help me with steps?

Ljubi B. May 17, 2023

I found the problem and now everything works great. Thanks erpgulf team.

Ljubi B. May 16, 2023

I have the same problem.... :(

Mohammed January 25, 2023

Hi, Thanks for this great post, I followed all instructions, everything seems fine but after bench start command, I connect to 192.168.1.200:8000 says 404 not found; 192.168.1.200 does not exist.
can you help ? Best regards.

Add Comment