Skip to content

Instantly share code, notes, and snippets.

@yalattas
Last active June 4, 2023 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yalattas/e78143902f263c1dfe9b1ff14cb4f7b8 to your computer and use it in GitHub Desktop.
Save yalattas/e78143902f263c1dfe9b1ff14cb4f7b8 to your computer and use it in GitHub Desktop.
erpnext ubuntu setup

ERPnext VM deployment

server

sudo timedatectl set-timezone "Asia/Riyadh"
sudo apt-get update -y
sudo apt-get upgrade -y
sudo reboot
sudo adduser [frappe-user]
usermod -aG sudo [frappe-user]
su [frappe-user] 
cd /home/[frappe-user]/

depenedency

sudo apt-get install git
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
sudo apt install mariadb-server mariadb-client
sudo apt-get install redis-server
sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev

mysql

sudo mysql_secure_installation

make sure to change root password and note it down.

Append the following content to the the following file

  1. file
sudo vim /etc/mysql/my.cnf
  1. content
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

Now restart

sudo service mysql restart

cUrl, node, npm and yarn

sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 16.15.0
sudo apt-get install npm
sudo npm install -g yarn

frappe

sudo pip3 install frappe-bench
bench init --frappe-branch version-14 frappe-bench
cd frappe-bench/
chmod -R o+rx /home/[frappe-user]/
bench new-site site1.local

erpnext apps

global

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

to site

bench --site site1.local install-app erpnext
bench --site site1.local install-app hrms
bench --site site1.local install-app ecommerce_integrations

production setup

bench --site site1.local enable-scheduler
bench --site site1.local set-maintenance-mode off
sudo bench setup production [frappe-user]
bench setup nginx
sudo supervisorctl restart all
sudo bench setup production [frappe-user]

firewall (optional)

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

SSL

bench config dns_multitenant on
bench setup add-domain [desired-domain]
sudo -H bench setup lets-encrypt [site-name] --custom-domain [custom-domain]

untested SSL procedure

sudo bench setup wildcard-ssl erpnext.xyz --email test@example.com

references

  1. https://discuss.frappe.io/t/guide-how-to-install-erpnext-v14-on-linux-ubuntu-step-by-step-instructions/92960
  2. https://github.com/frappe/bench/wiki/Setup-LetsEncrypt-Wildcard-SSL-certificate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment