ERPNext Setup on Ubuntu 22.04 โ€“ From Zero to Hero!

Gujjar ApurvGujjar Apurv
11 min read

๐Ÿ“‘ Table of Contents

  1. ๐ŸŒŸ Introduction: Why ERPNext?

  2. ๐ŸŽฏ Aim of this Blog

  3. ๐Ÿ› ๏ธ Prerequisites Before You Begin

  4. โš™๏ธ Step 1: Server Setup โ€“ Preparing Ubuntu for ERPNext

  5. ๐Ÿ“ฆ Step 2: Install Required Packages

  6. ๐Ÿ—„๏ธ Step 3: Configure MySQL Server

  7. ๐Ÿ”ง Step 4: Install CURL, Node.js, NPM, and Yarn

  8. ๐Ÿ—๏ธ Step 5: Install Frappe Bench Framework

  9. ๐Ÿš€ Step 6: Install ERPNext and Other Applications

  10. โœ… Final Verification and Testing Your Setup

  11. ๐Ÿ“Œ Conclusion: Running ERPNext Smoothly

๐ŸŒŸ Introduction : Why ERPNext?

Running a business requires managing multiple operations finance, sales, HR, payroll, CRM, projects, and more. Instead of juggling multiple tools, wouldnโ€™t it be better to have one platform for everything? Thatโ€™s exactly what ERPNext delivers.

ERPNext is an open-source ERP solution designed to simplify and automate business processes. From startups to enterprises, itโ€™s trusted worldwide for being cost-effective, flexible, and scalable. Unlike other ERP tools that demand heavy licensing costs, ERPNext offers a free and community-driven platform that anyone can install and use.This blog is your complete, beginner-friendly guide to installing ERPNext on Ubuntu 22.04 LTS.

๐ŸŽฏ Aim of this Blog

The main objective of this guide is to help you:

  • โœ… Understand ERPNext installation requirements.

  • โœ… Learn server setup and dependency installation.

  • โœ… Configure and install ERPNext with Frappe framework.

  • โœ… Explore add-on modules like HR, Payroll, Sales, and CRM.

By the end, youโ€™ll have a fully functional ERPNext system running on your local machine.

๐Ÿ› ๏ธ Prerequisites Before You Begin

Before we start the installation, make sure your system meets the minimum requirements:

๐Ÿ”น Operating System

  • Ubuntu 22.04 LTS (64-bit)

๐Ÿ”น Minimum Hardware Requirements

  • CPU: 2 cores

  • RAM: 2 GB

  • Storage: 15 GB free disk space

(Tip: For smoother performance, 4 GB RAM and 2+ CPUs are recommended.)

๐Ÿ”น Setup Environment

  • Perform the installation on a local machine for practice/testing.

  • Ensure you have basic Linux command knowledge (updating system, installing packages, using terminal).

โš™๏ธ Step 1: Server Setup โ€“ Preparing Ubuntu

Before we start installing ERPNext, letโ€™s make sure our Ubuntu 22.04 server is ready.

๐Ÿ”น Update & Upgrade Packages

Keep the system up to date:

sudo apt update && sudo apt upgrade -y

๐Ÿ”น Set Timezone

Correct timezone ensures accuracy in reports, HR, and payroll:

sudo timedatectl set-timezone Asia/Kolkata

๐Ÿ”น Install Basic Tools

Essential utilities for smooth installation:

sudo apt install git curl wget htop nano unzip -y

โœ… Thatโ€™s it! Your server is now ready to proceed with ERPNext installation.

๐Ÿ“ฆ Step 2: Install Required Packages

In this step, we install the essential tools for Python, create swap memory for smooth performance, and set up MariaDB (MySQL alternative) for database support.


๐Ÿ Install Python + Build Tools

sudo apt -y install python3 python3-pip python3-venv python3-dev build-essential libffi-dev libssl-dev

๐Ÿ”Ž Explanation:

  • python3 โ†’ Installs the Python 3 interpreter.

  • python3-pip โ†’ Python package manager (used to install libraries).

  • python3-venv โ†’ For creating isolated virtual environments.

  • python3-dev โ†’ Development headers required for compiling Python extensions.

  • build-essential โ†’ Provides compiler tools like gcc and make.

  • libffi-dev & libssl-dev โ†’ Required for cryptography and secure connections.

๐Ÿ‘‰ These dependencies are necessary for ERPNext/Bench to work properly.


๐Ÿง  Create & Enable Swap Memory

sudo fallocate -l 2G /swapfile    # Create a 2GB swap file
sudo chmod 600 /swapfile          # Set correct permissions
sudo mkswap /swapfile             # Format the swap file
sudo swapon /swapfile             # Enable swap
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab   # Make swap permanent after reboot

๐Ÿ”Ž Explanation:

  • Swap memory acts as virtual RAM using disk space.

  • If the system runs out of physical RAM, swap ensures processes donโ€™t crash.

  • Here, we created a 2GB swap file to handle heavy package installations and Python compilations smoothly.


๐Ÿ—„๏ธ Install MariaDB (MySQL Server)

sudo apt -y install mariadb-server mariadb-client

๐Ÿ”Ž Explanation:

  • mariadb-server โ†’ Installs the database engine (where ERPNext stores data).

  • mariadb-client โ†’ Provides tools to interact with the database.

๐Ÿ‘‰ MariaDB is a drop-in replacement for MySQL โ€” it uses the same commands but is faster and open-source.


๐Ÿ—„๏ธ Step 3: Configure MySQL Server

Now, letโ€™s secure the MariaDB server.

sudo mysql_secure_installation

๐Ÿ”Ž Explanation:
This is an interactive script that asks security-related questions:

  1. Set root password โ†’ Protects the database root user with a password.

  2. Remove anonymous users โ†’ Deletes default anonymous accounts.

  3. Disallow remote root login โ†’ Ensures root can only log in from localhost.

  4. Remove test database โ†’ Deletes the unnecessary test DB.

๐Ÿ‘‰ These steps make MariaDB secure and production-ready.

๐Ÿ”‘ Understanding the bind-address in MariaDB for ERPNext

When setting up ERPNext on Ubuntu with MariaDB, one important configuration line you might have noticed in the erpnext.cnf file is:

bind-address = 127.0.0.1

But what does this mean, and why do we use it? ๐Ÿค”


๐ŸŒ What is bind-address?

The bind-address tells MariaDB which network interface (IP address) it should listen to for incoming connections.

  • 127.0.0.1 โ†’ This is the loopback address (localhost). It means MariaDB will only accept connections from the same machine where it is installed.

  • Any other IP (like 0.0.0.0 or serverโ€™s public IP) โ†’ MariaDB would listen to requests from outside machines too.


๐Ÿ”’ Why use 127.0.0.1 for ERPNext?

For most ERPNext installations:
โœ… ERPNext and MariaDB run on the same server.
โœ… We donโ€™t need external machines to connect directly to MariaDB.
โœ… It provides better security, as no one from outside the server can attempt to connect to the database.

This is why:

bind-address = 127.0.0.1

is the safest choice for local or single-server ERPNext setups.

โšก Step 4: Install Redis, Node.js, Yarn & Frappe Bench

In this step, we will install all the required tools to run ERPNext efficiently.


๐Ÿ› ๏ธ 4.1 Install Redis & wkhtmltopdf

1๏ธโƒฃ Install Redis & wkhtmltopdf:

sudo apt -y install redis-server wkhtmltopdf

๐Ÿ‘‰ redis-server: Used for caching and background task queues.
๐Ÿ‘‰ wkhtmltopdf: Helps ERPNext generate PDF reports (Invoices, Quotations, etc.).

2๏ธโƒฃ Enable Redis to start on boot:

sudo systemctl enable redis-server

๐Ÿ‘‰ Makes sure Redis automatically starts when the server reboots.

3๏ธโƒฃ Start Redis immediately:

sudo systemctl start redis-server

๐Ÿ‘‰ Runs Redis service right now without waiting for reboot.\

4๏ธโƒฃ Test Redis is working:

redis-cli ping

๐Ÿ‘‰ If Redis is active, you will see PONG โœ….


โš™๏ธ 4.2 Install Node.js

1๏ธโƒฃ Add Node.js 18.x repository:

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

๐Ÿ‘‰ Downloads & configures Node.js LTS (18.x) setup for Ubuntu.

2๏ธโƒฃ Install Node.js:

sudo apt -y install nodejs

๐Ÿ‘‰ Installs both Node.js (runtime) and npm (package manager).

๐Ÿ“ฆ 4.3 Install Yarn

1๏ธโƒฃ Install Yarn globally:

sudo npm install -g yarn

๐Ÿ‘‰ Yarn is a faster package manager used by ERPNext frontend for handling JavaScript libraries.

2๏ธโƒฃ Check Yarn version:

yarn -v

๐Ÿ‘‰ Confirms Yarn is installed successfully.

3๏ธโƒฃ Check Node.js version:

node -v

๐Ÿ‘‰ Confirms Node.js installed properly.

4๏ธโƒฃ Check npm version:

npm -v

๐Ÿ‘‰ Confirms npm (Node package manager) is working.

๐Ÿš€ 4.4 Install Frappe Bench

1๏ธโƒฃ Install pipx (required for managing Python apps safely):

sudo apt -y install pipx

๐Ÿ‘‰ Installs pipx, which isolates Python-based applications.

2๏ธโƒฃ Add pipx to system PATH:

pipx ensurepath

๐Ÿ‘‰ Ensures pipx commands can run globally from terminal.

3๏ธโƒฃ Install Frappe Bench:

pipx install frappe-bench

๐Ÿ‘‰ Installs the bench tool, used to create and manage ERPNext projects/sites.

4๏ธโƒฃ Verify Bench installation:

bench --version

๐Ÿ‘‰ Confirms that Bench is installed correctly.

โœจ โœ… At this point, Redis, Node.js, Yarn, and Frappe Bench are all set up!

๐Ÿ—๏ธ Step 5: Installing Frappe Bench Framework

The Frappe Bench is the backbone of ERPNext. It helps you create, manage, and run multiple ERPNext sites with ease ๐Ÿš€. Letโ€™s set it up!


โšก 1. Create a Frappe Directory

mkdir -p ~/frappe && cd ~/frappe

๐Ÿ”น mkdir -p ~/frappe โ†’ Creates a new folder called frappe inside your home directory.
๐Ÿ”น cd ~/frappe โ†’ Immediately moves you inside that folder.

๐Ÿ‘‰ This ensures we have a clean space where all ERPNext files will be stored ๐Ÿ“‚.


โšก 2. Initialize Bench with Frappe v15

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

๐Ÿ”น bench init โ†’ Starts the setup of a new Bench environment.
๐Ÿ”น --frappe-branch version-15 โ†’ Installs the latest stable Frappe v15.
๐Ÿ”น frappe-bench โ†’ Name of the folder where the new Bench environment will be created.

๐Ÿ‘‰ After this, a new directory frappe-bench is created which contains all necessary files โš™๏ธ.


โšก 3. Move into Bench Directory

cd frappe-bench

๐Ÿ”น Switches into the frappe-bench folder created in the previous step.
๐Ÿ‘‰ From here, you can start creating ERPNext sites and apps ๐ŸŽฏ.

โœจ Step 6: Installing ERPNext and Applications

Once your Frappe Framework is ready, the next move is to bring ERPNext into action. This step will set up ERPNext inside your local environment ๐Ÿš€.


๐Ÿ–ฅ๏ธ 1. Create a New Site

bench new-site site1.local

๐Ÿ”น Creates a fresh site named site1.local.
๐Ÿ”น It will ask for:

  • MySQL root password ๐Ÿ”‘

  • Administrator password (used later for ERPNext login)

๐Ÿ‘‰ Think of this as preparing an empty house ๐Ÿ  where ERPNext will live.


๐Ÿ“ฅ 2. Download ERPNext App

bench get-app erpnext --branch version-15

๐Ÿ”น Fetches ERPNext source code from GitHub.
๐Ÿ”น --branch version-15 ensures you install the latest stable ERPNext (v15).

๐Ÿ‘‰ Like bringing ERPNext package ๐Ÿ“ฆ into your system.


๐Ÿ”— 3. Install ERPNext on Your Site

bench --site site1.local install-app erpnext

๐Ÿ”น Installs ERPNext inside your site.
๐Ÿ”น Now, site1.local is fully powered by ERPNext.

๐Ÿ‘‰ Imagine you just plugged ERPNextโ€™s engine ๐Ÿš‚ into your site.


๐ŸŽจ 4. Build ERPNext Assets

bench build --app erpnext

๐Ÿ”น Compiles JS, CSS, and frontend files.
๐Ÿ”น Without this, your ERPNext dashboard may look broken.

๐Ÿ‘‰ This step decorates the house ๐Ÿกโœจ, making ERPNextโ€™s UI ready.


โšก 5. Install Honcho (Process Manager)

pip install honcho
honcho --version

๐Ÿ”น Honcho helps run multiple services (Frappe, Redis, Workers) together.
๐Ÿ”น First command installs it, second confirms the version.

๐Ÿ‘‰ Think of Honcho as your site manager ๐Ÿ‘ท, keeping everything running smoothly.

โœ… Final Verification and Testing Your Setup

โ–ถ๏ธ Start ERPNext and Access on Localhost

Once ERPNext is installed, itโ€™s time to bring it to life! ๐Ÿš€

๐Ÿ”น Step 1: Go to your bench folder

cd ~/frappe-bench

๐Ÿ”น Step 2: Start ERPNext services

bench start

This command will launch the web server, scheduler, workers, and all background services required for ERPNext.

๐Ÿ”น Step 3: Open ERPNext in your browser

Now visit:

http://site1.local:8000

(If site1.local doesnโ€™t work, try http://localhost:8000)

โœจ And boom ๐Ÿ’ฅ โ€” your ERPNext dashboard will appear, ready for you to explore modules like HR, Sales, CRM, Accounting, Inventory, and more! ๐ŸŽฏ

๐ŸŽ‰ After installing ERPNext, complete the Setup Wizard by creating your admin account and entering your company details. Once done, youโ€™ll be redirected straight to the ERPNext dashboard, ready to explore all modules. ๐Ÿš€

โš ๏ธ Notice
If you donโ€™t see modules like HR, Sales, CRM, Accounting, or Tools on your ERPNext dashboard after installation, donโ€™t worry!

๐Ÿ‘‰ Simply use the Search Bar (Ctrl + G) at the top and type the module name (e.g., HR or Sales). Once opened, you can pin or add them to your sidebar/dashboard.

This happens because ERPNext hides some modules by default โ€” but they are all available and just one search away. โœ…

โœ… Conclusion
Youโ€™ve now completed the full journey from setting up the server to launching ERPNext on your browser. ๐ŸŽฏ With modules like HR, Sales, CRM, Accounting, and Inventory, your business is ready to streamline operations on a modern open-source ERP system. This is just the beginning explore, customize, and make ERPNext truly yours! ๐Ÿš€

๐Ÿ‘จโ€๐Ÿ’ป About the Author

This project is a deep dive into the ERPNext ecosystem, designed to strengthen my foundation in enterprise resource planning, business automation, and modular integration using open-source technology.

This series isnโ€™t just about installing ERPNext; itโ€™s about mastering the core modules that power modern business management from HR and Sales to Accounting, Inventory, and CRM. ๐Ÿš€


๐Ÿ“ฌ Let's Stay Connected

โœจ Final Note
This blog is a reflection of my personal journey and learning efforts. I have written and shaped it with my own understanding and dedication. Still, perfection is a continuous process so if you find any mistakes, missing points, or areas of improvement, feel free to share your suggestions in the comments. Your feedback will not only help me improve this work but will also add more value to everyone who reads it. ๐Ÿš€

Thank you for taking the time to read! ๐Ÿ™Œ

0
Subscribe to my newsletter

Read articles from Gujjar Apurv directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Gujjar Apurv
Gujjar Apurv

Gujjar Apurv is a passionate DevOps Engineer in the making, dedicated to automating infrastructure, streamlining software delivery, and building scalable cloud-native systems. With hands-on experience in tools like AWS, Docker, Kubernetes, Jenkins, Git, and Linux, he thrives at the intersection of development and operations. Driven by curiosity and continuous learning, Apurv shares insights, tutorials, and real-world solutions from his journeyโ€”making complex tech simple and accessible. Whether it's writing YAML, scripting in Python, or deploying on the cloud, he believes in doing it the right way. "Infrastructure is code, but reliability is art."