How To Install ERPNext on Rocky Linux 9
In this tutorial, we will show you how to install ERPNext on Rocky Linux 9. ERPNext, an open-source ERP solution, has gained popularity among small and medium-sized businesses for its comprehensive features and flexibility. This guide will walk you through the process of installing ERPNext on Rocky Linux 9, a stable and secure operating system perfect for enterprise deployments.
Introduction to ERPNext and Rocky Linux 9
ERPNext is a powerful, open-source ERP platform that offers a wide range of modules including finance, inventory management, human resources, customer relationship management (CRM), and more. Its modular architecture allows businesses to tailor the system to their specific needs, making it an excellent choice for companies of all sizes.
Rocky Linux 9, on the other hand, is a community-driven, enterprise-grade operating system designed to be 100% bug-for-bug compatible with Red Hat Enterprise Linux (RHEL). It provides a stable, secure, and reliable foundation for running critical business applications like ERPNext.
Key features of ERPNext include:
- Comprehensive financial management
- Real-time inventory tracking
- Human Resource Management System (HRMS)
- Customer Relationship Management (CRM)
- Project management capabilities
Compared to alternatives like Odoo or NetSuite, ERPNext offers greater customization options and a more cost-effective solution for businesses looking to implement a full-featured ERP system.
Prerequisites for Installation
Before diving into the installation process, ensure that your system meets the following requirements:
Minimum System Requirements:
- 4GB RAM (8GB recommended for production use)
- 40GB disk space (SSD preferred for better performance)
- 2-core CPU (4 cores recommended for smoother operation)
Required Software:
- A fresh installation of Rocky Linux 9
- A domain or subdomain pointing to your server’s IP address
- Root or sudo access to the server
Security Preparations:
To ensure a smooth installation and operation of ERPNext, you’ll need to configure some security settings:
- Set SELinux to permissive mode:
sudo setenforce 0 sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
- Configure firewall rules to open necessary ports:
sudo firewall-cmd --permanent --add-port={80/tcp,443/tcp,8000/tcp} sudo firewall-cmd --reload
Initial Server Configuration
Start by updating your Rocky Linux 9 system to ensure you have the latest security patches and software versions:
sudo dnf update -y
Next, create a dedicated user for ERPNext to enhance security and isolate the application:
sudo useradd -m -s /bin/bash frappe
sudo passwd frappe
sudo usermod -aG wheel frappe
Configure sudo privileges for the new user by editing the sudoers file:
sudo visudo
Add the following line at the end of the file:
frappe ALL=(ALL) NOPASSWD: ALL
Save and exit the editor. Now, switch to the frappe user:
su - frappe
Installing Core Dependencies
ERPNext relies on several core dependencies. Let’s install them one by one:
Python 3.10 Installation
Rocky Linux 9 comes with Python 3.9 by default, but ERPNext requires Python 3.10. We’ll compile it from source:
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
make -j $(nproc)
sudo make altinstall
Verify the installation:
python3.10 --version
MariaDB 10.6 Setup
Install MariaDB 10.6 from the official repository:
sudo dnf install mariadb-server mariadb-devel
sudo systemctl enable --now mariadb
Secure your MariaDB installation:
sudo mysql_secure_installation
Follow the prompts to set a root password and remove anonymous users and test databases.
Redis Server
Install Redis for session management and caching:
sudo dnf install redis
sudo systemctl enable --now redis
Installing Node.js, Yarn, and Wkhtmltopdf
Node.js 16 Installation
Add the NodeSource repository and install Node.js 18:
curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash -
sudo dnf install nodejs
Yarn Package Manager
Install Yarn for managing JavaScript dependencies:
sudo npm install -g yarn
Wkhtmltopdf
Install Wkhtmltopdf for generating PDF reports:
sudo dnf install https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox-0.12.6.1-2.rhel9.x86_64.rpm
Setting Up Frappe Bench
Frappe Bench is a command-line utility for managing ERPNext installations. Install it using pip:
sudo pip3.10 install frappe-bench
Initialize a new Bench environment:
bench init --frappe-branch version-14 frappe-bench
cd frappe-bench
Start the Frappe development server:
bench start
Installing ERPNext and Apps
Now that we have Frappe Bench set up, let’s install ERPNext and its associated apps:
bench get-app --branch version-14 erpnext
bench get-app hrms
bench get-app payments
Create a new site for your ERPNext installation:
bench new-site erpnext.yourdomain.com
Install ERPNext on your new site:
bench --site erpnext.yourdomain.com install-app erpnext
bench --site erpnext.yourdomain.com install-app hrms
bench --site erpnext.yourdomain.com install-app payments
Production Environment Configuration
To prepare ERPNext for production use, we need to set up Nginx as a reverse proxy and configure Supervisor for process management:
sudo bench setup production erpnext.yourdomain.com
This command will install and configure Nginx and Supervisor automatically. It will also enable Redis caching for improved performance.
Securing ERPNext with SSL/TLS
To ensure secure communication between clients and your ERPNext server, let’s set up SSL/TLS using Let’s Encrypt:
sudo dnf install certbot python3-certbot-nginx
sudo certbot --nginx -d erpnext.yourdomain.com
Follow the prompts to obtain and install your SSL certificate. Certbot will automatically configure Nginx to use HTTPS.
To automate certificate renewal, add a cron job:
sudo crontab -e
Add the following line:
0 12 * * * /usr/bin/certbot renew --quiet
Post-Installation Setup
With ERPNext installed and secured, it’s time to access the web interface and complete the initial setup:
- Open your web browser and navigate to
https://erpnext.yourdomain.com
- Create your administrator account when prompted
- Follow the setup wizard to configure basic company information and modules
Maintenance and Best Practices
To keep your ERPNext installation running smoothly, follow these maintenance best practices:
Regular Backups
Create backups of your ERPNext site regularly:
bench backup
Updating ERPNext and Apps
Keep your system up-to-date with the latest features and security patches:
bench update --pull
bench update --patch
bench update --build
Monitoring Logs
Monitor ERPNext logs for any issues:
bench logs
sudo journalctl -u frappe-bench-web.service
sudo supervisorctl status
Troubleshooting Common Issues
Even with careful installation, you may encounter some issues. Here are solutions to common problems:
Dependency Errors
If you encounter Node.js version conflicts, ensure you’re using the correct version:
nvm use 16
bench update --patch
“Canvas Module Not Found” Error
Install the required dependencies:
sudo dnf install cairo-devel pango-devel libjpeg-turbo-devel giflib-devel
MariaDB Connection Failures
Check MariaDB status and restart if necessary:
sudo systemctl status mariadb
sudo systemctl restart mariadb
Congratulations! You have successfully installed ERPNext. Thanks for using this tutorial for installing ERPNext on Rocky Linux 9 system. For additional help or useful information, we recommend you check the official ERPNext website.