In this guide you will learn how to install ERPNext Version 15 On Ubuntu Server. This is manual Instllation Guide that you can use to install on either on premises server or on cloud.
You can follow below guide and watch this video for full installation
Platform Setup On-Premises or Cloud
You can use any of the platforms to set up your server;
- Hardware Server on Premises – Single Board Server
- Virtualization Platform – Proxmox Recommended
- Cloud Platform – Digital Ocean Recommended
Once you have prepared the server from one of the options above, now the next step is to ensure that the Ubuntu Server is Installed.
Server Setup – Ubuntu Server Installation
You can use any Ubuntu Server, 20, 22 or 23 Version.
You must have the Ubuntu Sever first ready. Here is guide to Install Ubuntu Server
Update the Ubuntu Servers
Let us first update the packages database and update the installed packages
apt-get update && apt-get upgrade -y
Now you must reboot the server using the reboot command
reboot
If reboot doesn’t work you can use init 6 command.
Packages and Versions Required for ERPNext 15
Test Results
Package | Version Required |
---|---|
pip3 |
23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) |
pip |
23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) |
python |
3.11.4 |
node |
20.17.0 |
npm |
9.8.1 |
mariadb |
Ver 15.1 Distrib 10.6.7-MariaDB |
yarn |
1.22.19 |
/opt/bench/node_modules/.bin/node-sass |
node-sass 9.0.1 (Wrapper) [JavaScript] libsass 3.5.5 (Sass Compiler) [C/C++] |
npm node-sass |
8.19.1 |
pip3 |
23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) |
pip |
23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) |
redis-server |
Redis server v=7.0.16 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=a3fdef44459b3ad6 |
wkhtmltopdf |
0.12.6 |
git |
2.39.1 |
Install packages & pre-Requisites for Installing ERPNeXT Version 15
Python Installation
Let us first install python3 and related tools.
sudo apt-get install python3-dev python3.11-dev python3-setuptools python3-pip python3-distutils software-properties-common xvfb libfontconfig wkhtmltopdf libmysqlclient-dev -y
Now let us install Python Virtual Environment, because ERPNext might have specific version requirements for Python libraries, and using a virtual environment ensures that these dependencies do not conflict with other projects in Ubuntu Server so we will install Python Virtual Environment using below command;
sudo apt-get install python3.11-venv -y
Let us now create a symbolic link of Python to Python3
sudo apt install python-is-python3 -y
Now it is good Idea to check the versions and ensure that Python and Python 3 has correct Installation for ERPNext you must have 3.10 or creater
python3 -V
Install Node JS
To Install Node JS Latest Version use below command, note that you can look for latest version for Node JS. Below is from Node JS Site
sudo apt-get update && sudo apt-get install -y ca-certificates curl gnupg
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update && sudo apt-get install nodejs -y
Now let us check the Version of NodeJS
node --version
Install Redis-Server
Now let us Install the Redis Server using Node JS
apt-get install nodejs redis-server -y
Make sure to test Node Version it should be greater than 20
Install Git and Cron
apt-get install cron git -y
NPM and Yarn Setup
npm install -g yarn
Check the npm version it must be greater than 9
Install MariaDB Database
apt-get install mariadb-server mariadb-client -y
You need to run the MYSQL Secure INstallation to ensure that you setup the root password for mariadb and whether you want to allow the access. If you are using External Server for database you can skip this step
mysql_secure_installation
MariaDB Configuration for ERPNext Formats
You need to setup the Maria DB Configuration you can edit the configuration using nano or vim editor. Locate Maria DB Configuration based on your sever installation and modify the lines, if not available add below 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
Save the configuration file and restart the mariaDB Server by using below command
systemctl restart mariadb
Create User in Ubuntu Server
We need to ensure that we don’t use Root user or default user for all ERPNext this is to isolate the user from the root user and remain specific to the ERPNext Installation, for this we will create the user, create password and assign sudo rights.
useradd -m -s /bin/bash amjid
In above example amjid is user you can chose any user. Now letus setup the password
passwd amjid
It will ask the password that you want to set, just type the password.
Now let us add sudo group for the user
usermod -aG sudo amjid
Now use is assigned sudo rights, let us now switch to user
su - amjid
Now you will be logged in with new uuser. Let us continue to add the bin path for the user. For this you need to add one line in this file, using the editor vim or nano, i will use nano.
nano ~/.bashrc
Copy and paste below line at the end of the file which you are editing
PATH=$PATH:~/.local/bin/
Now we will get the additional add on which is bench, and it is recommended to add add on to opt directory, so we will create the bench directory in add ons.
sudo mkdir /opt/bench
Now let us give rights to the user amjid
sudo chown -R amjid:amjid /opt/bench
Now we will change the directory and will run the command in bench directory
cd /opt/bench
Now we need to isntall node-sass which is (Syntactically Awesome Stylesheets) CSS preprocessor. Sass is a preprocessor scripting language that is interpreted or compiled into CSS.
yarn add node-sass
Install Frappe Bench
Now let us install the frappe bench and If you get error while using pip command related to environment is externally managed. you must remove the file externally managed from below path. You can alternatively use command pipx
pip3 install frappe-bench
Before using PIPX you must remove externally managed file from below path
remove file /usr/lib/python3.x/EXTERNALLY-MANAGED
,
Then you can install pipx
sudo apt install pipx
If you are using externally managed on, then you can use pipx as vekiw
pipx install frappe-bench
Now install python virtual environment
sudo apt install python3.10-venv
Initiate Frappe Bench
Now you must intiate frappe bench with init command for version 15
bench init frappe-bench --frappe-branch version-15
Now all the commands that you will use will be from through the frappe bench directory so change the directory to frappe-bench
cd frappe-bench
Now we will be modifying lines in the file Procfile that contain the pattern “web:” by adding ” –noreload” at the end of those lines.
sed -i '/web:/ s/$/ --noreload/' Procfile
Honcho is used to manage procfile based applications let us do that
pip3 install honcho
Now let us start bench
bench start &
Now you can access the server , https://erp.syncbricks.com:8000
bench start &
Now let stop the bench and create site , you will use all below commands one by one to create site and install related app to the site
bench start &
you can stop this by pressing ctr + c and create the site
bench new-site erp.syncbricks.com
you can stop this by pressing ctr + c. Lest us install ERPNext and HRMS
bench get-app erpnext --branch version-15
bench get-app hrms --branch version-15
Now you need to update the apps to the site
bench get-app hrms --branch version-15
bench --site erp.syncbricks.com install-app erpnext
bench --site erp.syncbricks.com install-app hrms
Now you must tell the bench to use erp.syncbricks.com as default site you will use
bench use erp.syncbricks.com
Now you can access ERPNext Here at https://erp.syncbricks.com