If you are in an organization, ERP solution is a must have to manage many things like, HR, CRM, Accounts, Inventory and much more. ERPNext is one of the best and most powerful ERP solution. It is open-source, stable, fast and provider better UI. The latest version of ERPNext is the best in terms of stability, architecture, performance and UI. So lets see how to install and configure ERPNext V15 on Debian 13
In this tutorial, you will learn
- Prerequisites
- Step 1 – Add a New User
- Step 2 – Update the System and Install Required Dependencies
- Step 3 – Install MariaDB
- Step 4 – Install Node.js and Yarn
- Step 5 – Install Redis Server
- Step 6 – Install Frappe Bench
- Step 7 – Install ERPNext and other Apps
- Step 8 – Testing ERPNext
- Step 9 – Setup ERPNext in Production
- Step 10 – Configure Firewall, Domain and SSL
- Conclusion
Prerequisites
- A Debian based server
Step 1 – Add a New User
The first step is to add a dedicated sudo user that will do all the activities to setup and install ERPNext and will also manage all the tasks of ERPNext.
# sudo adduser erpnext
# sudo usermod -aG sudo erpnext
Now switch to erpnext user
# su - erpnext
Step 2 – Update the System and Install Required Dependencies
In the second step. let’s first update the system and install required dependencies that will help us in further steps
# sudo apt update
# sudo apt upgrade -y
Now let’s install the required dependencies
# sudo apt install git curl wget sudo certbot
# sudo apt install python3 python3-dev python3-setuptools python3-pip python3-venv libffi-dev libssl-dev libsasl2-dev -y
# sudo apt install libmysqlclient-dev libtiff5-dev libjpeg62-turbo-dev \
liblcms2-dev libwebp-dev libfreetype6-dev libxslt1-dev libzip-dev \
libldap2-dev libcups2-dev pkg-config libsasl2-dev libmariadb-dev-compat -y
Step 3 – Install MariaDB
The third step is to install and configure MariaDB which will be our database to store all the data.
# sudo apt install mariadb-server mariadb-client -y
Now lets start and enable MariaDB server and set it to auto enable whenever the server is booted
# sudo systemctl start mariadb
# sudo systemctl enable mariadb
To verify if its working properly
# sudo systemctl status mariadb
Now let’s secure our database
# sudo mariadb-secure-installation
Use these options to configure
Enter current password for root (leave blank if none): {Just hit Enter key here}
Switch to unix_socket authentication? (Y/n):N {Press N and hit Enter}
Change the root password? (Y/n):Y {Press Y and hit Enter to setup root password}
Remove anonymous users? (Y/n):Y {Press Y and hit Enter}
Disallow root login remotely? (Y/n):Y {Press Y and hit Enter}
Remove test database and access to it? (Y/n): Y {Press Y and hit Enter}
Reload privilege tables now? (Y/n): Y {Press Y and hit Enter}
Now lets setup our database
# sudo mysql -u root -p
CREATE DATABASE IF NOT EXISTS frappe;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_strong_password';
FLUSH PRIVILEGES;
EXIT;
Note: Replace "your_strong_password" with a strong password of your choice
Step 4 – Install Node.js and Yarn
Since ERPNext use Node.js and yarn to execute and run all the javascripts on backend and frontend. Let’s install Node.js
# sudo curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
# sudo apt install nodejs -y
# sudo npm install -g yarn
To check if nodejs is installed, run the following command
# node --version
Step 5 – Install Redis Server
As we all know, Redis is used for database caching and maintain communication with socket, Let’s install that too
# sudo apt install redis-server -y
# sudo apt install wkhtmltopdf -y
# sudo sed -i 's/supervised no/supervised systemd/g' /etc/redis/redis.conf
# sudo systemctl restart redis
# sudo systemctl enable --now redis-server
Step 6 – Install Frappe Bench
To manage ERPNext installation, we need bench command line tool. So let’s install it
# sudo apt install python3.11-venv python3.11-dev -y
# sudo pip3 install frappe-bench
Let’s check if Bench is install properly
# bench --version
Now let’s initialze directory for bench
# bench init frappe-bench --frappe-branch version-15
# cd frappe-bench
The above commands will create a full environment for bench
Now lets set the permissions
# sudo chown -R erpnext:erpnext /home/erpnext/frappe-bench
# sudo chmod 750 /home/erpnext
Now lets create a website with the followwing command for your domain
# bench new-site erp.yourdomain.com
Note:- Make sure to change "yourdomain.com" to your real domain name
When prompted for MySQL root password and ERPNext administrator password. So for MySQL use the password you have set in step 3 and configure the ERPNext password as per your wish.
Step 7 – Install ERPNext and other Apps
Now we have to install payments app which is required by ERPNext. So let’s install it.
# bench get-app payments
Download main ERPNext app
# bench get-app --branch version-15 erpnext
If you need, you can install hrms app as well. Consider it optional
# bench get-app hrms
Now lets check if all the apps are properly installed
# bench version --format table
Now lets install all the apps on our website
# bench --site erp.yourdomain.com install-app erpnext
Note: Make sure to change "yourdomain.com" to your real domain name
Now lets install HR and Payroll app. Consider this optional
# bench --site erp.yourdomain.com install-app hrms
Note: Make sure to change "yourdomain.com" to your real domain name
Step 8 – Testing ERPNext
Now that we are in development mode, lets first test our setup
# bench start
Now access on any browser using “http://YOUR_SERVER_IP:8000“
Note:- Make sure to change "YOUR_SERVER_IP" with your real server IP address
Step 9 – Setup ERPNext in Production
To setup ERPNext in production, we have to configure Nginx and Supervisor which will keep running the app on the background
# bench setup production erpnext
Disable maintenance mode
# bench --site erp.yourdomain.com set-maintenance-mode off
Now let’s restart the Supervisor
# sudo supervisorctl restart all
Step 10 – Configure Firewall, Domain and SSL
The final step is to configure our firewall, domain and SSL
Update the firewall with this
# sudo apt install ufw -y
# sudo ufw allow 22/tcp
# sudo ufw allow 80/tcp
# sudo ufw allow 443/tcp
# sudo ufw --force enable
Now setup SSL
# sudo bench setup lets-encrypt erp.yourdomain.com
Note: Change "yourdomain.com" to your real domain in the above command
Now lets Verify if everything is working fine
# sudo systemctl status nginx
# sudo supervisorctl status all
# bench --site erp.yourdomain.com scheduler status
Note: Change "yourdomain" to your real domain name
Now Open any browser and access the ERPNext application using “https://erp.yourdomain.com” (change yourdomain to the domain your have used in above steps).
Conclusion
With this you we have successfully configured ERPNext on Debian 13 with SSL. For more information, you can check out the official ERPNext documentation. Comment below for any queries.
Leave a Reply