[Guide] Install ERPNext v14 on Linux Fedora 38 server

Hi there!

First of all thanks to @shashank_shirke for this wonderful guide ERPNext v14 on Linux Ubuntu to install ERPNext v14 on Ubuntu/Debian without any error so I follow the same guide in Fedora 38 server, faced so many packages plus config problem and after some trial and error I would like to share the guide to install ERPNext v14 on Fedora 38 server (Minimal install version).

So, let’s break down the process into more manageable steps.

1. SERVER SETUP

1.1 Login to the server as root user

1.2 Setup correct date and timezone

Check the server’s current timezone

date

Set correct timezone as per your region

timedatectl set-timezone "Asia/Kolkata"

1.3 Update server packages

dnf update -y

1.4 Disable Selinux & Port Forward In Firewall

We need to disable the selinux else nginx will not work.

nano /etc/sysconfig/selinux

change

SELINUX=enforcing 

to

SELINUX=disabled

Make sure to save changes before closing the file.

crlt+o enter ctrl+x

Port forward

firewall-cmd --permanent --add-port={22,25,143,80,443,3306,3022,8000}/tcp
firewall-cmd --reload

1.5 Reboot system

reboot

1.6 Create a new user
create a user dedicated to the ERPNext with Sudo privileges.

sudo useradd -m erp -G wheel
sudo passwd [frappe-user]

You will be prompted to type in the password twice to confirm it

su - [frappe-user]

Note: Replace [frappe-user] with your username. Eg. sudo adduser myname

2. INSTALL REQUIRED PACKAGES

sudo dnf install gcc git redis cronie nginx supervisor python3-virtualenv python3-devel python3-pip xorg-x11-server-Xvfb fontconfig nodejs fail2ban wkhtmltopdf openssl xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 -y

sudo npm install -g yarn

Replace wkhtmltopdf package with qt patched package.

sudo rpm -Uvh https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.fedora37.x86_64.rpm --replacefiles --replacepkgs

check version by running wkhtmltopdf –version it should be now qt patched

2.1 Install Mariadb

sudo dnf module enable mariadb:10.8 -y
sudo dnf install mariadb mariadb-server -y

2.2 Autostart service

sudo systemctl enable redis crond mariadb fail2ban nginx
sudo systemctl start redis crond mariadb fail2ban nginx
sudo systemctl status redis crond mariadb fail2ban nginx

check all service should be in active

2.3 Configure Maraidb

sudo mysql_secure_installation

During the setup process, the server will prompt you with a few questions as given below. Follow the instructions to continue the setup;

  • 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

2.4 Edit default config file

sudo nano /etc/my.cnf

Add the below code block at the bottom of the file;

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

save file

crlt+o enter ctrl+x

2.5 Restart the MySQL server (for the config to take effect)

sudo systemctl restart mysql

3. INSTALL FRAPPE BENCH

3.1 Install Frappe Bench

sudo pip3 install frappe-bench

Check if Frappe Bench is correctly installed by running bench --version

3.2 Initialize Frappe Bench

bench init --frappe-branch version-14 frappe-bench

3.3 Go to Frappe Bench directory

This will be the main directory from where we will be running all the commands.
The full path of this directory will be: /home/[frappe-user]/frappe-bench/

cd frappe-bench/

3.4 Change user directory permissions

This will allow execution permission to the home directory of the frappe user we created in step 1.6

chmod -R o+rx /home/[frappe-user]/

3.5 Create a New Site

We will use this as the default site where ERPNext and other apps will be installed.

bench new-site site1.local

4 INSTALL ERPNEXT AND OTHER APPS

Finally, we’re at the last stage of the installation process!

4.1 Download the necessary apps to our server
Download the payments apps . This app is required during ERPNext installation

bench get-app payments

Download the main ERPNext app

bench get-app --branch version-14 erpnext

Download India-compliance app (optional)

bench get-app --branch version-14 https://github.com/resilient-tech/india-compliance.git

Check if all the apps are correctly downloaded by running bench version --format table

For other app check this link

4.2 Install all the Apps
Install the main ERPNext app

bench --site site1.local install-app erpnext

Install the india-compliance (optional)

bench --site site1.local install-app india_compliance

5. SETUP PRODUCTION SERVER

5.1 Enable scheduler service

bench --site site1.local enable-scheduler

5.2 Disable maintenance mode

bench --site site1.local set-maintenance-mode off

5.3 Change supervisor conf to accept the .conf file instead of .ini file

sudo nano /etc/supervisord.conf

goto bottom of the page

change

[include]
files = supervisord.d/*.ini

to

[include]
files = supervisord.d/*.conf

save changes

crlt+o enter ctrl+x

5.4 Autostart supervisor service

sudo systemctl enable supervisord
sudo systemctl start supervisord
sudo systemctl status supervisord

check service should be in active

5.5 Setup production config

sudo bench setup production [frappe-user]

5.6 Setup NGINX web server

bench setup nginx

When prompted to save new/existing config files, hit “Y”

5.7 Final server setup

sudo bench setup production [frappe-user]

When prompted to save new/existing config files, hit “Y”

sudo supervisorctl restart all
bench update
bench --site site1.local clear-cache
bench --site site1.local clear-website-cache

You can now go to your server [IP-address] and you will have a fresh new installation of ERPNext ready to be configured!

Reply if anything missing in guide.

Thanks
Nurav

3 Likes

Thanks @NURAV ,

This should be useful for those interested in deploying Frappe on RHEL based platforms. I recently have been testing some Fedora server spins for hosting both container and bare metal apps and the IOT version is interesting as it has a rollback feature that comes in very handy.

I hope to give this a try .