How to install erpnext from A-Z

Hello everyone today i will show you how to install ERPNEXT step by step

**==> First of all you should make a new installation of Ubuntu 16 or 18 lts **
==> in my case i have Ubuntu 16.04 lts server installed on Virtualbox 6

**==> i will use SSH to make this installation **
==> in your Virtualbox machine tape:
ip a
**==> to get your ip address **
==> i will use putty for SSH connexion

==> let’s move to Root account:

sudo su
----- Test the internet connexion -----
ping www.google.com
----- update and upgrade the system ------

apt update
apt upgrade

----- Fix Ip ------------
iface enp0s6 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 1.1.1.1 8.8.8.8

----- Reboot the system -----
reboot

----- Test the internet connexion -----
ping www.google.com

----- create an user named FRAPPE -----
==>you can use any name but i will use FRAPPE

adduser frappe
**==> (you will be promoted to give this new use a Password, i will use β€œsysuserpass”) **
==> make our user parte of sudo’s group
usermod -aG sudo frappe

----- installation prerequisites ------
apt install build-essential -y
apt install software-properties-common -y
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
apt install dirmngr -y
apt install curl -y

----- installation MariaDb -----
==> use this link, will help you to install the last version of MariaDb:

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
β€” For Ubuntu 16
sudo add-apt-repository β€˜deb [arch=amd64,arm64,i386,ppc64el] ftp.cc.uoc.gr - University of Crete / Computer Center xenial main’
β€” For Ubuntu 18
sudo add-apt-repository β€˜deb [arch=amd64,arm64,ppc64el] Index of /mirror/mariadb/repo/10.4/ubuntu/ bionic main’
sudo apt update
apt install mariadb-client mariadb-server -y

----- Configuration MariaDb -----
vim /etc/mysql/my.cnf
===== Edit MariaDb configuration =====
==> search for this line and add #
#skip-external-locking
==> search for this line and change 127.0.0.1 to 0.0.0.0
bind-address = 0.0.0.0

==> under [mysqld] add this lines, in the end of [mysql]

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

under [mysql] add this line
default-character-set = utf8mb4

sudo systemctl restart mariadb
sudo systemctl enable mariadb
mysql_secure_installation
**==> put Y for all the question, the script will ask you for mysql root password **
==> i will use β€œpassmysql”

******* Test MariaDb**
mysql -u root -p
******* Test MariaDb with FRAPPE**
su - frappe
mysql -u root -p

----- create database ERPNEXT with Frappe user-----
create database erpnext;
show databases;
\q

----- installation nginx -----
sudo su
apt install nginx -y

********* test nginx**
http://192.168.1.10
you should see a welcome to inginx message

----- installation prerequisites 2 ------
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
apt install nodejs -y

----- Installing npm -------
npm install npm -g
test node and npm version

node -v && npm -v
for me (in 8 Nov 2019)
v10.17.0
6.13.0

------- installation yarn -------
NB: make sure that the installation is good
curl -sS 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
sudo apt update
sudo apt install yarn -y
yarn --version
for me (in 8 Nov 2019)
1.19.1

apt install redis-server -y
******* testing redis
redis-cli
127.0.0.1:6379> ping
PONG

apt install wkhtmltopdf -y
apt install git-core -y
apt install python-pip -y
pip install --upgrade setuptools
apt-get install python2.7-dev libmysqlclient-dev
pip install MySQL-python --no-use-wheel
apt install supervisor -y

==> Reboot Server
reboot

==> now we will use ower user (Frappe)
su - frappe
cd
git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps bench-repo
sudo pip install -e bench-repo
bench init --frappe-branch version-12 --python /usr/bin/python2.7 frappe-bench && cd frappe-bench
==> now you should open two SSH sesion, one for the installation and the other one for starting bench
==> in ssh sesion two
su - frappe
cd
cd frappe-bench
bench start
==> in the sesion one you should be in frappe-bench directory

bench get-app erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)

**==> myerpnext.local is the name of your site **
**==> erpnext is the name of the database **
**==> passmysql is the password you tape it after mysql_secure_installation **
==> myerppass is your admin password, you will use it in the browser
bench new-site myerpnext.local --db-name erpnext --mariadb-root-password passmysql --admin-password myerppass --install-app erpnext --verbose --force
sudo bench setup production frappe
sudo systemctl reload nginx

==> it is very good to reboot the systeme after this
reboot

==> open you ssh after rebooting
su - frappe
sudo supervisorctl stop all
sudo supervisorctl start all

**==> now brows to your server ip (http://192.168.1.10) **
==> if everything is good you will be promoted to enter username and password
==> the user is Administrator and the password is myerppass

i’m her for your questions
good luck everyone

9 Likes

Hi @Mestoof

Works nicely for me, thanks for the guide. Ive adjust here and there in terms of when to su and not, but overall the steps are the same… Thnx

Kind regards
Hemant

This failed …

[1/2] β ‚ cypress
error /home/frappe/frappe-bench/apps/frappe/node_modules/cypress: Command failed.
Exit code: 1
Command: node index.js --exec install
Arguments:
Directory: /home/frappe/frappe-bench/apps/frappe/node_modules/cypress
Output:
Cypress cannot write to the cache directory due to file permissions
----------

Failed to access /home/frappe/.cache/Cypress:

EACCES: permission denied, mkdir '/home/frappe/.cache/Cypress'
----------

Platform: linux (Ubuntu Linux - 16.04)
Cypress Version: 3.1.5
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this 
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/bench-repo/bench/commands/make.py", line 31, in init
    python               = python)
  File "/home/frappe/bench-repo/bench/utils.py", line 84, in init
    update_node_packages(bench_path=path)
  File "/home/frappe/bench-repo/bench/utils.py", line 457, in update_node_packages
    update_yarn_packages(bench_path)
  File "/home/frappe/bench-repo/bench/utils.py", line 470, in update_yarn_packages
    exec_cmd('yarn install', cwd=app_path)
  File "/home/frappe/bench-repo/bench/utils.py", line 161, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: yarn install

So did this …

[3792] [WARNING] Your terminal is not configured to receive UTF-8 encoded text. Please adjust your locale settings or force UTF-8 output by setting PYTHONIOENCODING="utf-8".
[3792] [ERROR] Procfile does not exist or is not a file

you should install node js before installing YARN
Now you have problems with YARN
if you tape
yarn --version
you will see an error

@sebinmichael helped compile a better manual installation notes, from the discussion points on Unable to Install ERPNext 12 (Easy Install Script) - #15 by sebinmichael

He graciously shared them with me offline for me to work on it further … Here is the code

apt-get update && apt-get upgrade -y
adduser USER
usermod -aG sudo USER
apt install build-essential software-properties-common -y
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
apt install dirmngr curl -y
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository "deb [arch=amd64,arm64,i386,ppc64el] http://ftp.cc.uoc.gr/mirrors/mariadb/repo/10.4/ubuntu xenial main"
sudo apt update
apt install mariadb-client mariadb-server -y

----- Configuration MariaDb -----

nano /etc/mysql/my.cnf

===== Edit MariaDb configuration =====
==> search for this line and add #

#skip-external-locking

==> search for this line and change 127.0.0.1 to 0.0.0.0

bind-address = 0.0.0.0

==> under [mysqld] add this lines, in the end of [mysql]

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

==>under [mysql] add this line

default-character-set = utf8mb4

systemctl restart mariadb
systemctl enable mariadb
mysql_secure_installation

==>put Y for all the question, the script will ask you for mysql root password


MariaDB Credentials
mysql-user: root
mysql-pass: MYSQLPASS

*** Test MariaDb ***

mysql -u root -p
\q

*** Test MariaDb with FRAPPE USER ***

su - USER
mysql -u root -p

----- create database ERPNEXT with Frappe user-----

create database erpnext;
show databases;
\q

----- installation nginx -----

sudo su
apt install nginx -y
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
apt install nodejs -y
npm install npm -g

------- installation yarn -------
NB: make sure that the installation is good

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && apt-get update && apt-get install yarn
apt install redis-server wkhtmltopdf git-core python-pip -y
pip install --upgrade setuptools
apt-get install python2.7-dev libmysqlclient-dev -y
pip install MySQL-python --no-use-wheel
pip install python-dateutil==2.1
apt install supervisor -y

The next step is a creation of a swap file which was very useful in my case since I was using a VPS with just 1 GB of RAM. If you have more RAM, you can ignore this for now. If not, do it, because otherwise the next step of bench init will stall due to lack of memory and you’ll keep wondering why it’s taking so long

fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

==> now we will use lower user

su - USER
cd
git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo
bench init --frappe-branch version-12 --python /usr/bin/python2.7 frappe-bench && cd frappe-bench

==> now you should open two SSH sesion, one for the installation and the other one for starting bench
==> in ssh sesion two

su - USER
cd
cd frappe-bench
bench start

==> in the sesion one you should be in frappe-bench directory

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

==> MYERPNEXT.LOCAL is the name of your site
==> erpnext is the name of the database
==> MYSQLPASS is the password you tape it after mysql_secure_installation
==> ERPNEXTPASS is your admin password, you will use it in the browser

bench new-site MYERPNEXT.LOCAL --db-name erpnext --mariadb-root-password MYSQLPASS --admin-password ERPNEXTPASS --install-app erpnext --verbose --force
sudo bench setup production USER
sudo systemctl reload nginx
sudo reboot

su - USER
sudo supervisorctl stop all
sudo supervisorctl start all
pip install -U pyopenssl
bench config dns_multitenant on
sudo nano /home/USER/frappe-bench/sites/currentsite.txt

DELETE ALL CONTENTS FOR DNS MULTITENANCY

sudo bench setup lets-encrypt MYERPNEXT.LOCAL
bench setup nginx
sudo service nginx reload

Don’t forget to access website settings and disable signups, etc.
That’s about it. Now you should have a production ERPNext 12 running with https and you’re ready to do business

However, I still kee[ getting errors with permissions for mysql or redis

1 Like

Please post the errors you are facing along with any traceback and we will be more than happy to help you fix them.

this is not a good practice. β€œFrappe” as a username ranks very high for hacking attempts. So ideally the frappe user has a different username which is harder to guess

this progresses well until the bench bit (same old story!) but there are some errors below… this is better than my efforts so far so i will continue! (this is following instructions above for ubuntu 18)

login as: alex
alex@192.168.10.199’s password:
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 5.0.0-35-generic x86_64)

System information as of Tue Nov 12 23:58:49 UTC 2019

System load: 0.13 Processes: 128
Usage of /: 23.9% of 31.37GB Users logged in: 0
Memory usage: 6% IP address for ens19: 192.168.10.199
Swap usage: 0%

0 packages can be updated.
0 updates are security updates.

Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings

Your Hardware Enablement Stack (HWE) is supported until April 2023.

Last login: Tue Nov 12 23:47:51 2019 from 192.168.10.200
alex@p10erp1:~$ su -
Password:
root@p10erp1:~# su - frappe
frappe@p10erp1:~$ cd
frappe@p10erp1:~$ sudo pip install -e bench-repo
[sudo] password for frappe:
The directory β€˜/home/frappe/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
The directory β€˜/home/frappe/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Obtaining file:///home/frappe/bench-repo
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from bench==4.1.0)
Collecting Click (from bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 81kB 2.3MB/s
Collecting jinja2 (from bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/65/e0/eb35e762802015cab1ccee04e8a277b03f1d8e53da3ec3106882ec42558b/Jinja2-2.10.3-py2.py3-none-any.whl (125kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 133kB 3.3MB/s
Collecting virtualenv (from bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/c5/97/00dd42a0fc41e9016b23f07ec7f657f636cb672fad9cf72b80f8f65c6a46/virtualenv-16.7.7-py2.py3-none-any.whl (3.4MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3.4MB 159kB/s
Collecting requests (from bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 61kB 5.7MB/s
Collecting honcho (from bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/12/c2/95faf9e062e37f50fb685972692395bef019a554c08447282a81e35bf031/honcho-1.0.1-py2.py3-none-any.whl
Collecting python-crontab (from bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/bc/03/852f9c5f8da7f58abce06fe8ae769cbcf6502f1c60684b16bad72ffcced3/python-crontab-2.4.0.tar.gz (50kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 51kB 4.8MB/s
Collecting semantic_version (from bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/0f/3b/8fee26649a86c71df159ed0ae7ac5f9ac38829bccd8a7404e116f903929b/semantic_version-2.8.2-py2.py3-none-any.whl
Collecting GitPython==2.1.11 (from bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/fe/e5/fafe827507644c32d6dc553a1c435cdf882e0c28918a5bab29f7fbebfb70/GitPython-2.1.11-py2.py3-none-any.whl (448kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 450kB 1.7MB/s
Collecting MarkupSafe>=0.23 (from jinja2->bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/fb/40/f3adb7cf24a8012813c5edb20329eb22d5d8e2a0ecf73d21d6b85865da11/MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl (125kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 133kB 3.5MB/s
Collecting certifi>=2017.4.17 (from requests->bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl (154kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 163kB 3.0MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests->bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 143kB 3.5MB/s
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python2.7/dist-packages (from requests->bench==4.1.0)
Collecting python-dateutil (from python-crontab->bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 235kB 2.3MB/s
Collecting gitdb2>=2.0.0 (from GitPython==2.1.11->bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/03/6c/99296f89bad2ef85626e1df9f677acbee8885bb043ad82ad3ed4746d2325/gitdb2-2.0.6-py2.py3-none-any.whl (63kB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 71kB 5.3MB/s
Collecting smmap2>=2.0.0 (from gitdb2>=2.0.0->GitPython==2.1.11->bench==4.1.0)
Downloading https://files.pythonhosted.org/packages/55/d2/866d45e3a121ee15a1dc013824d58072fd5c7799c9c34d01378eb262ca8f/smmap2-2.0.5-py2.py3-none-any.whl
Installing collected packages: Click, MarkupSafe, jinja2, virtualenv, urllib3, certifi, chardet, requests, honcho, python-dateutil, python-crontab, semantic-version, smmap2, gitdb2, GitPython, bench
Running setup.py install for python-crontab … done
Running setup.py develop for bench
Successfully installed Click-7.0 GitPython-2.1.11 MarkupSafe-1.1.1 bench certifi-2019.9.11 chardet-3.0.4 gitdb2-2.0.6 honcho-1.0.1 jinja2-2.10.3 python-crontab-2.4.0 python-dateutil-2.8.1 requests-2.22.0 semantic-version-2.8.2 smmap2-2.0.5 urllib3-1.25.7 virtualenv-16.7.7
frappe@p10erp1:~$ set -o vi
frappe@p10erp1:~$ sudo -H pip install -e bench-repo
Obtaining file:///home/frappe/bench-repo
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from bench==4.1.0)
Requirement already satisfied: Click in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)
Requirement already satisfied: jinja2 in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)
Requirement already satisfied: virtualenv in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)
Requirement already satisfied: requests in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)
Requirement already satisfied: honcho in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)
Requirement already satisfied: python-crontab in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)
Requirement already satisfied: semantic_version in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)
Requirement already satisfied: GitPython==2.1.11 in /usr/local/lib/python2.7/dist-packages (from bench==4.1.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/dist-packages (from jinja2->bench==4.1.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python2.7/dist-packages (from requests->bench==4.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from requests->bench==4.1.0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/dist-packages (from requests->bench==4.1.0)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python2.7/dist-packages (from requests->bench==4.1.0)
Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/dist-packages (from python-crontab->bench==4.1.0)
Requirement already satisfied: gitdb2>=2.0.0 in /usr/local/lib/python2.7/dist-packages (from GitPython==2.1.11->bench==4.1.0)
Requirement already satisfied: smmap2>=2.0.0 in /usr/local/lib/python2.7/dist-packages (from gitdb2>=2.0.0->GitPython==2.1.11->bench==4.1.0)
Installing collected packages: bench
Found existing installation: bench 4.1.0
Can’t uninstall β€˜bench’. No files were found to uninstall.
Running setup.py develop for bench
Successfully installed bench
frappe@p10erp1:~$ bench init --frappe-branch version-12 --python /usr/bin/python2.7 frappe-bench && cd frappe-bench
INFO:bench.utils:virtualenv -q env -p /usr/bin/python2.7
Already using interpreter /usr/bin/python2.7
INFO:bench.utils:env/bin/pip -q install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
INFO:bench.utils:env/bin/pip -q install wheel
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
INFO:bench.utils:env/bin/pip -q install six
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --branch version-12 --depth 1 --origin upstream
Cloning into β€˜frappe’…
remote: Enumerating objects: 2599, done.
remote: Counting objects: 100% (2599/2599), done.
remote: Compressing objects: 100% (2452/2452), done.
remote: Total 2599 (delta 368), reused 862 (delta 96), pack-reused 0
Receiving objects: 100% (2599/2599), 12.36 MiB | 5.52 MiB/s, done.
Resolving deltas: 100% (368/368), done.
installing frappe
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: botocore 1.13.16 has requirement python-dateutil<2.8.1,>=2.1; python_version >= β€œ2.7”, but you’ll have python-dateutil 2.8.1 which is incompatible.
Updating node packages…
INFO:bench.utils:yarn install
yarn install v1.19.1
[1/4] Resolving packages…
[2/4] Fetching packages…
[3/4] Linking dependencies…
warning " > bootstrap@4.3.1" has unmet peer dependency β€œjquery@1.9.1 - 3”.
warning " > bootstrap@4.3.1" has unmet peer dependency β€œpopper.js@^1.14.7”.
[4/4] Building fresh packages…
Done in 179.19s.
INFO:bench.utils:bench build
yarn run v1.19.1
$ FRAPPE_ENV=production node rollup/build.js
Production mode
:heavy_check_mark: Built js/moment-bundle.min.js
:heavy_check_mark: Built js/libs.min.js

Building frappe assets…

:heavy_check_mark: Built js/dialog.min.js
:heavy_check_mark: Built js/modules.min.js
:heavy_check_mark: Built js/social.min.js
:heavy_check_mark: Built css/frappe-rtl.css
:heavy_check_mark: Built css/printview.css
:heavy_check_mark: Built js/web_form.min.js
:heavy_check_mark: Built js/list.min.js
:heavy_check_mark: Built js/chat.js
:heavy_check_mark: Built css/module.min.css
:heavy_check_mark: Built css/form.min.css
:heavy_check_mark: Built css/list.min.css
:heavy_check_mark: Built css/report.min.css
:heavy_check_mark: Built frappe/css/email.css
:heavy_check_mark: Built css/web_form.css
:heavy_check_mark: Built css/desk.min.css
:heavy_check_mark: Built js/barcode_scanner.min.js
:heavy_check_mark: Built js/desk.min.js
:heavy_check_mark: Built js/frappe-web.min.js
:heavy_check_mark: Built js/bootstrap-4-web.min.js
:heavy_check_mark: Built js/frappe-recorder.min.js
:heavy_check_mark: Built css/frappe-web-b4.css
:heavy_check_mark: Built js/control.min.js
:heavy_check_mark: Built js/form.min.js
:heavy_check_mark: Built js/data_import_tools.min.js
:heavy_check_mark: Built js/report.min.js
:sparkles: Done in 61.884s
Done in 64.52s.
INFO:bench.utils:setting up backups
no crontab for frappe
INFO:bench.utils:setting up auto update
no crontab for frappe
Bench frappe-bench initialized
frappe@p10erp1:~/frappe-bench$

still fails - see below - it trobles me that it isnt possible to get a set of instructions for this product that actually work… i challenge someone to show me a console log / comman log of this product installed end to end and working!!

frappe@p10erp1:~/frappe-bench$
frappe@p10erp1:~/frappe-bench$
frappe@p10erp1:~/frappe-bench$ bench new-site erp.myclrwater.co.uk --db-name erpnext --mariadb-root-password xxxxxx --admin-password yyyyyy --install-app erpnext --verbose --force
Created user erpnext
Created database erpnext
Granted privileges to user erpnext and database erpnext
Starting database import…
Imported from database /home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/framework_mariadb.sql

Installing frappe…
Updating DocTypes for frappe : [========================================]
Traceback (most recent call last):
File β€œ/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
β€œmain”, fname, loader, pkg_name)
File β€œ/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=β€˜bench’)
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 32, in new_site
db_type=db_type)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 73, in _new_site
_install_app(app, verbose=verbose, set_as_patched=not source_sql)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 92, in install_app
frappe.get_attr(after_install)()
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/utils/install.py”, line 19, in after_install
install_basic_docs()
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/utils/install.py”, line 77, in install_basic_docs
frappe.get_doc(d).insert()
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 259, in insert
self.run_post_save_methods()
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 919, in run_post_save_methods
self.run_method(β€œon_update”)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 787, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1058, in composer
return composed(self, method, *args, **kwargs)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 781, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 93, in on_update
self.share_with_self()
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 177, in share_with_self
flags={β€œignore_share_permission”: True})
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/share.py”, line 44, in add
notify_assignment(user, doctype, name, everyone)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/share.py”, line 171, in notify_assignment
enqueue_create_notification(shared_by, notification_doc)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/desk/doctype/notification_log/notification_log.py”, line 38, in enqueue_create_notification
now=frappe.flags.in_test
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1475, in enqueue
return frappe.utils.background_jobs.enqueue(*args, **kwargs)
File β€œ/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 69, in enqueue
kwargs=queue_args)
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/queue.py”, line 258, in enqueue_call
job = self.enqueue_job(job, at_front=at_front)
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/queue.py”, line 331, in enqueue_job
pipe.execute()
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/client.py”, line 2894, in execute
return execute(conn, stack, raise_on_error)
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/client.py”, line 2749, in _execute_transaction
connection.send_packed_command(all_cmds)
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/connection.py”, line 585, in send_packed_command
self.connect()
File β€œ/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/connection.py”, line 489, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:11000. Connection refused.

This is exactly where I’m still stuck now :pensive: :disappointed: :confounded:. However, when I ping the server IP, it somehow displays the ERPNext login screen. I’m concerned whether to trust that the application went well (no hidden surprise later …) for a production environment.

@revant_one has developed a docker-based deployment/installation of ERPNext without the use of bench altogether …

Another gentleman @brian_pond is working on another alternative for bench, called Weavlo. Looks very ambitious and well thought of …

open two terminal
1- for Bench start
2- for bench install

Successfully completed these method. But I’m getting these.


Shouldn’t I get stable/master version?

I was able to install using the easy install script on GCP, AWS and DigitalOcean. But installation failed on Interserver due to permission issues. One consistent failure though across board is when i used the --user flag. It always failed when i did that so installing without the --user flag installs into a frappe user directory successfully.

I tried without user flag and failed on AWS EC2. Could you share your steps? Thanks

I have these following steps for installation erpnext on aws .Check if it is helpful for you.

Cloud Service: Amazon AWS
Instance Type: t2.micro
Instance OS: Ubuntu 18.04
Prerequisites: Installed virtual server in a Linux environment, preferable Ubuntu
visit Tutorial: Get started with Amazon EC2 Linux instances - Amazon Elastic Compute Cloud

Part 1: Installing the cloud instance
-this is shortly go through how to install the cloud instance

1) Log into Amazon AWS (console.aws.amazon.com)
2) Create an account if you have not already
3) Click EC2, this is the service we will be using
4) Under the Create Instance section click the Launch Instance button
5) Select the Ubuntu Server 18.04 LTS (HVM), SSD Volume Type or similar
6) Click Review and Launch
    *we are using the t2.medium which is default
    *customize the instance. the operating system is the important characteristic
7) Click Launch after reviewing the instance. Make sure it is as requested
8) A popup should come up titled Select an existing key pair or create a new key pair
    *choose an existing key pair. for this example, we will assume you do not have one. follow the following:
        1) Choose Create a new key pair from the first drop down menu
        2) Name the Key pair name pem_key
        3) IMPORTANT: Click Download Key Pair
            * without it we cannot login
        4) Click Launch Instances
5) Click View Instances after reviewing the Launch Status page
6) You should now be on the Instances tab on the EC2 Dashboard. Notice the table and specifically the Status Checks column
7) Wait until there is a green check in the Status Check column that indicated the instance is ready
* You have now created the virtual server for your site instance

Part 2: SSH Information
-this will go over how to use SSH with your new virtual server
Prerequisites: Completed Part 1, Linux environment. You can use puTTY for windows but the guide will use Ubuntu

1) Open up terminal (shortcut: ctrl + alt + t)
2) Navigate to where you downloaded the ssh key (enter ls to see current directory and cd [file] to access a file)
3) Open up the Amazon AWS EC2 Dashboard and make sure you are on the Instances tab
    -we will now get the connection string. for experienced users, you can skip this
    1) Click on the virtual instance you would like to use your site on
    2) On the top bar, there should be a button called Connect. Click Connect
    3) In the Example section there is a bold string, it should look like this:
        ssh -i "example_key.pem" ubuntu@ec2-52-24-43-53.us-west-2.compute.amazonaws.com
    4) Copy this string and go back to the terminal
4) Paste the string (Paste in terminal: Ctrl + Shift + Z)
5) Press enter to connect
    note: there may be an error that will say: WARNING UNPROTECTED PRIVATE KEY FILE, follow these steps to 'protect' it
    1) Type in the following command to change the permissions of our key file (YOUR_KEY.pem)
        chmod 400 YOUR_KEY.pem
        *note that the 400 is a strict case, a higher number will be more lenient
6) We have now connected to our virtual instance using ssh

Part 3: Create a User and use SFTP
-this will create a user for proper bench installation and make sure we can sftp into it for easier editing
Prerequisites: Part 1, 2 completed, SFTP client like FileZilla

1) Connect to instance via SSH
2) You might be the user ubuntu, we will now create a new user. go to root user by typing in the following command:
    sudo su -
3) Set root password by typing in the following command (makes instance less secure)
    passwd
4) Type in the following command where [name] is your name
    adduser [name]
5) The terminal will ask for a series of questions for log information.
6) Add the user into the sudoer group by entering the following command
    sudo adduser [name] sudo
7) Set the password to the new user by entering in the following command (makes instance less secure)
    sudo passwd [name]
8) Allow SSH Password Authentication by following these steps:
    1) Go to the root directoy of the OS (you can do this by entering the command "cd ..")
    2) Type in the following command to navigate to the correct directory:
        cd etc/ssh
    3) Edit the sshd_config file through the following steps
        1) enter the following command
            vi sshd_config
        2) type the following to go into the editor (works like a text edito)
            i
        3) find where it says PasswordAuthentication and change it so that it shows the following:
            PasswordAuthentication yes
        *) Also change PermitRootLogin without-password to 
            PermitRootLogin yes
        4) Click the Esc button to get out of edit mode
        5) Enter the following to write and save the changes
            :w
        6) Enter the following to exit the vi editor
            :q
9) Open up your SFTP Client and login using the new user you created. The following uses FileZilla:
    1) Open up the Site Manager by click File -> Site Manager
    2) Click New Site
    3) In the General Tab:
        1) Host is the Public DNS of your instance. This can be found by going to the EC2 Dashboard Instances Tab
        2) You can leave the port  and the comments blank
        3) The Protocol is SFTP
        4) The Logon Type is "Ask for password"
        5) The user is root
    4) Click Connect
    5) Enter in the password
        * If there is an unkown host key warning, you can ignore it

Part 4: Install ERPNext on instance
-this will install the ERPNext software on the virtual server which is what your site uses

1) Open up terminal and ssh into your instance, login to the new user by entering the following:
    su [name]
2) Type in the following command to download the source and execute

    wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
  1. Type in the following command to install
    For developer setup:
    sudo python install.py --develop
    For production setup:
    sudo python install.py --production

  2. Take note of the MariaDB, Frappe, and Administrator password

  3. Type in the following command
    bench new-site sitename

  4. Enter in the MariaDB Password when it asks for the MySQL password

  5. Type in the following command
    bench --site [YOUR SITE NAME] install-app erpnext

  6. Type in the following command for multitenant setup
    bench config dns_multitenant on
    bench new-site site2name(eg:example.com)
    bench setup nginx
    sudo service nginx reload
    *) Note : For β€œDNS based multitenancy”, currentsite.txt in frappe-bench/sites/ should be empty.
    *) Note that we are done if everything was operational, now we have to open up the port from amazon and for domain setup go to route53.
    9) Go to the Amazon EC2 Instance Page
    10) Click on your instance and on the Description tab on the bottom, take not of the Security Groups
    11) Click on the Security Groups on the left hand side
    12) Click on the Security Group for your instance
    13) Click on the Inbound tab for your instance
    14) Click Edit
    15) Add a Custom TCP Rule for Port 8000 and Source 0.0.0.0/0

1 Like

I guess You’d have to run these commands first.
sudo apt update && sudo apt upgrade
sudo apt-get install python-minimal
sudo apt-get install build-essential python-setuptools

Right?

There is no need to run those commands.
When we are running following script :-
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

I tried it without installing python minimal; got an error while running install.py --production, saying can not find install.py :open_mouth:

I think easy installation is fixed now!

Congrats!
how you installed?