Install Frappe & ERPNext v13 beta from scratch 100% guarantee(22 steps) on ubuntu 20.04

Hello all, just follow my steps carefully and everything will be ready

  1. choose any cloud you want i choose one with 5USD(1core & 1gb mem & 25gb hd monthly and install ubuntu 20.04

  2. enter to your system via ssh with root user

apt update && apt upgrade -y && shutdown -r now
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt install -y nodejs mariadb-server redis-server python3-pip nginx python3-testresources
adduser USERNAME (enter password and others details and press y)
usermod  -aG sudo USERNAME
  1. nano /etc/mysql/my.cnf and add these lines to the end of file and save it
[mysqld]
character-set-client-handshake = FALSE 
character-set-server = utf8mb4 
collation-server = utf8mb4_unicode_ci 

[mysql]
default-character-set = utf8mb4
service mysql restart
  1. run mysql_secure_installation press enter and set password for the root user and remove demo db and others like
Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
  1. run mysql -u root -p command and enter the previous password at step 10 and run(line by line)
USE mysql; 
UPDATE user SET plugin=' ' WHERE user ='root'; 
FLUSH PRIVILEGES;
exit
  1. close the terminal and open new one and login with ssh USERNAME
sudo npm install -g yarn
node -v && npm -v && python3 -V && pip3 -V && yarn -v 
# v12.20.0
# 6.14.8
# Python 3.8.5
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
# 1.22.10
pip3 install frappe-bench
sudo pip3 install frappe-bench
bench init --frappe-branch version-13-beta myfrappe
cd myfrappe
bench new-site mysite (enter mysql root password step 10) and enter new password
bench get-app --branch version-13-beta erpnext
bench --site mysite install-app erpnext
  1. ( click y if asked)
sudo bench setup production USERNAME

congratulation you can visit your ip erpnext and fill erpnext wizard

FYI I tested and double check this way and it works happy new year :slight_smile:

29 Likes

Hello,
Great, it works.
I tried many times to install frappe on Ubuntu with no success so I’m very happy.
I made the following addition on your procedure :

First : allow root user in ubuntu 20.04
sudo passwd root

Step 11 Correct the line (add space) :
UPDATE user SET plugin = ’ ’ WHERE user = ‘root’;

After step 12
Use your user USERNAME after reboot (do not continue as root)

Step 14 copy and execute only line 14

step 15 on error and seems to be useless according to step16 ?

Before line 17
cd frappe/ to launch bench in correct directory

step 23 reboot before access ERPNEXT.

Thanks to you

4 Likes

great to see that you did it.

Traceback (most recent call last):
File “/usr/local/lib/python3.8/dist-packages/git/init.py”, line 83, in
refresh()
File “/usr/local/lib/python3.8/dist-packages/git/init.py”, line 73, in refresh
if not Git.refresh(path=path):
File “/usr/local/lib/python3.8/dist-packages/git/cmd.py”, line 287, in refresh
raise ImportError(err)
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
- be included in your $PATH
- be set via $GIT_PYTHON_GIT_EXECUTABLE
- explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception
- warn|w|warning|1: for a printed warning
- error|e|raise|r|2: for a raised exception

Example:
export GIT_PYTHON_REFRESH=quiet

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 5, in
from bench.cli import cli
File “/usr/local/lib/python3.8/dist-packages/bench/cli.py”, line 14, in
from bench.app import get_apps
File “/usr/local/lib/python3.8/dist-packages/bench/app.py”, line 15, in
import git
File “/usr/local/lib/python3.8/dist-packages/git/init.py”, line 85, in
raise ImportError(‘Failed to initialize: {0}’.format(exc))
ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
- be included in your $PATH
- be set via $GIT_PYTHON_GIT_EXECUTABLE
- explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception
- warn|w|warning|1: for a printed warning
- error|e|raise|r|2: for a raised exception

Example:
export GIT_PYTHON_REFRESH=quiet

Looking for a solution during the same?

When you enter this command, what is the result?

$  which git

Hey @brian_pond,

Thanks for asking, the output of which git is /usr/bin/git and version is 2.25.1

Although I have resolved the above by following initial steps from “The Hitchhiker’s Guide to Installing Frappe on Linux” at The Hitchhiker's Guide to Installing Frappe on Linux · frappe/frappe Wiki · GitHub

I have switched back to v12 as I was not able to proceed after step 17 but will give it another try on v13 again tomorrow.

Cheers!

1 Like

@adals
Because your post may help many members, I hope you don’t mind me editing your post for more clarity of the codes.

@adals just tested your guide on a digitalocean stock ubuntu 20.04

an issue at step 14:
Error: EACCES: permission denied, open '/root/.yarnrc'

you should clarify that you need to change user and cd to your home directory prior to step 14. (ctrl-d + ssh USERNAME will not work as ssh keys are enforced)

one more thing:

  • add # comment to step 14 → pip (looks like you should run that line :slight_smile:
  • move all (enter mysql root…) comments into non courier comments under the pre-formatted line to make it easier to copy-paste.

last,
it’s not clear on what to do at the end, i.e.

  • run this to get your server IP and login details to be able to login
  1. close the terminal and open new one and login with ssh USERNAME

yes, assumes you install ssh keys first

yes I supposed that I explained erpnext only not others.

I cleared that I used ssh not other tool and the others should find anything related to ssh if they did not know about it

best wishes

Thanks Friend! it worked for me

@adals
Thanks, it worked for me even on locally installed Ubuntu 18.04

Just did these 2 changes wrt @Pascal_Foulatier comments →

  1. instead of step 15 , did install wkhtmltopdf by following steps (one by one)

cd /tmp

wget 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

sudo cp /usr/local/bin/wkhtmlto* /usr/bin/

sudo chmod a+x /usr/bin/wk*

  1. in step 16 did ,

sudo -H pip3 install frappe-bench

Rest went smoothly, better than easy install script !

then –
For Accessing ERPNext from browser
Go to web browser
in address type localhost & press enter
OR
in address type IP press enter e.g. 192.168.1.101 & press enter
You will be greeted with ERPNext Home page
Enter login as – administrator
admin password –(as you have set up in above steps)

Thanks again !

1 Like

Hi, I have installed using same above steps, But I could not see any modules. I have checked under domains and in that page I could see blank. Screenshots have been attached. Please help to resolve.

Issue fixed. Thank you.

The first installation guide which ran nearly perfect for me, only one little adjustment I had to be careful about, but a 99.999% perfect guide! Thanx a lot!

1 Like

Thank you.

and, still before 17, you have to change user to USERNAME

Refer this link