Skip to content

Install Erpnext on ubuntu 16.04 LTS server

Sundar Raman edited this page Apr 5, 2020 · 1 revision

External Links Reference#

Prerequisites

  • Python_2.7 Version

$ sudo aptitude install python-dev python-setuptools python-mysqldb python-pip

  • Ubuntu OS Requirements

$ sudo aptitude install build-essential git ntp vim screen htop libxslt1.1 libxslt1-dev libssl-dev libcrypto++-dev postfix fontconfig libxrender1 libxext6 xfonts-75dpi xfonts-base cron curl supervisor

  • Nodejs and npm Ubuntu 16.04 standard repository will install nodejs 6_x, suggested to use nodejs 7_x

$curl -sL https://deb.nodesource.com/setup_7.x | sudo bash -

$ sudo aptitude install nodejs ( will also install npm )

  • Redis Database

Please use Redis PPA Repository instead

sudo add-apt-repository ppa:chris-lea/redis-server

  • Mariadb/Mysql database

Please use Mariadb official Repository Follow intuitive instructions here and choose the most appropriate to your need - suggested V 10.2 stable

  • Nginx Web Server (for Production)

Please use Nginx Stable PPA Repositoy

sudo add-apt-repository ppa:nginx/stable

Installing Prerequisites

sudo aptitude update

sudo aptitude install mariadb-server nginx redis-server

Mysql root password request will be pop up during mariadb installation on most linux distros as well as ubuntu, give your own password and do best to remember.

After mariadb installed, edit file my.cnf at /etc/mysql/my.cnf

$ sudo nano -w /etc/mysql/my.cnf

Pasted below configuration below [mysqld]

`[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`

  • Install wkhtmltopdf

Follow this nobproof instruction

Recommended

Install openjdk-jdk $sudo aptitude install openjdk-jdk

Installing Frappe

Note

Easy install scripts creating non-system ubuntu user = frappe in fact this is optional you can safely using your daily login ubuntu user for Production state.

Choose the partision where to install frappe/Erpnext due to the file will grow up quickly in case erpnext "users" extensively using attachements file especially when E-mail feature activated.

  • Log in to non root user and navigate to any folder the user have write access i.e /home/user and clone bench

/home/user/$

$ git clone https://github.com/frappe/bench bench

couple minutes download depending on your internet speed bench folder will be created upon success of cloned

  • Installing bench

`$ sudo -H pip install -e bench'

This is arbitrary using sudo with -H flag will make bench usable for every user in the system

if you wish the bench only for the certain user then give command

'$ pip install --user -e bench'

'$ echo "export PATH=$HOME/.local/bin:$PATH" >> ~/.bashrc'

'$ . ~/.bashrc or source ~/.bashrc'

  • Installing Production bench/ Development bench

$ bench init xxx-bench you can use any names dev-bench. prod-bench, fun-bench, test-bench and so on

  • Installing Erpnext Platform app

$ cd xxx-bench

../xx-bench

bench get-app erpnext https://github.com/frappe/erpnext

At this stage bench and erpnext have been installed on your system, next is the real game If you see any warning message related to babel preset, execute:

$ npm install --save-dev babel-preset-env

  • Creating A site for Erpnext Development or Production

Log in and Create Mysql Database

$ mysql -u root -p

MariaDB [(none)]> MariaDB [(none)]> CREATE DATABASE erpnext; (suggesting name is identical with the site name you are going to create on the next step).

MariaDB [(none)]> GRANT ALL PRIVILEGES ON erpnext.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

MariaDB [(none)]> \q;

Creating New Erpnext Site

../xxx-bench

$ bench new-site sitename --db-name erpnext --mariadb-root-username root --mariadb-root-password password --install-app erpnext --verbose --force

Finish

Erpnext safely installed on your ubuntu 16.04 system to learn about bench command execute:

$ bench --help

  • Set up

$ bench setup procfile

  • Production setup

$ bench setup nginx

$ bench setup supervisor

Note

  • Supervisord will manage redis-server
  • chek $ /etc/redis/redis.conf and configure the redis as your need
  • Standard binary linux distro kernel (as well as ubuntu) activate by default THP (Transparent Huge Page) feature. Redis ( and mongoodb dont like it 🥇 )
  • I preferred to use aptitude command in ubuntu rather than apt-get since aptitude is always on pretend option.
  • Retstarting nginx, mysql, supervisor etc is on linux distro kanowledge base ( depending on your distro using openrc or systemd init