Skip to content

Instantly share code, notes, and snippets.

@101t
Last active March 15, 2024 15:09
Show Gist options
  • Save 101t/58b16b211ece8368a1fa6ae2f54211ec to your computer and use it in GitHub Desktop.
Save 101t/58b16b211ece8368a1fa6ae2f54211ec to your computer and use it in GitHub Desktop.
ERPNext guidelines

How to install an ERPNext Stack on Ubuntu 20.04

Introduction

ERPNext is an Enterprise Resource Planning (ERP) suite that leverages the power and flexibility of open-source technologies. It excels at manageing core business process such as finance, sales, HR, Manufacturing, Purchases, Services, Helpdesk, and more. Among the benefits of implementing a system like ERPNext are:

  • Better productivity by automating repetivity business process
  • Improved IT efficiency by sharing a database for all departments within the company
  • Better decising-making thanks to an integral vision of how business units relate to each other

ERPNext is based on Frappe framework, a full-stack web application written in Python that takes full advantage of the NodeJS and JavaScript runtime environment and uses MariaDB as its database backend, One of the best advantages of Frappe-based application is the bench command-line utility. The bench CLI saves administrators time by automating tasks such as installing, updating, configuring, and managing multiple Frappe/ERPNext sites.

Note: here is the Bench commands cheatsheet https://frappeframework.com/docs/user/en/bench/resources/bench-commands-cheatsheet

Setup Domain on ERPNext

bench setup add-domain mydomain.com --site [site]
bench config dns_multitenant on
bench setup nginx
sudo service nginx restart

Switch to Branch

bench switch-to-branch version-13 frappe erpnext --upgrade
sudo service nginx restart
sudo supervisorctl reload
bench update --patch
bench build

Change Port

bench set-nginx-port site1.local 8080
bench setup nginx
sudo service nginx reload

Add New Site

bench new-site site1.local
bench --site site1.local install-app erpnext
bench version

Show Installed Apps and its versions

bench --site site1.local list-apps

Install my custom app using bench command

bench get-app frappe_helper https://github.com/quantumbitcore/frappe_helper.git
bench --site site1.local install-app frappe_helper

Backup and Restore ERPNext's site

To backup specific site

bench --site yourwebsite.com backup --with-files

To restore site

bench --site site1.local --force restore /path/to/file/site1.local-database.sql.gz --with-private-files /path/to/file/site1.local-private-files.tar --with-public-files /path/to/file/site1.local-files.tar
bench --site site1.local --force restore /path/to/file/site1.local.sql.gz
bench --site site1.local migrate

Install E-Invoice for KSA

bench get-app ksa_vat https://github.com/ahmadpak/ksa_vat.git --branch version-13
bench --site site1.local install-app ksa_vat
bench --site site1.local migrate

Disable Maintenance Mode for site:

bench --site site1.local set-config maintenance_mode 0

To check site configuration

bench --site site1.local show-config 

Upgrade ERPNext from 13 to 14

bench update --reset
bench --site site1.example.com migrate
bench --site site2.example.com migrate
bench switch-to-branch version-14 --upgrade
bench restart

Full update command I used

bench update --reset --pull --build --patch --requirements --no-backup --force

Build Assets for Frappe apps

bench build --production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment