Installing Frappe 15 and ERPNext 15 on Ubuntu 22.04: A Quick Guide

Posted By : Abhishek Kumar | 09-Oct-2024

ERPNext

Loading...

How to Install Frappe 15 and ERPNext 15 on Ubuntu 22.04: A Step-by-Step Guide

ERPNext and Frappe are powerful open-source frameworks for business management and custom application development. Frappe 15 is the foundation for ERPNext 15, providing a robust backend to manage your business operations effectively. If you're using Ubuntu 22.04, this guide will walk you through the complete installation of Frappe 15 and ERPNext 15.

Let's examine the detailed step-by-step process for getting Frappe and ERPNext up and running on your Ubuntu server.

Prerequisites:

  • Fresh installation of Ubuntu 22.04 LTS.
  • Basic knowledge of command-line usage.
  • Root or sudo privileges.

Step 1: Create a Folder for the Installation

To organize the setup process, first create a dedicated folder where all your files and configurations will reside.

mkdir frappe-erpnext-setup
cd frappe-erpnext-setup

This will help keep all your files neatly organized as you install Frappe and ERPNext.

Step 2: Install Python Virtual Environment

The next step is to install Python and set up a virtual environment, ensuring that you have an isolated environment for the Frappe and ERPNext installation.

sudo apt install python3-dev python3-venv

This installs python3-venv to manage isolated Python environments and python3-dev to compile necessary packages.

Step 3: Create a Virtual Environment (optional)

Now create a virtual environment using Python:

python3 -m venv myenv

This command creates a new folder called myenv containing a fresh Python environment, separate from your system Python installation.

Step 4: Activate the Virtual Environment (optional)

Activate the environment by running:

source myenv/bin/activate

After activation, your terminal prompt will change to indicate that you're now inside the myenv virtual environment. Everything installed here will be contained within this environment.

Step 5: Update and Upgrade Packages

Before proceeding, ensure your system is up-to-date by updating and upgrading all installed packages.

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

This will make sure that all software on your machine is current, which helps avoid compatibility issues later on.

Step 6: Install Git

Git is required to clone repositories, including Frappe and ERPNext source code.

sudo apt-get install git

Git will allow you to clone the Frappe and ERPNext code repositories directly from GitHub.

Step 7: Install Python and Required Development Packages

Install additional Python and development packages needed for ERPNext.

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

These packages ensure that Python dependencies are correctly built during the setup.

Step 8: Install Software Properties Common

This package helps in managing software repositories and adding PPAs (Personal Package Archives).

sudo apt-get install software-properties-common

Step 9: Install MariaDB

MariaDB is the database used by Frappe/ERPNext. Install it by running:

sudo apt install mariadb-server mariadb-client

MariaDB is a fork of MySQL and is used to manage all database operations in ERPNext.

Step 10: Install Redis Server

Redis is required for background job management in Frappe.

sudo apt-get install redis-server

Redis will handle caching and message brokering for real-time communication within Frappe.

Step 11: Install Other Required Packages

You will also need some additional system packages, such as wkhtmltopdf (for PDF generation) and MySQL development libraries.

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

These packages are essential for various functionalities, including generating PDFs and connecting to MariaDB.

Step 12: Configure MySQL Server

Now configure the MariaDB server by securing the installation and adjusting settings.

Run the MySQL secure installation script:

sudo mysql_secure_installation

You will be prompted with several options. Follow these answers:

  • Enter current password for root: (Your SSH root user password)
  • Switch to unix_socket authentication [Y/n]: Y
  • Change the root password? [Y/n]: Y (Set a secure password here)
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: N
  • Remove test database and access to it? [Y/n]: Y
  • Reload privilege tables now? [Y/n]: Y

Step 13: Edit MySQL Default Configuration

Open the MySQL configuration file and adjust settings for character encoding:

sudo nano /etc/mysql/my.cnf

Add the following block of code to ensure proper character handling:

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

Save and close the file (Ctrl + X, then Y, then Enter).

Step 14: Restart MySQL Service

Apply the configuration changes by restarting the MySQL service:

sudo service mysql restart

Step 15: Install CURL, Node.js, NPM, and Yarn

Now install curl and Node.js, which are needed to run JavaScript dependencies for Frappe.

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

Next, install NPM and Yarn (a package manager used for managing front-end dependencies):

sudo apt-get install npm
sudo npm install -g yarn

Step 16: Install Frappe Bench

Frappe Bench is a command-line tool that helps manage Frappe/ERPNext applications.

sudo pip3 install frappe-bench

Step 17: Initialize Frappe Bench

Now initialize Frappe Bench in the current directory, specifying the branch for Frappe 15:

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

This will take some time, as it downloads and installs all the dependencies required for Frappe 15.

Step 18: Switch to the Frappe Bench Directory

Navigate to the newly created frappe-bench directory:

cd frappe-bench

Step 19: Create a New Site

Now create a new Frappe site where ERPNext will be installed:

bench new-site localhost

This command will set up a fresh Frappe site. You will be prompted to set the MySQL root password and administrator password for the site.

Step 20: Install ERPNext and Other Apps

Once the site is created, install ERPNext and other necessary apps:

bench get-app --branch version-15 erpnext
bench --site localhost install-app erpnext

You can also install additional apps, such as HRMS:

bench get-app --branch version-15 hrms
bench --site localhost install-app hrms

For apps hosted on GitHub or GitLab, you can install them by specifying the repository URL:

bench --site localhost <GitHub or GitLab link>

Step 21: Start the Server

Finally, start the Frappe development server:

bench start

Visit http://localhost:8000 in your browser to access your Frappe and ERPNext installation. Use the admin credentials you set during site creation to log in.

Final Thoughts

Implementing Frappe and ERPNext can significantly enhance your business operations by providing an integrated platform for managing various aspects of your organization. With the flexibility to customize and extend functionalities, you can tailor the system to align perfectly with your business processes. Regular maintenance, updates, and community engagement will ensure that your ERP system remains robust, secure, and efficient.

Thank you for following this step-by-step guide. We hope it has been helpful in setting up your ERPNext environment. Should you encounter any challenges or have further questions, don't hesitate to reach out to the vibrant Frappe and ERPNext communities or consult the official documentation for more detailed information.

Happy managing!