Dive into the world of open-source ERP solutions with our comprehensive guide on installing the latest ERPNext 15 on Ubuntu 22.04 LTS. Perfect for businesses seeking an upgrade or those new to ERP systems, our step-by-step tutorial ensures a smooth and efficient setup process, paving the way for enhanced business operations and productivity.
Prerequisites
Software Requirements
- Ubuntu 22.04 LTS
- A user with sudo privileges
- Python 3.11+
- Node.js 20
Hardware Requirements
- 4 CPU Core
- 4GB RAM
- 50 GB Storage
Server Settings
Update and Upgrade Packages
sudo apt-get update -y
sudo apt-get upgrade -y
Create a new user
sudo adduser [frappe-user]
usermod -aG sudo [frappe-user]
su [frappe-user]
cd /home/[frappe-user]
Ensure you have replaced [frappe-user] with your username. eg. sudo adduser frappe
Install Required Packages
For setting up ERPNext, an application that runs on the Frappe Framework, we need to install several software packages first. These packages help ensure that ERPNext functions correctly on your system.
Install Python
ERPNext version 15 requires Python version 3.10+. This is what we will install in this step.
Adding PPA repository
Add the deadsnakes PPA repository to the system next. The simplest method for installing Python 3.11 is as follows:
sudo add-apt-repository ppa:deadsnakes/ppa
Use this command to install Python 3.11 on Ubuntu 22.04:
sudo apt-get install python3-dev python3.11-dev python3-setuptools python3-pip python3-distutils
Install Python Virtual Environment
A virtual environment is a tool that keeps a software’s dependencies contained in one area. This way, it avoids disrupting other parts of the computer or server where the software operates.
sudo apt install python3.10-venv python3.11-venv
Set your Default Python Version
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
Install Software Properties Common
sudo apt-get install software-properties-common
Install MariaDB
ERPNext requires MariaDB to function as its database system.
sudo apt install mariadb-server mariadb-client
Install Redis Server
Now, let’s install Redis Server, which ERPNext uses to manage background tasks and store cache data efficiently. Open your terminal and enter the following command:
sudo apt-get install redis-server
Install other packages
ERPNext’s performance is enhanced by several additional packages, which we’ll install next. These packages are responsible for loading fonts, generating PDFs, and managing other essential resources for our ERPNext setup.
sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev
Configure MYSQL Server
Setup the server
sudo mysql_secure_installation
Upon executing this command, you’ll encounter a series of prompts on the server. Make sure to follow the subsequent steps carefully to ensure the setup is configured properly.
- 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] Y
- Remove test database and access to it? [Y/n] Y
- Reload privilege tables now? [Y/n] Y
Edit MYSQL default config file
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
Install CURL, Node.js, NPM, and Yarn.
Install CURL
sudo apt install curl
Install Node.js
curl -sL https://deb.nodesource.com/setup_20.x | bash -
sudo apt-get install -y nodejs
Install NPM
npm install -g npm@9.8.1
Install Yarn
sudo npm install -g yarn
Install Frappe Bench
To proceed with the ERPNext installation, switch to the ‘frappe’ user account by entering the following command:
su - frappe
sudo pip3 install frappe-bench
Initialize Frappe Bench
bench init frappe-bench --frappe-branch version-15
Switch directories into the Frappe Bench directory
cd frappe-bench
Next, we need to add the node-sass
package, which allows you to compile .scss
files to CSS, enhancing your ERPNext themes and styles. Run the following command:
yarn add node-sass
Change user directory permissions
This will give the bench user execution permission to the home directory.
chmod -R o+rx /home/[frappe-user]
Create a New Site
A site is a requirement in ERPNext, Frappe and all the other apps we will be needing to install. We will create the site in this step.
bench new-site [site-name]
Install ERPNext and other Apps
bench get-app erpnext --branch version-15
bench get-app payments --branch version-15
bench --site [site-name] install-app erpnext
cd frappe-bench
sed -i '/web:/ s/$/ --noreload/' Procfile
pip3 install honcho
bench use [site-name]
bench start
Now you have ERPNext on port 8000. ( http://yourhost.com:8000 )
You can run the setup-wizard on the browser.