v14 : installation steps : using erpnext_quick_install script - ashish-greycube/help GitHub Wiki

set timezone

timedatectl list-timezones
sudo timedatectl set-timezone Asia/Riyadh
timedatectl

create swap space

free -h
sudo fallocate -l 6G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo nano /etc/sysctl.conf
vm.swappiness=10
vm.vfs_cache_pressure=50

allow port

sudo ufw allow 22,25,143,80,443,3306,3022,8000/tcp
sudo ufw enable

update software

sudo apt update && sudo apt -y upgrade

create frappe user

sudo adduser frappe
usermod -aG sudo frappe
su frappe
cd /home/frappe/

install git

sudo apt-get install git -y

clone script

git clone https://github.com/ashish-greycube/erpnext_quick_install.git
cd erpnext_quick_install
chmod +x erpnext_install.sh
source erpnext_install.sh

Q. Would you like to install SSL? Ans: yes image

mariadb setup

sudo nano /etc/mysql/my.cnf
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
innodb_log_file_size = 2G
innodb_log_buffer_size = 512M
innodb_strict_mode=0
max_allowed_packet=1073741824
[mysql]
default-character-set = utf8mb4
max_allowed_packet = 2G
sudo service mysql restart

Get SSL certificate : frappe user

$ bench config dns_multitenant on
$ sudo service nginx stop

(1)$ sudo certbot certonly --standalone
It will ask questions..domain name.ex
Please enter in your domain name(s) (comma and/or space separated)  (Enter 'c'
to cancel): abc.xyz.com

it would give output..like below..note the certificate path generated and ensure same is in site_config.json
   /etc/letsencrypt/live/abc.xyz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/abc.xyz.com/privkey.pem
ensure same is in site_config.json
(2)frappe@vmi494576:~/frappe-bench/sites/abc.xyz.com$ nano site_config.json

"ssl_certificate":"/etc/letsencrypt/live/abc.xyz.com/fullchain.pem",
"ssl_certificate_key":"/etc/letsencrypt/live/abc.xyz.com/privkey.pem"

bench --site demo14.greycube.in set-config ssl_certificate `sslpath`
bench --site demo14.greycube.in set-config ssl_certificate_key `keypath`

(2.2) take backup of nginx
/frappe-bench/config$ cp nginx.conf nginx.conf_mar_2


(3)~/frappe-bench$ bench setup nginx
(4)/frappe-bench$ sudo service nginx start
(5)~/frappe-bench$ sudo service nginx reload  <-- **donot forget**

renew ssl

switch to root user

crontab -e
MAILTO="[email protected],[email protected],[email protected]"
# run at 1:30 early morning saudi arabia time(CEST) on 1st and 3rd friday of every month
30 1 1-7 * * [ $(date +\%u) = 5 ] && sudo service nginx stop && sudo certbot renew && sudo service nginx start
30 1 15-21 * * [ $(date +\%u) = 5 ] && sudo service nginx stop && sudo certbot renew && sudo service nginx start

restore dump

bench --site xtc.greycube.in  restore /home/frappe/20230414_172124-xtc_greycube_in-database.sql.gz --with-public-files /home/frappe/20230414_172124-xtc_greycube_in-files.tar --with-private-files /home/frappe/20230414_172124-xtc_greycube_in-private-files.tar