ERPNext Setup on Ubuntu 22.04 β From Zero to Hero!

Search for a command to run...

No comments yet. Be the first to comment.
Learn AWS from basics to advanced with daily hands-on tasks and real-world projects. Master core services like EC2, S3, IAM, Lambda, and more all explained in a practical, job-ready DevOps format.
Aim π― The aim of this task is to securely backup and restore data from another cloud (Pcloud) to AWS S3. πΎπTo achieve this, I performed the entire task using Rclone, created an automated Bash script, and scheduled Cron jobs to ensure continuous, s...
Master GitLab CI/CD Variables, Secrets Management, Artifacts & Best Practices π Introduction In the previous article, we learned how GitLab Runners execute CI/CD pipelines and how to configure Self-H

Learn GitLab Runners, Hosted vs Self-Hosted Runners, Runner Registration, Tags, Pipeline Editor & Parallel Jobs π Introduction In the previous article, we created our first GitLab CI/CD pipeline and

Learn Continuous Integration, Continuous Delivery, Pipelines, Stages, Jobs & .gitlab-ci.yml π Introduction In the previous articles, we explored GitLab fundamentals, repository management, and collab

Learn Docker Scout, Multi-Stage Builds, Docker Hardened Images (DHI), SBOM, Docker Model Runner, Ask Gordon AI, and production-ready container security through practical, real-world examples. Introduc

Import Repositories, Mirroring & Repository Management Best Practices π Introduction In the previous articles, we learned the fundamentals of GitLab, created projects, and configured secure authentic

π Introduction: Why ERPNext?
π― Aim of this Blog
π οΈ Prerequisites Before You Begin
βοΈ Step 1: Server Setup β Preparing Ubuntu for ERPNext
π¦ Step 2: Install Required Packages
ποΈ Step 3: Configure MySQL Server
π§ Step 4: Install CURL, Node.js, NPM, and Yarn
ποΈ Step 5: Install Frappe Bench Framework
π Step 6: Install ERPNext and Other Applications
β Final Verification and Testing Your Setup
π Conclusion: Running ERPNext Smoothly
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.
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.
Before we start the installation, make sure your system meets the minimum 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.)
Perform the installation on a local machine for practice/testing.
Ensure you have basic Linux command knowledge (updating system, installing packages, using terminal).
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
Correct timezone ensures accuracy in reports, HR, and payroll:
sudo timedatectl set-timezone Asia/Kolkata
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.
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.
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.

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.

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.

Now, letβs secure the MariaDB server.
sudo mysql_secure_installation
π Explanation:
This is an interactive script that asks security-related questions:
Set root password β Protects the database root user with a password.
Remove anonymous users β Deletes default anonymous accounts.
Disallow remote root login β Ensures root can only log in from localhost.
Remove test database β Deletes the unnecessary test DB.
π These steps make MariaDB secure and production-ready.

bind-address in MariaDB for ERPNextWhen 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? π€
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.
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.

In this step, we will install all the required tools to run ERPNext efficiently.
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 β .

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).

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.

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!

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!
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 π.
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 βοΈ.
cd frappe-bench
πΉ Switches into the frappe-bench folder created in the previous step.
π From here, you can start creating ERPNext sites and apps π―.


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 π.
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.
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.
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.
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.


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.

Once ERPNext is installed, itβs time to bring it to life! π
cd ~/frappe-bench
bench start
This command will launch the web server, scheduler, workers, and all background services required for ERPNext.


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! π

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. π
π§ Email: gujjarapurv181@gmail.com
π GitHub: github.com/ApurvGujjar07
πΌ LinkedIn: linkedin.com/in/apurv-gujjar
β¨ 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! π