Step-by-Step Guide to Installing ERPNext on Rocky Linux 9

ERPNext is an open-source Enterprise Resource Planning system that fits diverse business models, from manufacturing to healthcare. It offers comprehensive modules such as accounting, CRM, and project management, positioning itself as a robust alternative to platforms like Oracle’s NetSuite and Odoo. Developed under the Frappe framework, ERPNext is efficiently written using Python and JavaScript, enhancing its adaptability and performance.

This guide walks you through deploying ERPNext on a Rocky Linux 9 server, emphasizing security with SSL/TLS protocols via Certbot and Letsencrypt. Essential components, including Python 3.10, Redis, Nginx, Supervisor, and MariaDB, will be meticulously set up to ensure a seamless ERPNext environment.

Prerequisites

To successfully install ERPNext, ensure the following:

  • A Rocky Linux 9 server
  • A non-root user with sudo privileges
  • A domain name directed to the server’s IP address
  • SELinux set to permissive mode

Creating a User for ERPNext

Create a dedicated user to manage ERPNext:

sudo useradd -m -s /bin/bash frappe
sudo passwd frappe
sudo usermod -aG wheel frappe

Verify the user creation by logging in:

su - frappe

setup user

Installing Python 3.10

To meet Frappe framework requirements, install Python 3.10:

sudo dnf install gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make
wget https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tgz
tar xzf Python-3.10.9.tgz
cd Python-3.10.9/
./configure --enable-optimizations
sudo make altinstall

Ensure Python 3.10 is correctly added to your system PATH:

echo 'export PATH=$PATH:/usr/local/bin/' | sudo tee -a /etc/bashrc
source /etc/bashrc

setup python

Setting Up MariaDB

Prepare your database with MariaDB 10.6:

sudo curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.6"
sudo dnf install MariaDB-server MariaDB-client
sudo systemctl start mariadb
sudo systemctl enable mariadb

Configure MariaDB:

Edit /etc/my.cnf.d/server.cnf to use utf8mb4:

[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
sudo systemctl restart mariadb

Secure MariaDB:

sudo mariadb-secure-installation

start enable mariadb

Installing Additional Dependencies

Deploy various services to enhance ERPNext:

sudo dnf install redis nginx supervisor fail2ban epel-release
sudo systemctl enable --now redis nginx supervisor fail2ban

Installing Node.js 16 and Yarn

Set up the necessary environment for ERPNext by adding repositories:

curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash -
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo dnf install gcc-c++ make nodejs yarn

install yarn nodejs

Installing Wkhtmltopdf

Install Wkhtmltopdf, essential for PDF generation:

sudo dnf install fontconfig freetype libX11 libXext libXrender libjpeg libpng xorg-x11-fonts-75dpi xorg-x11-fonts-Type1
sudo rpm -Uvh https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox-0.12.6.1-2.almalinux9.x86_64.rpm

Setting Up Frappe Bench

Use Frappe Bench to install the framework and ERPNext:

sudo pip3.10 install frappe-bench
bench init --python python3.10 --frappe-branch version-14 frappe-bench
cd frappe-bench
bench new-site erp.hwdomain.io
bench use erp.hwdomain.io

Installing ERPNext

Deploy ERPNext on the set domain:

bench get-app payments
bench get-app --branch version-14 erpnext
bench --site erp.hwdomain.io install-app erpnext
bench --site erp.hwdomain.io enable-scheduler
bench --site erp.hwdomain.io set-maintenance-mode off

Configuring for Production

Prepare ERPNext for production with Ansible, Nginx, and Supervisor:

sudo bench setup production frappe
sudo bench setup supervisor
sudo bench setup nginx

Securing with SSL/TLS via Certbot

Enhance security using Certbot:

sudo dnf install certbot python3-certbot-nginx
sudo certbot --nginx --agree-tos --no-eff-email --redirect --hsts --staple-ocsp --email admin@hwdomain.io -d erp.hwdomain.io

Conclusion

You’ve successfully installed ERPNext on Rocky Linux. With SSL/TLS security in place, your setup is robust and ready for business operations.

FAQ

What is ERPNext?

ERPNext is an open-source ERP software offering a complete suite of modules for various types of industries.

Why choose ERPNext?

ERPNext is highly customizable, community-driven, and offers comprehensive features at no licensing cost, unlike proprietary solutions.

Is this guide applicable to distributions other than Rocky Linux?

While tailored for Rocky Linux 9, similar steps can be adapted for other RPM-based distributions.

How can I ensure security after installation?

Beyond SSL/TLS, regularly update your server’s packages, configure firewalls, and monitor system logs for suspicious activity.