ERPNEXT v13 Clean Install


ERPNEXT v13
//credentials for the freelancer server
ubuntu


sudo su
sudo apt update && sudo apt upgrade --yes

//check instance disk space (at least 10gb recommended)
df -h --total

adduser frappe
usermod -aG sudo frappe

cd
su frappe

export LC_ALL=C.UTF-8

sudo reboot

su frappe
cd


sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python3-pip


sudo apt install git libffi-dev python-pip python3-minimal build-essential python3-distutils python3-setuptools libssl-dev wkhtmltopdf

wget https://raw.githubusercontent.com/frappe/bench/develop/install.py

export LC_ALL=C.UTF-8

sudo python3 install.py --verbose --production --user frappe --mariadb-version 10.5 --frappe-branch version-13 --erpnext-branch version-13

export LC_ALL=C.UTF-8


cd frappe-bench

// Site Creation
* Switch on DNS based multitenancy (once)
bench config dns_multitenant on
* Create a new site
bench new-site yasdemo.erp.do

* Install ERPNEXT
bench --site yasdemo.erp.do install-app erpnext

* Re generate nginx config
bench setup nginx

* Reload nginx

sudo service nginx reload


// SSL
Can be run from frappe-bench…

sudo apt install certbot python3-certbot-nginx

sudo nginx -t
sudo systemctl reload nginx

sudo certbot --nginx -d yourdomain.com

// Check is if auto renewal is enabled
sudo systemctl status certbot.timer



// LETS ENCRYPT <— CHECK IF STILL WORKS

sudo service nginx stop
sudo snap install --classic certbot
sudo certbot certonly --standalone

// TO ADD MORE DOMAINS
sudo certbot certonly --standalone
sudo service nginx start

sudo service nginx reload

// Frappe Bench Commands 
bench drop-site


bench get-app erpnext https://github.com/frappe/erpnext.git
bench --site <site_name> install-app erpnext



Stop the nginx service:   sudo service nginx stop
Install cerbot:   sudo snap install --classic certbot
Generate cert: sudo certbot certonly --standalone
In both steps the cert will be created in the same dir /etc/letsencrypt/…
Which is the same dir is configured when running
sudo -H bench setup lets-encrypt
So then you only need to do:
sudo service nginx start
sudo service nginx reload



**** MARIADB - MYSQL ****
Login to MYSQL
mysql -u root -p
# To view users: 
select host,user from mysql.user;
# Create the user
 CREATE USER frappe@`%` IDENTIFIED BY '81216163';
GRANT ALL ON *.* TO frappe@`%` WITH GRANT OPTION;
flush privileges;

# To delete a user
drop user username;



Quit
*** IMPORTANT ***

# Define the Bind address as 0.0.0.0 or your IP by changing:
bind-address = 127.0.0.1  TO  bind-address  = 0.0.0.0

This should be at:

sudo nano /etc/mysql/my.cnf
OR
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
# Edit and save (control + X, them Y)

# Finally

sudo service mysql restart
OR
REBOOT SERVER

Did you find this article useful?