ERPNext Ubuntu

Embarking on the journey of setting up ERPNext version 15 on our freshly installed Ubuntu 22.04 operating system involves a systematic configuration process. Let’s dive into the task at hand!


Before delving into the ERPNext installation, ensure that your server meets the following prerequisites:

Software Requirements

  • Updated Ubuntu 22.04
  • User with sudo privileges
  • Python 3.10+
  • Node.js 18

Hardware Requirements

  • 4GB RAM
  • 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)

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

Replace [frappe-user] with your desired username.

Install Required Packages

Install GIT

sudo apt-get install git

Install Python

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

sudo apt install mariadb-server mariadb-client

Install Redis Server

sudo apt-get install redis-server

Install Other Packages

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

Configure MYSQL Server

Setup the Server

sudo mysql_secure_installation

Follow the prompts to secure your MySQL installation.

Edit MYSQL Default Config File

sudo nano /etc/mysql/my.cnf

Add the following code block:

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

Restart the MYSQL Server

<code>Copy code

sudo service mysql restart

Install CURL, Node, NPM, and Yarn

Install CURL

<code>Copy code

sudo apt install curl

Install Node

<code>Copy code

curl | bash source ~/.profile nvm install 18

Install NPM

<code>Copy code

sudo apt-get install npm

Install Yarn

<code>Copy code

sudo npm install -g yarn

Install Frappe Bench

<code>Copy code

sudo pip3 install frappe-bench

Initialize Frappe Bench

<code>Copy code

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

Switch Directories into the Frappe Bench Directory

<code>Copy code

cd frappe-bench

Change User Directory Permissions

<code>Copy code

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

Replace [frappe-user] with your username.

Create a New Site

<code>Copy code

bench new-site [site-name]

Install ERPNext and Other Apps

Download Apps

<code>Copy code

bench get-app payments bench get-app --branch version-15 erpnext bench get-app hrms

Install Apps

<code>Copy code

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

Congratulations! You’ve successfully set up ERPNext version 15 on Ubuntu 22.04. To start the server, run the following command:

<code>Copy code

bench start

Note that instances in development mode won’t start automatically upon server restart; use bench start each time.

Deploying Production Mode

Enable Scheduler

<code>Copy code

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

Disable Maintenance Mode

<code>Copy code

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

Setup Production Config

<code>Copy code

sudo bench setup production [frappe-user]


<code>Copy code

bench setup nginx

Restart Supervisor and Launch Production Mode

<code>Copy code

sudo supervisorctl restart all sudo bench setup production [frappe-user]

If prompted to save the new/existing config file, respond with ‘Y’. Your instance is now in production mode and accessible via your IP without a port.