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 frappeuser
sudo usermod -aG sudo frappeuser
su frappeuser
cd /home/frappeuser
- Ensure you have replaced [frappeuser] 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) (Press blank Enter if for the first time)
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
#restart mariadb to update my.cnf
sudo systemctl restart mariadb
sudo apt-get install xvfb libfontconfig
sudo apt-get install libmysqlclient-dev
sudo apt-get install fontconfig libxrender1 xfonts-75dpi
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb && sudo dpkg --install wkhtmltox_0.12.6.1-2.jammy_amd64.deb;
#Test the install: wkhtmltopdf 0.12.6 (with patched qt)
wkhtmltopdf --version
sudo apt install curl
sudo apt install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
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
sudo chmod -R o+rx /home/frappeuser
bench new-site [site-name]
bench get-app erpnext --branch version-15
bench get-app hrms --branch version-15
bench get-app --branch version-15 https://github.com/resilient-tech/india-compliance.git
bench get-app https://github.com/The-Commit-Company/Raven.git
bench --site [site-name] install-app erpnext
bench --site [site-name] install-app hrms
bench --site [site-name] install-app india_compliance
bench --site [site-name] install-app raven
bench config dns_multitenant on
bench --site [site-name] add-to-hosts
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 frappeuser
bench --site [site-name] --force restore [path to database backup file] --with-private-files [relative-path-to-private-files-backup-file] --with-public-files [relative-path-to-public-files-backup-file]
bench --site [site-name] migrate
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.
This how to has been prepared in reference with