A complete Guide on How to Install Frappe/ERPNext version 15 in Ubuntu 22.04 LTS
Install ERPNext
Setup Production
Setup Multitenancy
Add a Domain
Install SSL Certificate
Ubuntu 22.04 LTS
Python 3.11+
Node.js 20+
A user with sudo privileges
MariaDB 10.3.x
sudo apt-get update -y
sudo apt-get upgrade -y
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
For setting up ERPNext 15, we need to install several software packages first.
Install Python ERPNext version 15 requires Python version 3.11+.
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get install python3-dev python3.11-dev python3-setuptools python3-pip python3-distutils
sudo apt install python3.10-venv python3.11-venv
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
sudo apt-get install redis-server
sudo apt-get install software-properties-common
sudo apt install mariadb-server mariadb-client
sudo mysql_secure_installation
Upon running the last command, you’ll encounter a series of prompts on the server. Make sure to follow the subsequent steps carefully to ensure the setup is configured properly.
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
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
[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
sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev
sudo apt install curl
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
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]
bench new-site [site-name]
bench get-app erpnext --branch version-15
bench get-app payments --branch version-15
bench --site [site-name] install-app erpnext
bench use [site-name]
bench start
bench --site [site-name] enable-scheduler
bench --site [site-name] set-maintenance-mode off
sudo bench setup production [frappe-user]
bench setup nginx
sudo supervisorctl restart all
sudo bench setup production [frappe-user]
You can name your sites as the hostnames that would resolve to it. Thus, all the sites you add to the bench would run on the same port and will be automatically selected based on the hostname.
To make a new site under DNS based multitenancy, perform the following steps.
bench config dns_multitenant on
bench new-site site2name
bench setup nginx
sudo service nginx reload
bench setup add-domain [desired-domain]
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]
You will be faced with several prompts, respond to them accordingly. This command will also add an entry to the crontab of the root user (this requires elevated permissions), that will attempt to renew the certificate every month.