Installing ERPNext version 13 on Ubuntu 20.10 ( 20+ or 21+ )
ERPNext 13 released, and here the updated installation document. As CentOS dead ( or killed by IBM), Ubuntu becomes the de-facto OS for ERPNext hosting. These are the steps to install Frappe and ERPNe
Updated document on ERPNext 14 is available on this link ( https://cloud.erpgulf.com/blog/support-forum/installing-erpnext-version-14-on-ubuntu-22+ )apt-get update -yinit 6 ( will restart )
apt-get install libffi-dev python3-pip python3-dev python3-testresources libssl-dev wkhtmltopdf gcc g++ make -y
curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt-get install nodejs redis-server -yapt-get install cron git -y
npm install -g yarn
apt-get install mariadb-server mariadb-client -y
mysql_secure_installation
Enter current password for root (enter for none): Press your [Enter] key, there is no password set by defaultSet root password? [Y/n] YNew password:Re-enter new password:Remove anonymous users? [Y/n] YDisallow root login remotely? [Y/n] YRemove test database and access to it? [Y/n] YReload privilege tables now? [Y/n] Y
mysql -u root -p
MariaDB [(none)]>USE mysql;MariaDB [(none)]>UPDATE user SET plugin='mysql_native_password' WHERE User='root';MariaDB [(none)]> FLUSH PRIVILEGES;MariaDB [(none)]> EXIT;
vim /etc/mysql/mariadb.conf.d/erpnext.cnfAdd these lines[mysqld]innodb-file-format=barracudainnodb-file-per-table=1innodb-large-prefix=1character-set-client-handshake = FALSEcharacter-set-server = utf8mb4collation-server = utf8mb4_unicode_ci[mysql]default-character-set = utf8mb4
systemctl restart mariadb
useradd -m -s /bin/bash erpnext
passwd erpnext
usermod -aG sudo erpnext
su - erpnext
vim ~/.bashrcadd this linePATH=$PATH:~/.local/bin/
source ~/.bashrc
su - erpnextsudo mkdir /opt/bench
sudo chown -R erpnext:erpnext /opt/bench
cd /opt/benchyarn add node-sasssudo apt install python3.8-venv
pip3 install --user frappe-benchbench init frappe-bench --frappe-branch version-13
cd frappe-benchsed -i '/web:/ s/$/ --noreload/' Procfilebench start >/tmp/bench_log &
bench new-site yourhost.example.com
At this point we have a frappe site running - bench start and you will get the website on port 8000. But ERPNext not yet installed. Let's continue
bench get-app erpnext --branch version-13bench install-app erpnext ( if you have more than one site mention site name like " bench --site site1.local install-app erpnext "
bench start
Now you have ERPNext on port 8000. ( http://yourhost.example.com:8000 )
You can run the setup-wizard on the browser. ( Setup-wizard often fail. Restart it again and again. This issue has been there since ages and yet to be fixed )
----- NOW deploy it in production mode - on nginx server -------
sudo apt install nginx supervisorsudo vim /etc/supervisor/supervisord.confUnder [unix_http_server] section and also under [supervisord]uncomment or add chown=erpnext:erpnextbench setup supervisor --yesbench setup nginx
sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.confsudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe-bench.conf
sudo systemctl enable supervisorsudo systemctl enable nginx
-----------------------------
Make changes on site_config.json ( inside site/site_name folder )To make it non-development mode"developer_mode": 0,To reflect the hostname and portsample below.{"db_name": "_7beb69e70202137e","db_password": "GiZeZxy4GPxfTzFA","db_type": "mariadb","developer_mode": 0,"encryption_key": "iVahvGBPKPWWYQwqyxxxxxx7dMazzSX4SEClEtDzdQ=","user_type_doctype_limit": {"employee_self_service": 10},"host_name": "https://mysite.erpgulf.com:1203"}
--------------------
restart the system - init 6
--------------
Now Letsencrypt and SSL
--------------------------
It's explained here https://erpgulf.com/blog/support-forum/letsencrypt-on-ubuntu-version-20-for-erpnext

Team ERPGulf
The team behind ERPGulf blogs here, expresses their thoughts, shares the experience, often show the frustrations. Contact us on support@ERPGulf.com
Hi, how to setup production mode. When I "sudo bench setup production 'user"" come with error "sudo: bench: not found"
Thank you!!! This is an excellent install routine and is really helpful.
First tut to actually work correctly.
Needed addition of apt install python3.10-venv