Introduction
ERPNext is an open-source enterprise resource planning (ERP) solution that offers a wide range of modules to cater to various industries such as manufacturing, distribution, retail, trade, services, education, non-profit, and healthcare. With features like accounting, CRM, sales, purchasing, website, e-commerce, point of sale, manufacturing, warehouse, project management, inventory, and services, ERPNext provides a comprehensive solution for businesses. In this tutorial, we will guide you through the installation process of ERPNext on a Debian 12 server, ensuring that you have all the necessary dependencies and configurations in place.
Prerequisites
Before we begin the installation process, let’s make sure we have all the prerequisites in place. Here’s what you’ll need:
- A Debian 12 server
- A non-root user with sudo administrator privileges
- A domain name pointed to the server IP address
Installing Dependencies
To install ERPNext, we need to install several dependencies on our Debian server. These include Python 3, MariaDB Server, Node.js, Yarn package manager, Nginx, Supervisor process manager, and Redis. Let’s go through the installation process step by step.
First, update your Debian package index by running the following command:
sudo apt update
Next, install the dependencies by running the following command:
sudo apt install python3-dev python3-venv nodejs yarnpkg npm redis-server mariadb-server nginx supervisor fail2ban libffi-dev git python3-pip python3-testresources libssl-dev wkhtmltopdf gcc g++ make
When prompted, type ‘y’ to proceed with the installation.
Once the dependencies are installed, let’s verify each one to ensure everything is set up correctly.
To verify the MariaDB server, run the following command:
sudo systemctl is-enabled mariadb
sudo systemctl status mariadb
Make sure the service is enabled and running.
Next, verify the Nginx service by running the following command:
sudo systemctl is-enabled nginx sudo systemctl status nginx You should see that Nginx is enabled and running.
Now, let’s verify the Supervisor process manager by running the following command:
sudo systemctl is-enabled supervisor
sudo systemctl status supervisor
Make sure the service is enabled and running.
Finally, let’s verify Redis by running the following command:
sudo systemctl is-enabled redis-server sudo systemctl status redis-server
You should see that Redis is enabled and running.
To verify the Node.js and NPM versions, run the following command:
node --version npm --version
Make sure you have the desired versions installed.
Lastly, verify the wkhtmltopdf version by running the following command:
wkhtmltopdf --version wkhtmltoimage --version
Ensure that the version is as expected.
Configuring MariaDB Server
After installing the dependencies, we need to configure the MariaDB server to prepare it for the ERPNext installation. We’ll enable the barracuda format, set the default character set to utf8mb4, and secure the server. Let’s go through the steps.
First, secure the MariaDB server by running the following command:
sudo mariadb-secure-installation
Follow the prompts and configure the server according to your preferences. Make sure to set a strong password for the root user.
Next, open the MariaDB Server configuration file using the nano editor:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Within the [mysqld]
section, add the following configuration to enable the barracuda format and set the default character set to utf8mb4:
[mysqld] innodb-file-format=barracuda innodb-file-per-table=1 innodb-large-prefix=1 character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci
Save the file and exit the editor.
Next, open the MariaDB client configuration file using the nano editor:
sudo nano /etc/mysql/mariadb.conf.d/50-mysql-clients.cnf
Within the [mysql]
section, add the following configuration:
[mysql] default-character-set = utf8mb4
Save the file and exit the editor.
Finally, restart the MariaDB server to apply the new configuration:
sudo systemctl restart mariadb
Installing the Frappe Bench
To manage the Frappe Framework and install ERPNext, we need to install the Frappe Bench. The Frappe Bench is a command-line tool that allows us to manage applications and sites built using the Frappe Framework. Let’s go through the installation process.
First, let’s create a new user that will be used for ERPNext. Run the following command:
sudo useradd -m -s /bin/bash frappe sudo passwd frappe
Set a password for the frappe user.
Next, add the frappe user to the sudo group:
sudo usermod -aG sudo frappe
Now, log in as the frappe user and install the Frappe Bench using pip:
su - frappe sudo pip3 install frappe-bench --break-system-packages
Once the installation is complete, verify the installation:
which bench
bench --version
You should see the version of the bench installed.
Installing ERPNext via Bench
Now that we have the Frappe Bench installed, we can proceed with the installation of ERPNext. Let’s initialize the Frappe Framework project, create a new site, and download and install ERPNext.
First, initialize the Frappe Framework project by running the following command:
bench init --python python3.11 --frappe-branch version-14 frappe-bench
Wait for the initialization process to complete.
Next, set the appropriate permissions for executing the Frappe Framework:
sudo chmod -R o+rx /home/frappe/frappe-bench
Move to the Frappe Framework installation directory:
cd ~/frappe-bench
Create a new site for ERPNext:
bench new-site erp.example.io --admin-password 'erpadmin' --mariadb-root-username root --mariadb-root-password 'password'
Replace erp.exampe.io
with your desired site name, and set a secure password for the admin user.
Switch to the new site:
bench use erp.example.io
Download the necessary applications:
bench get-app payments bench get-app --branch version-14 erpnext
Install ERPNext and the payments application:
bench --site erp.example.io install-app erpnext
Enable the scheduler and disable maintenance mode:
bench --site erp.example.io enable-scheduler bench --site erp.axample.io set-maintenance-mode off
Congratulations! You have successfully installed ERPNext on Debian 12. You can now access the ERPNext dashboard by visiting your domain name in a web browser, such as http://erp.example.io/
. Log in with the admin user and the password you set during the installation.
Conclusion
In this tutorial, we walked through the process of installing ERPNext on a Debian 12 server. We covered the installation of dependencies, configuration of MariaDB server, installation of the Frappe Bench, and the installation of ERPNext via the Bench command line. Now, you can leverage the power of ERPNext to streamline your business processes and improve efficiency.
If you’re looking for reliable and scalable cloud hosting solutions for your ERPNext installation, consider Shape.host. They provide SSD Linux VPS hosting that is optimized for ERPNext, ensuring fast performance and secure data storage. With Shape.host, you can focus on your business while they take care of your hosting needs.