ERPNext is one of the best open-source ERP software systems you will ever see. It is a free, open-source software that you can use to manage your business. ERPNext is an ERP system that enables users to monitor and manage various core business functions from a single, centralized software environment. Users can develop a more productive and collaborative work experience with intuitive Kanban-style dashboards and boards that help ensure employees across all locations are aware of all current deadlines and benchmarks. In this tutorial, we will teach you how to install ERPNext on Debian 13.
Table of Contents
Prerequisites
- A fresh Debian 13 VPS with at least 4GB of RAM.
- SSH root access, or a user with sudo privileges.
Conventions
# – given commands should be executed with root privileges either directly as a root user or by use of sudo command
$ – given commands should be executed as a regular user
Step 1. Add System User
ERPNext will be running under a system user, and we will create one. Let’s execute this command to add a new system user.
# adduser erpnext
You will be prompted to create a password for this user. Ensure you use a strong password. Now, let’s add the user as a sudoer.
# usermod -aG sudo erpnext
Now, let’s switch to the new user.
# su - erpnext
Step 2. Install Dependencies
There are some dependencies to install. Simply run these commands.
$ sudo apt install build-essential
$ sudo apt install git redis-server curl xvfb libfontconfig default-libmysqlclient-dev
As you can see, Redis is also installed. It is required to cache and improve performance, especially within the Frappe Framework. The Redis server should be up and running once installed.
Step 3. Install Python
These are the primary packages we need to install. Debian 13 ships with Python 13, which ERPNext supports. Let’s run this command to install them from the default Debian 13 repository.
$ sudo apt install python3-{dev,setuptools,pip,venv}
Step 4. Install Node.Js
ERPNext requires NodeJS runtime environment and npm. In this step, we will install Node.js and npm through the Node.js repository to obtain the latest version.
$ curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
Once completed, we need to download the package information from the newly added source above.
$ sudo apt update
Next, run the following command to complete the installation of Node.js and NPM.
$ sudo apt install nodejs
That’s it, nodeJS and NPM are installed, you can check the installed version by executing this one-liner:
$ node -v; npm -v
You will see an output like this:
erpnext@erpnext:~$ node -v; npm -v
v22.16.0
10.9.2
We also need to install yarn. Let’s install it now.
$ sudo npm install --global yarn
$ exit
Step 5. Install and Configure MariaDB Server
Debian 13 has MariaDB as the default MySQL database server. Let’s execute the command below to install it.
# apt install mariadb-server
On a Debian system, the MariaDB server will be running automatically upon installation. Now, let’s secure the MariaDB server by running the following command:
# mariadb-secure-installation
Follow the prompts and answer the questions to configure the server according to your preferences. Ensure you use a strong password for the root user.
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n]
Enabled successfully!
Reloading privilege tables..
... Success!
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n]
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n]
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n]
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n]
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
Next, open the MariaDB Server configuration file using the nano editor:
# nano /etc/mysql/mariadb.conf.d/50-server.cnf
Within the [mysqld] section, add the following lines:
[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.
If there is no [mysqld] section, simply append the lines into that file.
Next, edit the MariaDB client configuration:
# nano /etc/mysql/mariadb.conf.d/50-mysql-clients.cnf
Within the [mysql] section, add the following:
[mysql]
default-character-set = utf8mb4
If there is no [mysqld] section, simply append the lines to that file.
Save the file and exit the editor.
Finally, restart the MariaDB server to apply the new configuration:
# systemctl restart mariadb
Step 6. Install Nginx and Supervisor
To run ERPNext in production mode, we will need to install these services. Simply run the command below to get them installed.
# apt install nginx supervisor
Next, we can edit the nginx user in /etc/nginx/nginx.conf.
# nano /etc/nginx/nginx.conf
Find this line at the top of the file.
user www-data;
and replace with this:
user erpnext;
Then, add this line in the http section:
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';
It should look like this:
user erpnext;
worker_processes auto;
worker_cpu_affinity auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';
...
...
...
Save the changes and then enable both Nginx and Supervisor
# systemctl enable --now nginx supervisor
Step 7. Install ERPNext
In the initial step, we created a new system user. Now, let’s switch to that user and run commands to install ERPNext.
# su - erpnext
Note: There is a problem with Python 3.13 and Debian 13; workaround:
$ sudo rm /usr/lib/python3.*/EXTERNALLY-MANAGED
Now, let’s install Frappe
$ sudo pip3 install frappe-bench --break-system-packages
It is time to download ERPNext
$ bench init frappe-bench --frappe-branch version-15
Then, we can create a website
$ cd frappe-bench
$ bench new-site yourdomain.com
Ensure that you replace ‘yourdomain.com’ with your actual domain name, which points to your server. The command above will prompt you for the MySQL root password. You will also create a new administrator password in this step.
[erpnext@rh frappe-bench]$ bench new-site erpnext.rosehosting.com
MySQL root password:
Installing frappe...
Updating DocTypes for frappe : [========================================] 100%
Set Administrator password:
Re-enter Administrator password:
Updating Dashboard for frappe
erpnext.rosehosting.com: SystemSettings.enable_scheduler is UNSET
*** Scheduler is disabled ***
Then, we can enable the scheduler.
$ bench --site yourdomain.com enable-scheduler
$ bench --site yourdomain.com set-maintenance-mode off
Again, do not forget to replace ‘yourdomain.com’ with your actual domain name that points to your server.
The next step, once the scheduler is enabled, is to install the ERPNext app:
$ bench get-app erpnext --branch version-15
$ bench --site yourdomain.com install-app erpnext
Step 6. ERPNext in Production Mode
Run these commands to get nginx and supervisord running with ERPNext configuration.
$ sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.conf
$ sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe-bench.conf
Then, execute these commands
$ bench setup supervisor
$ bench setup nginx
Finally, we can restart the services.
$ sudo systemctl restart supervisor nginx
$ sudo supervisorctl start all
At this point, you should be able to access ERPNext at http://yourdomain.com. You can log in to the backend using the administrator’s username and the password you specified in the previous step.
Once logged in, you will be prompted to configure your language, time zone, country, and currency. Click Next to continue.
Then, you need to set up your account and complete the setup
Finally, you will be taken to the backend, and you can now start customizing your ERPNext website.
You’ve learned how to install ERPNext on Debian 13
Congratulation! You have successfully learned how to install ERPNext on Debian 13. For more information about ERPNext, please refer to the ERPNext website.
If you are one of our active clients and use our managed ERPNext hosting, you don’t have to install ERPNext on Debian 13 by yourself. Our Linux administrators will install and configure a fully functional ERPNext virtual private server (VPS) for you. They are available 24×7 and will take care of your request immediately. You just need to drop a ticket to get ERPNext installed on your server. If you liked this post on how to install ERPNext on Debian 13, please share it with your friends or leave a comment below.