Dvarika - ERPNext 15 Installation on Ubuntu 22.04 Server
By Karthic Veeraraghavan on April 14, 2025
BeginnerNote: All the content below in Italic are not commands, these comments or instructions for your understanding.
Pre-requisites
- Ubuntu 22.04 LTS
- Python 3.10+
- Node.js 20+
- MariaDB 10.3.x
- A user with sudo privilegesUpdate & Upgrade
Run the below commands as root user
Check the current date & time of the Server
date
timectl set-timezone “Asia/Kolkata”
sudo apt-get update -y
sudo apt-get upgrade -y
Create User with sudo privileges
sudo adduser [frappe-user]
usermod -aG sudo [frappe-user]
Switch to new user, to run the below commands (Do not run the commands on root user)
su [frappe-user]
cd /home/[frappe-user]
Install dependencies (with Python 3.10)
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils
sudo apt install python3.10-venv
Install remaining dependencies
sudo apt-get install redis-server
sudo apt-get install supervisor
sudo apt-get install fail2ban
sudo apt-get install software-properties-common
sudo apt install mariadb-server mariadb-client
sudo mysql_secure_installation
Answer the queries as mentioned below:
Enter current password for root:
Switch to unix_socket authentication [Y/n]: Y
Change the root password? [Y/n]: Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
sudo nano /etc/mysql/mariadb.conf.d/my.cnf
Enter the following lines at the end of the config file as it is
[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
[mysql]
default-character-set = utf8mb4
Restart the MYSQL to effect the config file change
sudo service mysql restart
sudo apt-get install xvfb libfontconfig
Below command not required to be executed for New Installation. (Required ONLY for old Installation)
Install htmltopdf with QT (Optional) & remove the downloaded file from the server
sudo dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb
sudo apt --fix-broken install
rm wkhtmltox_0.12.6.1-2.jammy_amd64.deb
sudo apt-get install libmysqlclient-dev
sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 20
sudo apt-get install npm
sudo npm install -g yarn
Reboot the server and login with the new user created above
sudo reboot now
Install Frappe Bench (version-15)
sudo pip3 install frappe-bench
bench init [frappe-folder] --frappe-branch version-15
cd [frappe-folder]/
yarn add node-sass
chmod -R o+rx /home/[frappe-user]
Install ERPNext & other Apps as required
bench new-site [site-name]
bench get-app erpnext --branch version-15
bench get-app payments
bench --site [site-name] install-app erpnext
Using ERPNext in Developer Mode & for Local Use
bench use [site-name]
bench start
Setting ERPNext for Production & for Server Use
bench --site [site-name] enable-scheduler
bench --site [site-name] set-maintenance-mode off
Set Host Name, open the file add the required host name
nano sites/[site-name]/site_config.json
“host_name”: “[domain-name]”,
sudo bench setup production [frappe-user]
bench setup nginx
sudo supervisorctl restart all
sudo bench setup production [frappe-user]
Setup Multitenancy
bench config dns_multitenant on
bench new-site [site2name]
bench setup nginx
sudo service nginx reload
Adding a Domain with SSL to your Site (Optional)
bench setup add-domain [desired-domain] –site [site-name]
sudo apt install snapd
sudo snap install core
sudo snap refresh core
sudo apt-get remove certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo -H bench setup lets-encrypt [site-name]
Installing other modules
bench get-app [path/app-name] –branch version-15
bench –site [site-name] install-app [app-name]
bench –site [site-name] migrate
Update the frappe bench, modules & apps
cd ~
pip3 install –upgrade frappe-bench
cd frappe-folder/
bench update –reset [--no-backup]
bench –site [site-name] migrate
More articles on ERPNext