Howto: install ERPNext v5 on plain vanilla Debian

Hi all,

I’m new to ERPNext and had some trouble setting up v5. I found the official documentation too sparse to complete a successful installation without additional prerequisites / tweaks.

I ended up running the install on a plain vanilla Debian VM to troubleshoot it to success. I came up with the below process and am sharing it here for everyone’s reference…

## Install prerequisites ##
# inspired from https://github.com/frappe/bench#manual-install

# install mariadb 
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo su -
cat <<EOF >> /etc/apt/sources.list
# MariaDB 5.5 repository list
deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/debian wheezy main
deb-src http://ftp.osuosl.org/pub/mariadb/repo/5.5/debian wheezy main
EOF
exit

# install prerequisites
sudo aptitude update
sudo aptitude upgrade
sudo aptitude install python2.7 mariadb-server libmariadbclient-dev python-mysqldb redis-server memcached git python-pip python-dev wkhtmltopdf

## install bench
sudo mkdir /opt/erpnext5
sudo chown <YOURNAME> /opt/erpnext5
cd /opt/erpnext5/
# NO sudo in this command:
git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo



## Install ERPNext ##
# https://github.com/frappe/bench#setting-up-erpnext
cd /opt/erpnext5

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo python ez_setup.py

# needed for python setup.py egg_info
sudo pip -q install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz

# if you need to run this again, do: rm -rf frappe-bench
bench init frappe-bench
cd frappe-bench
# Add ERPNext to your bench apps
bench get-app erpnext https://github.com/frappe/erpnext


# add to /etc/mysql/my.cnf
# this may be different for you, so follow what is suggested to you
[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

# restart mysql
sudo service mysql restart

# Create a new site
bench new-site erp.example.com
bench install-app erpnext                       # Install ERPNext for the site



## Deployment
# https://github.com/frappe/bench#production-deployment

# Install supervisor
sudo aptitude install supervisor
bench setup supervisor
sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf

# Install Ngnix
sudo aptitude install nginx
bench setup nginx
sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf

# may need to restart supervisor
sudo service supervisor restart
# check if supervisor is running:
supervisorctl status

# restart nginx if required
sudo service nginx restart



## multitenant second site
# https://github.com/frappe/bench/wiki/Multitenant-Setup
bench new-site erp2.example.com
bench config dns_multitenant on
bench setup nginx
# see the config in config/nginx.conf
sudo service nginx reload

Thanks added to the wiki

Awesome :smile:

There seems to be a problem with emailing though … so once that’s solved, this may need an update

@coriolan, feel free to update it yourself. Its a Wikipage!