How to Install Frappe and ERPNEXT on Ubuntu 22.04 Desktop

Date:

Share post:

Guide-to-Install-Frappe-ERPNext-in-Ubuntu-22.04-Jammy Jellyfish

A complete Guide to Install Frappe Bench in Ubuntu 22.04 LTS and install Frappe/ERPNext Application

ERPNext is a simple yet free and open source ERP system; specifically, it is written using the Frappe framework, which is a full-stack web app framework in Python & JavaScript. In this guide, we will cover How to Install Frappe and ERPNEXT on Ubuntu 22.04 Desktop, LINUX. Firstly, ERPNext is a feature-rich, enterprise-ready ERP system, which has good features like..

  • Accounting Management
  • Inventory Management
  • Manufacturing Management
  • Customer Relationship Management system
  • Sales Management
  • Purchase Management
  • Project Management
  • Huma Resource Management System and more.
  • GST india future
  • POS sales desk
  • Support desk
  • All in one business management

Table Of Contents 

  • 1 How to Set Up ERPNext Version 14 in Ubuntu 22.04 – A step by Step Guide
    • 1.1 Prerequisites
      • 1.1.0.1 Software Requirements
      • 1.1.0.2 Hardware Requirements
    • 1.2 Server Settings
      • 1.2.0.1 Update and Upgrade Packages
      • 1.2.0.2 Create a new user – (bench user)
    • 1.3 Installing Necessary Packages
      • 1.3.0.1 Set Up GIT
      • 1.3.0.2 Install Python
      • 1.3.0.3 Establish a Python Virtual Environment
      • 1.3.0.4 Install Python 3.10 Virtual Environment
      • 1.3.0.5 Install MariaDB
      • 1.3.0.6 Install Redis Server
      • 1.3.0.7 Install other packages
    • 1.4 Configure MYSQL Server
      • 1.4.0.1 Set up the server
      • 1.4.0.2 Edit MYSQL default config file
      • 1.4.0.3 Restart the MYSQL Server
    • 1.5 Instal CURL, Node, NPM and Yarn
      • 1.5.0.1 Install CURL
      • 1.5.0.2 Install Node
      • 1.5.0.3 Install NPM
      • 1.5.0.4 Install Yarn
      • 1.5.0.5 Install Frappe Bench
      • 1.5.0.6 Initialize Frappe Bench
      • 1.5.0.7 Switch directories into the Frappe Bench directory
      • 1.5.0.8 Alter user directory permissions
      • 1.5.0.9 Generate a New Site
    • 1.6 Install ERPNext and Other Programs
      • 1.6.0.1 Download the Necessary Apps
    • 1.7 Configuring ERPNext for Production
      • 1.7.0.1 Activating the Scheduler
      • 1.7.0.2 Disabling maintenance mode
      • 1.7.0.3 Configuring for production
      • 1.7.0.4 Setting up NGINX to apply the changes
      • 1.7.0.5 Restarting Supervisor and Launching Production Mode

Prerequisites…..

ERPNext Setup Pre-requisites:

  • Software Requirements
  • Python 3.6+
  • Node.js 14+
  • Redis 5 (caching and real time updates)
  • MariaDB 10.3.x / Postgres 9.5.x (to run database driven apps)
  • yarn 1.12+ (js dependency manager)
  • pip 20+ (py dependency manager)
  • wkhtmltopdf (version 0.12.5 with patched qt) (for pdf generation)
  • cron (bench’s scheduled jobs: automated certificate renewal, scheduled backups)
  • NGINX (proxying multitenant sites in production)
  • Hardware Requirements
  • Minimum 4gb Ram
  • Minimum 40gb Hard Disk

Server Settings

Update and Upgrade Packages

Let’s start ERPNext installation by making sure, first, that our system is updated:

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

It is recommended to reboot your system whenever you do upgrade:

Create a new user – bench user

In Linux, the root user processes escalated privileges to perform any tasks within the system. Therefore, this is why it is not advisable to use this user on a daily basis. We will create a user that we can use, and this will be the user we will also use as the Frappe Bench User.

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

Be sure to substitute [frappe-user] with your username. For example: sudo adduser frappe.

Installing Necessary Packages

Install GIT

sudo apt-get install git

install python-dev

ERPNext version 14 requires Python version 3.10+. Therefore, this is what we will install in this step.

sudo apt-get install python3-dev

Install setuptools and pip (Python’s Package Manager).

sudo apt-get install python3-setuptools python3-pip

Install Python Virtual Environment

A virtual environment, therefore, helps to manage the dependencies of a program in a single place; consequently, it does so without interfering with other parts of the computer or server where the program is running.

sudo apt-get install python3.10-venv

Install Software Properties Common

Software Properties Common will help in repository management.

sudo apt-get install software-properties-common

Install MariaDB

ERPNext is built to naively run on MariaDB. The team is working to have the same working on PostgreSQL, but this is not ready yet.

sudo apt install mariadb-server mariadb-client

Install Redis Server

sudo apt-get install redis-server

Install other require packages

ERPNext functionality also relies on other packages we will install in this step. These will load fonts, PDFs, and other resources to our instance.

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

Configure MYSQL Server

Setup the server

sudo mysql_secure_installation

When you run this command, the server will show the following prompts. Please follow the steps as shown below to complete the setup correctly.

  • Enter the current password for root: (Enter your SSH root user password); additionally, please ensure that you have the correct credentials before proceeding.
  • 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]: N
    This is set as N because we might want to access the database from a remote server for using business analytics software like Metabase / PowerBI / Tableau, etc.
  • Remove test database and access to it? [Y/n]: Y
  • Reload privilege tables now? [Y/n]: Y

Edit MYSQL default config file

sudo nano /etc/mysql/my.cnf

Add the following block of code exactly as is:

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

[mysql]
default-character-set = utf8mb4

Restart the MYSQL Server

sudo service mysql restart

Instal CURL, Node, NPM and Yarn

Install CURL

sudo apt install curl

Install Node

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

source ~/.profile

nvm install 16.15.0

Install NPM

sudo apt-get install npm

Install Yarn

sudo npm install -g yarn

Install Frappe Bench

sudo pip3 install frappe-bench

Initialize Frappe Bench

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

Switch directories into the Frappe Bench directory

cd frappe-bench

Change user directory permissions

This will, consequently, grant the bench user execution authority to the home directory.

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

Create a New Site

In order to use ERPNext, Frappe, and all the other apps, a site must be created. We will do this in this step.

bench new-site [site-name]

Install ERPNext and other Apps

First, download all the apps; then, we want to install all the apps on our site.

First of all, the first app we will download is the payments app. This app is required when setting up ERPNext.

Download & install Payment App

bench get-app payments

install Payment App

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

Next, we will download the ERPNext app; therefore, we will download the main ERPNext app.

bench get-app --branch version-14 erpnext

Install Erpnext App

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

Download any other app you may be interested in in a similar manner. For instance,

Download the HR & Payroll app (optional)

bench get-app hrms

install the HR & Payroll app (optional)

Install all the other apps you downloaded in the same way. For example, if you downloaded the human resource app, use the below command to install it.

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

Download & Install the ecommerce integrations apps (optional)

# Production installation
bench get-app ecommerce_integrations --branch main

# OR development install
bench get-app ecommerce_integrations  --branch develop

# install on site
bench --site  [site-name] install-app ecommerce_integrations

Download Frappe Chat (optional)

bench get-app chat

Install Frappe Chat (optional)

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

Download Agriculture App (optional)

bench get-app agriculture

Install Agriculture App (optional)

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

Download & Install lending (optional)

bench get-app lending

Install lending (optional)

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

Twilio Integration Download & Install (optional)

bench get-app https://github.com/frappe/twilio-integration.git
bench --site [site-name]install-app twilio_integration

Frappe Webshop Download & Install (optional)

bench get-app webshop
bench --site [site-name] install-app webshop

WhatsApp Business API Integration (optional)

bench get-app waba_integration
bench --site [site-name] install-app waba_integration

India Compliance GST (optional)

Download the app using the Bench CLI.

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

Install the app on your site.

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

How to install POS AWESOME (optional)

bench get-app branch version-14 https://github.com/yrestom/POS-Awesome.git
bench setup requirements
bench build --app posawesome
bench restart
bench --site [site.name] install-app posawesome
bench --site [site.name] migrate

We have successfully set up ERPNext version 14 on Ubuntu 22.04; consequently, we can now streamline our operations. Therefore, you can start the server by running the below command:

Bench use [site name]
Bench start

If you didn’t have any other ERPNext instance running on the same server, then, consequently, ERPNext will get started on port 8000. If you visit [YOUR SERVER IP:8000], you should, in fact, be able to see ERPNext version 14 running.

Please note that instances which are running on develop mode, like the one we just setup, will not get started when you restart your server. You will need to run the bench start command every time the server restarts; consequently, it is essential to remember this step. (How to Install Frappe and ERPNEXT on Ubuntu 22.04 Desktop)

In the steps below, we will, first, learn how to deploy the production mode.

Setting ERPNext for Production

Enable Scheduler

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

Disable maintenance mode

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

Setup production config

sudo bench setup production [frappe-user]

Setup NGINX to apply the changes

bench setup nginx

Restart Supervisor and Launch Production Mode

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

If you are prompted to save the new/existing config file, then respond with a Y.

When this completes doing the settings, your instance is now on production mode and can be accessed using your IP, without needing to use the port.

This also will mean that your instance will start automatically even in the event you restart the server.

HOW TO SETTING UP MULTI-TENANCY IN ERPNEXT ON UBUNTU 22.04

DNS based multitenancy

You can name your sites as the hostnames that would, in fact, resolve to it. Thus, all the sites you add to the bench would run on the same port and will be automatically selected based on the hostname.

DNS based multitenancy mode is disabled by default; however, you can switch it on or off using the command,

In Software, multi-tenancy is an architecture in which, consequently, a single instance of a software application serves multiple customers, who are, in fact, called tenants. Moreover, the application can be offered either as a service or as a platform.

Companies today are leveraging software as a service, or SaaS, to provide data protection; consequently, this results in superior security, better economics, and reduced overhead. One of the ways we do this is, in fact, through multi-tenant architecture.

In today’s video, we will, therefore, look at how to implement multi-tenancy in ERPNext and the Frappe Framework. (How to Install Frappe and ERPNEXT on Ubuntu 22.04 Desktop)

Steps needed To Follow

To make a new site under DNS based multitenancy, perform the following steps.

sudo bench config dns_multitenant on
sudo bench new-site [New.site.com]
bench --site [New.site.com-name] install-app erpnext [apps you want to install]
bench setup nginx
sudo service nginx reload

Note : For “DNS based multitenancy,” currentsite.txt in frappe-bench/sites/ should be empty. Therefore, it is important to ensure that this file is cleared before proceeding.

How to Installing SSL Certificate On ERPNEXT Instance on Ubuntu

You will need to have an SSL certificate installed on your instance; furthermore, this is essential to keep users of your system safe online. In Frappe Framework or ERPNext, this is, indeed, a simple process.

Prerequisites

  • You need to have a DNS Multitenant Setup
  • Your site should be accessible via a valid domain
  • You need root permissions on your server
  • You need a valid certificate generated through a trusted Certificate Authority; alternatively, you may consider using a Self-Signed Certificate.(How to Install Frappe and ERPNEXT on Ubuntu 22.04 Desktop)

Steps to Install SSL

Install snapd on your machine

sudo apt install snapd

Update snapd

sudo snap install core; sudo snap refresh core

Remove existing installations of certbot

sudo apt-get remove certbot

Install certbot

sudo snap install --classic certbot

sudo ln -s /snap/bin/certbot /usr/bin/certbot

For one-step automatic ssl installation

sudo certbot --nginx

If you prefer manual installation,. do the following:

sudo certbot certonly --nginx

Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire. So no further steps are required. If necessary, you can test automatic renewal for your certificates by running this command; furthermore, this will help ensure that the renewal process is functioning correctly: (How to Install Frappe and ERPNEXT on Ubuntu 22.04 Desktop)

sudo certbot renew --dry-run

LEAVE A REPLY

Please enter your comment!
Please enter your name here

spot_img

Related articles

The Ultimate Exploring Middle East’s Street Markets.

What Is Market? A marketplace, market place, or just market, or mart is a location where people regularly gather for the purchase and sale...

The Fashion Focus: Hot Beauty Health

First, what is fashion? Fashion is about change, it is about progress. However, it is also an industry that...

Discover these Waterproof and Rugged Smartphones that Go on Sale

I actually first read this as alkalizing meaning effecting pH level, and I was like, OK I guess...

New Soundboard Review: Pricing is Not Always the Only Criteria

I actually first read this as alkalizing meaning effecting pH level, and I was like, OK I guess...