Complete Manual Installation Guide (Ubuntu 14.x, 16.x, 17.x)

Recently I started installing ERPNext from scratch. It took me so much time to figure things out because I am unfamiliar with the Linux eco-system. There were many booby traps along the way that were not mentioned anywhere! It took days and nights of trial and error and Googling. So I hope this can help people out there who are looking to do a manual install.

Guys. Just went through the whole ordeal! Follow this and you will not have any problems.
System: Ubuntu GNOME 17.04, VCPU: 4, RAM: 4GB
IMPORTANT: If your system or VM has less < 3GB RAM your installation will encounter errors

Installing ERPNext
ALL “bench” commands must be executed from /home/frappe/frappe-bench
ALL usernames and password up to you

Ubuntu OS
#Install Ubuntu 17.04 (or the latest version that is supported by ERPNext Easy Install Script)
#Create user “frappe”, pass “frappe”
#Set to auto logon

sudo su
apt-get update && apt-get upgrade

Net Tools & VMware Tools (optional for VMware users)
sudo apt-get install -y net-tools
#On the VMware web interface, install the VMware Tools
#Extract the “VMwareTools-xxx.tar.gz” to the Downloads folder
#Open a terminal in the extracted folder where the file “vmware-install.pl” is located
sudo ./vmware-install.pl

VNC Server (optional for those who want “convenient” access to the server)
#Ubuntu 17.04 – Configure X11VNC Server to Boot at Startup – Griffon's IT Library
#Install X11VNC
sudo apt-get install x11vnc -y
#Set the VNC password
x11vnc -storepasswd
#Test
/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /home/frappe/.vnc/passwd -rfbport 5900 -shared

#If everything works fine, find the Startup Applications in the Ubuntu menu and add the test line above as one of the startup applications

SAMBA (Network File Sharing) (optional for those who want to make code changes on windows)
sudo apt-get install -y samba samba-common python-glade2 system-config-samba
sudo touch /etc/libuser.conf

#Add a SAMBA user
sudo system-config-samba
#In the GUI: Preferences > Users > Add the user “frappe” username passwords all “frappe”

Web Browser (optional if you prefer Chrome over Firefox)
sudo apt-get purge --auto-remove firefox
#install the Chromium Web Browser in the Ubuntu Software Center
#Activities > search Software > search Chromium

Pre-requisites
sudo su
apt install build-essential software-properties-common libssl-dev libmariadbclient-dev python-pip python-setuptools python-mysqldb mariadb-server dirmngr nginx git-core redis-server supervisor wkhtmltopdf curl

#Set MariaDB root password
mysql
UPDATE mysql.user SET authentication_string = PASSWORD(‘frappe’) WHERE User = ‘root’ AND Host = ‘localhost’;
UPDATE mysql.user SET plugin = ‘mysql_native_password’ WHERE user = ‘root’ AND plugin = ‘unix_socket’;
FLUSH PRIVILEGES;
exit
systemctl stop mariadb
systemctl start mariadb

#Config MariaDB
sudo gedit /etc/mysql/my.cnf

#Add the following:

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

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

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

#Continue
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt install nodejs
#REBOOT SERVER

ERPNext (Easy)
#Set all passwords to frappe
#Official Link:
#GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
#https://frappe.github.io/frappe/user/en/bench/guides/setup-production.html

sudo su
apt-get update && apt-get upgrade
apt-get install python-minimal build-essential python-setuptools curl
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
curl “https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py” -o install.py
exit
sudo python install.py --production
cd /home/frappe/frappe-bench
sudo bench setup production
#Replace all config file, default fresh install port will be 80

ERPNext (Manual)
#Install Frappe
#Login as As frappe User
git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps bench-repo
sudo su
pip install -e bench-repo
exit

#continue as frappe user
bench init frappe-bench
#(if bench command doesn’t work rerun above pip install again)

#add a new bench site
cd frappe-bench
bench new-site site1.local
bench start

#Test the installation
#If there are issues in accessing the site @ http://[SERVER-IP:8000] do a bench reinstall
#Ctrl+C to abort

#Install ERPNext
bench get-app --branch master erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
bench --site site1.local install-app erpnext

#start in development mode, default port is 8000
bench start

#start in production mode, default port is 80
sudo bench setup production frappe

Share Folders (optional for those who want to make code changes on windows)
sudo system-config-samba
#In the GUI: Preferences > Users > Add the user “frappe” username passwords all “frappe”
#Add writable and visible share to /home/frappe/frappe-bench

6 Likes

Although I thank you for your extensive write up on the install, I should point out that if you are planning to run this on a web facing production server it would be preferred not to include all the X server, VNC and samba packages as these add to the possible attack vector and make the install larger than is required.

1 Like

Julian

Agreed! Completely. This write up is really for a development environment (or small companies that don’t have/care too much about security). Pick and choose the optional things. I will modify the install instructions.

Kim