v14 : installation steps : manual setup on Ubuntu 22 - ashish-greycube/help GitHub Wiki

Referenece

https://discuss.erpnext.com/t/guide-how-to-install-erpnext-v14-on-linux-ubuntu-step-by-step-instructions/92960
https://github.com/D-codE-Hub/Guide-to-Install-Frappe-ERPNext-in-Ubuntu-22.04-LTS

Root user : install python,mariadb

timedatectl list-timezones
sudo timedatectl set-timezone Asia/Calcutta Asia/Bahrain Asia/Riyadh
timedatectl
# swap space as much as memory size. Check memory
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
sudo ufw allow 22,25,143,80,443,3306,3022,8000/tcp
sudo ufw enable
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install git -y
sudo apt-get install python3-dev -y
sudo apt-get install python3-setuptools python3-pip -y
sudo apt-get install virtualenv -y
sudo apt install python3.10-venv -y
sudo apt-get install software-properties-common
sudo apt install mariadb-server mariadb-client
sudo mysql_secure_installation
# Change the root password? [Y/n]: Y

sudo apt-get install libmysqlclient-dev
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

[mysql]
default-character-set = utf8mb4
max_allowed_packet = 2G
sudo service mysql restart

Add frappe user

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

sudo apt-get install redis-server

sudo apt install curl
export NVM_DIR="/home/frappe/.nvm"
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash \
  && source ~/.profile \
  && nvm install 14.21.3 \
  && nvm use v14.21.3 \
  && nvm alias default v14.21.3 \
  && nvm cache clear  \
  && . "/home/frappe/.nvm/nvm.sh"

sudo apt-get install npm
sudo npm install -g yarn

sudo apt-get install xvfb libfontconfig


sudo -H pip3 install frappe-bench==5.10.1

logout and login of frappe user

bench init --frappe-branch version-14 frappe-bench
cd frappe-bench/
chmod -R o+rx /home/frappe/



sudo apt-get remove wkhtmltopdf
cd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
sudo apt-get install xfonts-75dpi
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.focal_amd64.deb
sudo cp /usr/local/bin/wkhtmlto* /usr/bin/
sudo chmod a+x /usr/bin/wk*
cd ..
wkhtmltopdf -V


bench get-app --branch version-14 erpnext
bench get-app payments --branch version-14
bench get-app hrms --branch version-14

bench new-site site1.local --db-name site1db
bench --site site1.local install-app erpnext
bench --site site1.local install-app payments
bench --site site1.local install-app hrms
bench --site site1.local enable-scheduler
bench --site site1.local set-maintenance-mode off



sudo bench setup production frappe

-----------not required---
if fail2ban error in above
sudo apt install fail2ban nginx supervisor
sudo bench setup production frappe
or manual steps at [link](https://cloud.erpgulf.com/blog/blogs/erpnext-version-14-install-in-production-mode-nginx-supervirso-gunicorn)

--------------------------------

sudo bench setup production frappe

-----------not required---
sudo nano /etc/supervisor/supervisord.conf

chmod=0760
chown=frappe:frappe

sudo supervisorctl reload
-------------

SSL Setup

[SSL Steps A](https://github.com/jigneshpshah/greycube_helpmanual/wiki/SSL-installation-via-certbot)
sudo bench setup sudoers $(whoami)
[SSL Steps B]
sudo bench setup production frappe

bench config dns_multitenant on
bench setup nginx
bench restart
sudo supervisorctl restart all

provided hosts list is empty, error

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
ERROR! [DEPRECATED]: ansible.builtin.include has been removed. Use include_tasks or import_tasks instead. This feature was removed from ansible-core in a release after 2023-05-16. Please update your playbooks.

The error appears to be in '/usr/local/lib/python3.10/dist-packages/bench/playbooks/roles/mariadb/tasks/main.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- include: centos.yml
  ^ here
ERROR: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-vvvv', '-e', '{"production": true, "admin_emails": "", "mysql_root_password": null, "container": false}', '-t', 'fail2ban']' returned non-zero exit status 1.
sudo apt install fail2ban nginx supervisor