Ubuntu 20.04 install

Hi

meaby this is a little more then a novice but have a testet guide to install frappe/erpnext onto ubuntu 20.04 running as wm. i would be nice if some of you mere knowning can simplyfy this…

Clean ubuntu 20.04

sudo -i

apt update && apt -y upgrade

##################################

user

##################################

adduser bench --home /opt/bench
usermod -aG sudo bench
nano /opt/bench/.bashrc

add path

PATH=$PATH:~/.local/bin/

##################################

Git

##################################

apt-get install git

##################################

phyton3 + pip3

##################################

apt -y install python3-dev
apt -y install python3-setuptools python3-pip
apt -y install virtualenv
alias python=python3
alias pip=pip3
apt -y install git build-essential libffi-dev libssl-dev

##################################

MariaDB 10.3

##################################

apt -y install software-properties-common mariadb-server mariadb-client
apt -y install libmysqlclient-dev
apt update && apt -y upgrade

##################################

MariaDB Server config

##################################
(ctrl+w = search)(alt+w = repeat search)(ctrl+x + “y” = save)

nano /etc/mysql/mariadb.conf.d/50-server.cnf

add

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4
##################################

systemctl status mariadb
mysql -V

service mysql restart

mysql -u root -p
create user bench@localhost identified by ‘password’;
GRANT all privileges on . to ‘bench’@‘localhost’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
GRANT all privileges on . to ‘bench’@‘127.%.%.%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
GRANT all privileges on . to ‘root’@‘localhost’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
GRANT all privileges on . to ‘root’@‘127.%.%.%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

reboot

##################################

Redis 5

##################################
sudo -i

apt -y install redis-server
redis-server -v

nano /etc/redis/redis.conf

##################################

replace

supervised no

with

supervised systemd
##################################

systemctl restart redis.service

##################################

Node.js 12.X

##################################

apt install curl
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt -y install nodejs
apt -y install nodejs && apt-get install -y gcc g++ make
npm install -g yarn

##################################

yarn

##################################

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo “deb https://dl.yarnpkg.com/debian/ stable main” | sudo tee /etc/apt/sources.list.d/yarn.list
apt update && apt -y install yarn
apt -y install yarnpkg
yarnpkg --version

##################################

wkhtmltopdf

##################################

apt -y install fontconfig libxrender1 libxext6 libfreetype6 libx11-6 xfonts-75dpi xfonts-base zlib1g

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
apt -y install -f

ln -s /usr/local/bin/wkhtmltopdf /usr/bin
ln -s /usr/local/bin/wkhtmltoimage /usr/bin

wkhtmltopdf --version
wkhtmltoimage --version

##################################

Get Frappe Bench

##################################

su bench
cd /opt/bench
git clone -b master GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps ~/.bench
pip3 install ~/.bench
sudo reboot

user login.: bench
cd /opt/bench

bench init --frappe-branch version-12 --python /usr/bin/python3 frappe-bench

sudo reboot

cd /opt/bench/frappe-bench
bench new-site test.site
bench --site test.site enable-scheduler

##################################

Setup Supervisor & Nginx for Production

##################################
su bench
cd /opt/bench/frappe-bench

sudo apt -y install supervisor
sudo systemctl start supervisor
sudo systemctl enable supervisor

bench setup supervisor
sudo ln -s pwd/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.conf

sudo reboot

##################################

Install nginx

##################################
su bench
cd /opt/bench/frappe-bench

sudo apt -y install nginx

Remove enable sites

sudo rm -f /etc/nginx/sites-enabled/*

Create symbolic link to nginx conf for frappe

sudo ln -s /opt/bench/frappe-bench/config/nginx.conf /etc/nginx/sites-enabled/frappe.conf

bench setup nginx
sudo service nginx restart

bench setup socketio
bench update --requirements
bench build

sudo reboot
cd /opt/bench/frappe-bench
bench update

##################################

Installing Frappé Apps onto Sites

##################################

bench get-app --branch version-12 erpnext
bench --site test.site install-app erpnext

##################################

Thanks in advance

2 Likes

Would recommend you use Ubuntu 18. Also you can use the Easy Install script.

1 Like

i´m using ubuntu 18.04 now and how no current plans to upgrade but it is good to be prepared when a new version is released so when i want to upgrade the preparation have been made hereunder also found error´s before doing so if any ofcourse:slightly_smiling_face:.

Can you elaborate on this please.

Hi Eric,
Thanks for sharing the scripts for Ubuntu 20.04.
I too have an Ubuntu 18.04 installation. Agree with you that its better be prepared for the latest version.
Thanks,

since easy install not working without errors i used this as part reference to install redis

Hi,
I have just installed ERPNEXT successfully on 20.04 with easy install script (With some tweaking of course !!)

Check the details step here :slight_smile:

1 Like

Hi nsl,
Thank you for sharing the guide.
I’am doing the last step Installing Frappé Apps onto Sites, when i run: bench get-app --branch version-12 erpnext

Is it OK? or Wrong in this step.
Thank

Hi Balachandran,
I want to install ERPNext in ubuntu 18.04 , Can you share for me the step to install.
Thank so much.

Hi @nsl

Thanks so much for the guide
I have problem after entering this line “apt -y install yarnpkg”

Could you give guidance how I can solve it?
Thank you

Selecting previously unselected package yarnpkg.
Preparing to unpack …/180-yarnpkg_1.22.4-2_all.deb …
Unpacking yarnpkg (1.22.4-2) …
dpkg: error processing archive /tmp/apt-dpkg-install-YthSNz/180-yarnpkg_1.22.4-2_all.deb (–unpack):
trying to overwrite ‘/usr/bin/yarnpkg’, which is also in package yarn 1.22.4-1
Errors were encountered while processing:
/tmp/apt-dpkg-install-YthSNz/180-yarnpkg_1.22.4-2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

As of right now, same error.

WARNING: Guide is broken.

Thankfully using zfs based vm and can easilly roll back to fresh install to try different guide.

@nsl should we install yarn before node.js ?

Refer this link