How to manually install ERPNext v10.1.14 on Ubuntu 18.04

Install deb package dependencies

# Update repo and packages
sudo apt update && sudo apt -y dist-upgrade
# Install Dependencies
sudo apt install -y \
    python \
    python-pip \
    cron \
    mariadb-server \
    mariadb-client \
    xfonts-base \
    xfonts-75dpi \
    fonts-cantarell \
    libssl1.0-dev \
    libxrender1 \
    libjpeg-turbo8 \
    git \
    redis-server \
    wget

# Download, install and remove wkhtmltopdf deb package
wget -c https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb && rm wkhtmltox_0.12.5-1.bionic_amd64.deb

Install and configure MariaDB

Use mariadb with root password. By default it uses unix socket plugin.

sudo mysql -u root

#### mariadb shell start ####
use mysql;
update user set plugin='' where User='root';
flush privileges;
exit
#### mariadb shell end ####

Frappe specific configuration

sudo su
cat <<\EOT > /etc/mysql/mariadb.conf.d/frappe.cnf
[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

EOT
exit # exit root shell

Restart mariadb and set root password

sudo systemctl restart mariadb.service
sudo mysql_secure_installation

refer:

NodeJS LTS using NVM

We need NodeJS 8 which was used in Mar 2018 at the time of ERPNext v10.1.14

# Install nvm
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
source ~/.bashrc
# Install node v8
nvm install v8.17.0

Force downgrade python2-pip

We need old pip. If new pip is used bench, frappe and erpnext at v10.1.14 cannot be installed

sudo pip install --force-reinstall pip==9.0.3

Install Frappe Bench

We need to install old bench, I chose the commit 6055850 which was near to ERPNext v10.1.14

git clone -n https://github.com/frappe/bench ~/.bench
cd ~/.bench
git checkout -b mar-31-18 605585096cc2a8cdb6ff8f48ba12b90c77845987
sudo pip install -e ~/.bench

Create first frappe-bench

bench init --frappe-branch v10.1.14 ~/frappe-bench

Note: This command will fail because pip which gets added to fresh created bench needs to be downgraded.

Continue installation manually

cd ~/frappe-bench
. ./env/bin/activate
pip install --force-reinstall pip==9.0.3
pip install redis==2.10.6
pip install --no-cache-dir -e ./apps/frappe
bench get-app --branch v10.1.14 erpnext

# Command fails here due to no nodejs dependencies installed

echo -e "frappe\nerpnext" > sites/apps.txt

Notes:

  • we need specific version of redis in the environment. Getting error while Creating New Site - #14 by Himanshu_Mishra
  • because installation failed, we need to create sites/apps.txt manually.
  • execute ./env/bin/pip freeze in your existing (source) frappe-bench just to know what versions are installed on running frappe-bench

Install node package dependencies manually

No need to be in python venv created in previous section.

cd ~/frappe-bench
cp apps/frappe/package.json ./
npm install
rm -rf package.json package-lock.json

Continue bench installation and configuration

cd ~/frappe-bench
bench setup redis
bench setup socketio
bench build
bench setup procfile

Start bench and add new site (development)

bench start
bench new-site testinstall.localhost --install-app erpnext

Production installation

Do not start bench with bench start before setting up production.

sudo apt install -y nginx supervisor

Follow Setup Production instructions

Comment following lines from /etc/nginx/sites-available/default

# listen 80 default_server;
# listen [::]:80 default_server;

restart nginx and supervisor

sudo systemctl restart nginx supervisor
9 Likes

Hello, thank you. :slight_smile:

Can i use the instruction with ERPNext 11 and ERPNext 12 to?

Did you have an instruction for CentOS 8 oder CentOS 7 ?

jannnis

No. Everything is specific to v10.1.14.

Change the commit or tags and you can install those specific versions in history. Errors and solution for those errors may be different.

I don’t use CentOS