Need a guide that shows you how to install ERPNext on Rocky Linux 9, step-by-step, in the easiest way? This tutorial does just that.
ERPNext is an open-source, free Enterprise Resource Planning(ERP) tool. Developed by Frappe Technologies Pvt. Ltd. It allows companies to manage different sections of their businesses like Financial Accounting, Order Management, CRM, Helpdesk, Asset Management, and more.
Since the discontinuation of CentOS at the end of 2021, many companies and individuals have been migrating to Rocky Linux. So in this tutorial, we show how to install and get started with the ERPNext software on your Rocky Linux device.
Prerequisites
To get ERPNext on Rocky Linux, you will need:
- Rocky Linux installed
- Root privilege or sudo
- Secure domain name
- SELinux set to permissive mode
- MariaDB Server
- NodeJS
- Python 3.10 or higher
- Lots of disk space
How to Install ERPNext on Rocky Linux 9
Let’s start installing the necessary dependencies before we move on to installing ERPNext.
Install Necessary Dependencies
Before you install any new packages, you should update the system. Update the Rocky Linux package source list with this command:
$ sudo yum update
Output:
Now install “Development Tools” for Rocky Linux with this command:
$ sudo dnf groupinstall "Development Tools"
Output:
After that, add and install the Extra Packages for Enterprise Linux (EPEL) repo to your system. For that, use this command:
$ sudo yum install epel-release
Output:
Then you need to install the rest of the dependencies. This command should do that:
$ sudo yum install -y gcc make git openssl-devel zlib-devel bzip2-devel libffi-devel xz-devel python3 python3-devel
Output:
Once the installations finish, install redis. Then start redis and enable it. Use the following commands:
$ sudo dnf install redis
$ sudo systemctl start redis
$ sudo systemctl enable redis
Output:
Then install Supervisor with this command:
$ sudo dnf install supervisor
Output:
Install Python 3.10
Since ERPNext requires Python 3.10 or higher, you need to upgrade from the current Python version on your device, which is likely 3.9+.
Fetch the Python 3.10 source code with this command:
$ wget https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tgz
Extract the tar file and change the directory to the Python one. Use these commands:
$ tar xzf Python-3.10.9.tgz
$ cd Python-3.10.0/
Output:
After that, start building from the source code. Run the following commands:
$ ./configure --enable-optimizations
$ nproc
$ sudo make -j2
Then install Python using this command:
$ sudo make altinstall
We’re not done yet. Next, you must add the new Python installation directory to the system PATH. For that, open ‘/etc/bashrc’ in nano with this command:
$ sudo nano /etc/bashrc
Then append this line to it:
export PATH=$PATH:/usr/local/bin/
Save the file by pressing ‘Ctrl + O’ and close it by pressing ‘Ctrl + X’.
Reload the config file with this command:
$ source /etc/bashrc
Now you need to edit the sudoers file. First, run this command:
$ sudo visudo
Add ‘/usr/local/bin’ after ‘Defaults secure_path’ as seen in the below picture
Save and exit.
Install and Configure MariaDB Server
In this step, you install and configure MariaDB. We will use this as the database for ERPNext.
First, install the MariaDB server using this command:
$ sudo yum install mariadb mariadb-server
Once that’s over, start and enable it as you did with redis. Use these below commands:
$ sudo systemctl start mariadb
$ sudo systemctl enable mariadb
Output:
Next, secure your MariaDB server. Input this command to begin the process:
$ sudo mysql_secure_installation
You will be prompted to answer a few questions with ‘Y’ or ‘n’. Carefully read the questions and answer them. Some prompts will tell you which answer suits your system the best. You could also follow the below screenshots to see our answers.
After securing your server, now it’s time to edit the MariaDB configuration file. Open the file in nano using this command:
$ sudo nano /etc/my.cnf
Append the following lines to the config file:
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
Output:
Save and exit the file.
Apply the changes by restarting MariaDB. Use this command:
$ sudo systemctl restart mariadb
Install Node and Yarn
ERPNext requires these two packages, so we will install them. First, install NodeJS using this command:
$ sudo yum install nodejs
Output:
And then install Yarn using npm with this command:
$ sudo npm install -g yarn
Output:
Change SELinux and Firewall Settings
To avoid conflicts, it’s safe to change the SELinux and Firewall Settings to safely install and run ERPNext.
First, disable SELinux with this command:
$ sudo setenforce 0
Now configure your Firewall to allow the ERPNext port. To do so, issue these commands:
$ sudo firewall-cmd --zone=public --add-port=8000/tcp --permanent
$ sudo firewall-cmd --reload
Output:
Add New User to Setup ERPNext
This is a short step. We will create a new user on our Rocky Linux machine. This new user will handle the rest of the installation and configuring ERPNext.
Create the user and add it to the Wheel group with this command:
$ sudo useradd -m distroiderp -G wheel
Set a password for this new user by running this command:
$ sudo passwd distroiderp
Then change to the new user with this command:
$ su - distroiderp
Output:
You should use a good password. We opted for a ‘bad’ one since this is just a tutorial.
Install bench
We will install the bench command-line utility, which we will use later on to install ERPNext. To install bench, run this command:
$ sudo pip3.10 install frappe-bench
Output:
When installed, initialize it with this command:
$ bench init --python python3.10 --frappe-branch version-14 frappe-bench
Output:
Now change the directory to ‘/frappe-bench/’ using this command:
$ cd frappe-bench
After that, create a new site to use ERPNext on. Use the following command:
$ bench new-site erp.mysite.com
Output:
Use your own domain name to replace ‘mysite.com’.
Then change to this new project by typing this command:
$ bench use erp.mysite.com
Install ERPNext
Use bench to download the ERPNext software. Run this command:
$ bench get-app --branch version-14 erpnext
Output:
Finally, install ERPNext with this command:
$ bench --site erp.mysite.com install-app erpnext
Output:
After ERPNext is installed, start the bench service. Use the below command:
$ bench start
Configure ERPNext
After installing, the next step is to configure it. Go to http://erp.mysite.com/ to access the login dashboard. For username, use ‘Administrator’. Set the password to the same one you entered during the ERPNext installation.
Then you will be required to enter some details, including Language, Country, Time Zone, Currency. After that, you will be prompted to create a user account. Enter your Full Name, email, and password to create one. Then you will be asked for company information. Enter each detail correctly.
If everything went right, you should now be inside the ERPNext dashboard.
Final Thoughts
This tutorial covered how to install ERPNext on Rocky Linux 9. We also showed you how you can configure it after installation. It might be a long process, but if you follow this guide and execute the commands properly, you should get started with ERPNext in no time. As always, feel free to let us know in the comments if you face any problems. Consider visiting the official docs to learn more about how ERPNext works.
If this guide helped you, please share it.