I never do manual install because there are too many gotchas (like nginx configuration, etc).
Easy install is the way to go.
Don’t use Ubuntu 16 because it uses Python 3.5. ERPNext requires at least Python 3.6 for background reports like Stock Balance. Use Ubuntu 18.
The sequence is this:
apt-get update && sudo apt-get upgrade -y
apt-get install python-minimal
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo python install.py --develop --user frappe
usermod -aG sudo frappe
passwd frappe comment: give frappe user a password
su - frappe
At this point frappe-bench will be installed in /home/frappe. The last command su - frappe places you on /home/frappe directory as frappe user.
Please note that user frappe must not exist before installation. You have to remove user frappe it it exists as well as the home directory /home/frappe. The existence of user frappe prior to install.py is what causes errors.
Also note that frappe has become a common user name and could be a security concern. It is recommended to use other names, for example, --user myownfrappe. So, the user name myownfrappe will be created, and frappe as well as erpnext will be installed in /home/myownfrappe. So, you will use usermod -aG sudo myownfrappe and su - myownfrappe.
You start erpnext with
cd frappe-bench
bench start
[At this point, you may note some redis issues. I fix the redis issues at this point - but this is another topic.]
This starts erpnext on develop mode. You make the erpnext site using
http://localhost:8000
You may replace localhost with the ip address or site address. If the webpage complains that it was not able to complete installation, just repeat localhost:8000 again and again until the erpnext desk appears.
You can setup production mode using
sudo bench setup production frappe
frappe in this command is the user name that you used in the install.py command. If you used myownfrappe user name, the command is sudo bench setup production myownfrappe.
This will setup the production mode. At this point you are already on production mode and you don’t need the bench start command to start the server. It will start every time you boot up your server.
To switch back to develop mode
sudo service nginx stop
sudo service supervisor stop
bench setup procfile
bench start
To get back to production mode, stop bench start by ctrl-c, and use the command
bench restart
This will start up the production mode services like redis and nginx again.
Also note that the server will always be in production mode at start-up. (I like this better because it is easier to stop the services nginx and redis before bench start than having to rebuild the conf files for these services again to get to production mode.)
Note: developer_mode setting / bench set-config developer_mode 1 has nothing to do with production or develop mode of the server. This setting is related to programming frappe apps. You can still be on developer_mode 1 setting or developer_mode 0 setting whether the server is on production or develop mode.