ERPNext Suite Installation Guide

ERPNext Installation Guide

Software Requirements

  • Operating System: Updated Ubuntu 22.04
  • User: A user with sudo privileges
  • Python: Version 3.10+
  • Node.js: Version 18

Hardware Requirements

  • RAM: 4GB
  • Storage: 40GB Hard Disk

Server Settings

Update and Upgrade Packages

sudo apt-get update -y
sudo apt-get upgrade -y

Create a New User (Bench User)

It is recommended not to use the root user for daily tasks. Create a new user for managing Frappe Bench.

sudo adduser [frappe-user]
usermod -aG sudo [frappe-user]
su [frappe-user]
cd /home/[frappe-user]

Replace [frappe-user] with your desired username, e.g., sudo adduser frappe.


Install Required Packages

Install GIT

sudo apt-get install git

Install Python

ERPNext v15 requires Python 3.10+.

sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils

Install Python Virtual Environment

sudo apt-get install python3.10-venv

Install Software Properties Common

sudo apt-get install software-properties-common

Install MariaDB

ERPNext requires MariaDB for database management.

sudo apt install mariadb-server mariadb-client

Install Redis Server

sudo apt-get install redis-server

Install Other Dependencies

These dependencies are needed for fonts, PDFs, and other resources.

sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev

Configure MySQL Server

Setup the Server

Run the following command and follow the prompts:

sudo mysql_secure_installation
  • Enter current password for root: (Enter your SSH root user password)
  • Switch to unix_socket authentication: Y
  • Change the root password: Y
  • Remove anonymous users: Y
  • Disallow root login remotely: N
  • Remove test database and access to it: Y
  • Reload privilege tables: Y

Edit MySQL Default Config File

Edit the configuration file:

sudo nano /etc/mysql/my.cnf

Add the following block of code:

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

[mysql]
default-character-set = utf8mb4

Restart MySQL Server

sudo service mysql restart

Install CURL, Node.js, NPM, and Yarn

Install CURL

sudo apt install curl

Install Node.js

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 18

Install NPM

sudo apt-get install npm

Install Yarn

sudo npm install -g yarn

Install Frappe Bench

Install Frappe Bench

sudo pip3 install frappe-bench

Initialize Frappe Bench

bench init --frappe-branch version-15 frappe-bench

Switch Directories

cd frappe-bench

Change User Directory Permissions

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

Replace [frappe-user] with your username.


Create a New Site

A site is required to set up ERPNext and its apps.

bench new-site [site-name]

Install ERPNext and Other Apps

Download Apps

Payments App

bench get-app payments

ERPNext App

bench get-app --branch version-15 erpnext

Install Apps on the Site

bench --site [site-name] install-app erpnext

Replace [site-name] with your site name.


Setting ERPNext for Production

Enable Scheduler

The scheduler is required to run background tasks in ERPNext. Enable it using the following command:

bench --site [site-name] enable-scheduler

Replace [site-name] with your actual site name.


Disable Maintenance Mode

Turn off maintenance mode to make the site accessible to users:

bench --site [site-name] set-maintenance-mode off

Setup Production Configuration

Set up production mode for ERPNext, including Supervisor and NGINX configurations:

sudo bench setup production [frappe-user]

Replace [frappe-user] with the username you created for the bench.


Setup NGINX to Apply Changes

Apply changes to the NGINX configuration:

bench setup nginx

Access ERPNext on Port 80

After completing the setup, ERPNext will be accessible on port 80 (default HTTP port). You can access it in a web browser using your server’s IP address or domain name.

For example:

  • If you are using an IP address: http://<server-ip>
  • If you have set up a domain name: http://<domain-name>

Make sure port 80 is open in your firewall and any security groups to ensure accessibility.