sudo apt-get update -y
sudo apt-get upgrade -y
It is recommended not to use the root user for daily tasks. Create a new user for managing Frappe Bench.
sudo adduser [frappe-user]
usermod -aG sudo [frappe-user]
su [frappe-user]
cd /home/[frappe-user]
Replace [frappe-user]
with your desired username, e.g., sudo adduser frappe
.
sudo apt-get install git
ERPNext v15 requires Python 3.10+.
sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils
sudo apt-get install python3.10-venv
sudo apt-get install software-properties-common
ERPNext requires MariaDB for database management.
sudo apt install mariadb-server mariadb-client
sudo apt-get install redis-server
These dependencies are needed for fonts, PDFs, and other resources.
sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev
Run the following command and follow the prompts:
sudo mysql_secure_installation
Y
Y
Y
N
Y
Y
Edit the configuration file:
sudo nano /etc/mysql/my.cnf
Add the following block of code:
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
sudo service mysql restart
sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 18
sudo apt-get install npm
sudo npm install -g yarn
sudo pip3 install frappe-bench
bench init --frappe-branch version-15 frappe-bench
cd frappe-bench
chmod -R o+rx /home/[frappe-user]
Replace [frappe-user]
with your username.
A site is required to set up ERPNext and its apps.
bench new-site [site-name]
bench get-app payments
bench get-app --branch version-15 erpnext
bench --site [site-name] install-app erpnext
Replace [site-name]
with your site name.
The scheduler is required to run background tasks in ERPNext. Enable it using the following command:
bench --site [site-name] enable-scheduler
Replace [site-name]
with your actual site name.
Turn off maintenance mode to make the site accessible to users:
bench --site [site-name] set-maintenance-mode off
Set up production mode for ERPNext, including Supervisor and NGINX configurations:
sudo bench setup production [frappe-user]
Replace [frappe-user]
with the username you created for the bench.
Apply changes to the NGINX configuration:
bench setup nginx
After completing the setup, ERPNext will be accessible on port 80 (default HTTP port). You can access it in a web browser using your server’s IP address or domain name.
For example:
http://<server-ip>
http://<domain-name>
Make sure port 80 is open in your firewall and any security groups to ensure accessibility.