Welcome to our comprehensive guide on installing ERPNext Version 15 on Ubuntu 24.04. ERPNext is a powerful, open-source ERP system that streamlines business processes from inventory management to accounting. Whether you’re new to ERPNext or you have worked with it for years, this step-by-step tutorial will walk you through the installation process, ensuring you have everything set up correctly on your Ubuntu 24.04 system. Let’s dive in and get ERPNext up and running efficiently!
Prerequisites
The below prerequisites are advised in order to get an optimal functionality of ERPNext on your server.
Software Requirements
- Updated Ubuntu 24.04
- A user with sudo privileges
- Python 3.11+
- pip 20+
- MariaDB 10.3.x
- Node.js 18
- yarn 1.12+
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)
In Linux, the root user processes escalated privileges to perform any tasks within the system. 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]
Ensure you have replaced [frappe-user] with your username. eg. sudo adduser frappe
Install Required Packages
A software like ERPNext, which is built on Frappe Framework, requires a number of packages in order to run smoothly. These are the packages we will be installing in this step.
Install GIT
sudo apt-get install git -y
Install Python Dependencies
Installing ERPNext version 15 on Ubuntu 24.04 requires Python version 3.11+. This is what we will install in this step.
python-dev
sudo apt-get install python3-dev -y
setuptools and pip
sudo apt-get install python3-setuptools python3-pip -y
virtualenv
sudo apt install python3.12-venv -y
Install MariaDB
ERPNext is built to naively run on MariaDB. Lets go ahead and set that up now.
sudo apt-get install software-properties-common -y sudo apt install mariadb-server -y 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 current password for root: (Enter your SSH root user password)
- 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 to the end of the file, 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
Install Redis Server
sudo apt-get install redis-server -y
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 18
Install NPM
sudo apt-get install npm -y
Install Yarn
sudo npm install -g yarn -y
Install wkhtmltopdf
sudo apt-get install xvfb libfontconfig wkhtmltopdf -y
Install Frappe Bench
In this step, we need to supply the – H and –break-system-packages flags. The flags do the following:
-H
: Sets theHOME
environment variable to the home directory of the target user. This ensures that the package installation happens in the correct directory and avoids permission issues.--break-system-packages
: Overrides the default behavior ofpip
to avoid breaking system packages. This flag is used to indicate that you are aware that this installation might cause conflicts with the system package manager, but you want to proceed anyway.
sudo -H pip3 install frappe-bench --break-system-packages
Install ansible
sudo -H pip3 install ansible --break-system-packages
Initialize Frappe Bench
bench init frappe-bench --frappe-branch version-15
Switch directories into the Frappe Bench directory
cd frappe-bench
Change user directory permissions
This will give the bench user execution permission to the home directory.
chmod -R o+rx /home/[frappe-user]
Create a New Site
A site is a requirement in ERPNext, Frappe and all the other apps we will be needing to install. We will create the site in this step.
bench new-site [site-name]
Install ERPNext and other Apps
Download all the apps we want to install
The first app we will download is the payments app. This app is required when setting up ERPNext.
bench get-app payments
Next, we will download ERPNext app
bench get-app --branch version-15 erpnext
Download any other app you may be interested in in a similar manner. For instance, if you need the Human Resource app to be installed, use the following command.
bench get-app hrms
Install all the apps on our site
bench --site [site-name] install-app erpnext
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
We have successfully setup ERPNext version 15 on ubuntu 24.04. You can start the server by running the below command:
bench start
If you didn’t have any other ERPNext instance running on the same server, ERPNext will get started on port 8000. If you visit [YOUR SERVER IP:8000], you should be able to see ERPNext version 15 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.
In the below steps, we will 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, 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.
If you would like to install an SSL certificate on your site, use this tutorial to do that.
All the best! 🙂