Try ERPNext Buy Support Partners Foundation

How to install erpnext from A-Z

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

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 https://github.com/frappe/frappe.git --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 http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html

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?

Yeah I did. :frowning:

Facing a lots of issues after restoring my v10 database there though. But, the installation worked fine.

That step failed here on Ubuntu 18.04.

Solution was to install libssl-dev before:

apt install libssl-dev

After that, it worked.

1 Like

apt install redis-server -y
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
alien at bc cups-bsd cups-client debhelper debugedit dh-autoreconf dh-strip-nondeterminism guile-2.0-libs intltool-debian
libarchive-cpio-perl libarchive-zip-perl libarchive13 libfile-stripnondeterminism-perl libgc1c2 libgsasl7 libkyotocabinet16v5
liblua5.2-0 liblzo2-2 libmail-sendmail-perl libntlm0 libpython2.7 librpm8 librpmbuild8 librpmio8 librpmsign8
libsys-hostname-long-perl lsb-security mailutils-common pax po-debconf rpm rpm-common rpm2cpio
Use β€˜sudo apt autoremove’ to remove them.
The following additional packages will be installed:
libjemalloc1 redis-tools
Suggested packages:
ruby-redis
The following NEW packages will be installed:
libjemalloc1 redis-server redis-tools
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 634 kB of archives.
After this operation, 3,012 kB of additional disk space will be used.
Get:1 http://sg.mirrors.cloud.aliyuncs.com/ubuntu bionic/universe amd64 libjemalloc1 amd64 3.6.0-11 [82.4 kB]
Get:2 http://sg.mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/universe amd64 redis-tools amd64 5:4.0.9-1ubuntu0.2 [516 kB]
Get:3 http://sg.mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/universe amd64 redis-server amd64 5:4.0.9-1ubuntu0.2 [35.4 kB]
Fetched 634 kB in 0s (22.8 MB/s)
Selecting previously unselected package libjemalloc1.
(Reading database … 122952 files and directories currently installed.)
Preparing to unpack …/libjemalloc1_3.6.0-11_amd64.deb …
Unpacking libjemalloc1 (3.6.0-11) …
Selecting previously unselected package redis-tools.
Preparing to unpack …/redis-tools_5%3a4.0.9-1ubuntu0.2_amd64.deb …
Unpacking redis-tools (5:4.0.9-1ubuntu0.2) …
Selecting previously unselected package redis-server.
Preparing to unpack …/redis-server_5%3a4.0.9-1ubuntu0.2_amd64.deb …
Unpacking redis-server (5:4.0.9-1ubuntu0.2) …
Setting up libjemalloc1 (3.6.0-11) …
Setting up redis-tools (5:4.0.9-1ubuntu0.2) …
Setting up redis-server (5:4.0.9-1ubuntu0.2) …
Job for redis-server.service failed because a timeout was exceeded.
See β€œsystemctl status redis-server.service” and β€œjournalctl -xe” for details.
invoke-rc.d: initscript redis-server, action β€œstart” failed.
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: timeout) since Tue 2019-12-17 15:56:12 CST; 16ms ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 9558 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
dpkg: error processing package redis-server (–configure):
installed redis-server package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.27-3ubuntu1) …
Processing triggers for systemd (237-3ubuntu10.33) …
Processing triggers for man-db (2.8.3-2ubuntu0.1) …
Processing triggers for ureadahead (0.100.0-21) …
Errors were encountered while processing:
redis-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Getting this error while installing redis server

Tried again in a fresh server. Got this error.

pip install MySQL-python --no-use-wheel
DEPRECATION: --no-use-wheel is deprecated and will be removed in the future. Please use --no-binary :all: instead.
Collecting MySQL-python
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Skipping bdist_wheel for MySQL-python, due to binaries being disabled for it.
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python … error
Complete output from command /usr/bin/python -u -c β€œimport setuptools, tokenize;file=’/tmp/pip-build-LNPZZ6/MySQL-python/setup.py’;f=getattr(tokenize, β€˜open’, open)(file);code=f.read().replace(’\r\n’, β€˜\n’);f.close();exec(compile(code, file, β€˜exec’))” install --record /tmp/pip-3T3TTg-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/init.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building 'mysql’ extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-5Z483E/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,β€˜final’,1) -D__version
=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-5Z483E/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-5Z483E/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -o build/lib.linux-x86_64-2.7/_mysql.so
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command β€˜x86_64-linux-gnu-gcc’ failed with exit status 1

----------------------------------------

Command β€œ/usr/bin/python -u -c β€œimport setuptools, tokenize;file=’/tmp/pip-build-LNPZZ6/MySQL-python/setup.py’;f=getattr(tokenize, β€˜open’, open)(file);code=f.read().replace(’\r\n’, β€˜\n’);f.close();exec(compile(code, file, β€˜exec’))” install --record /tmp/pip-3T3TTg-record/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-build-LNPZZ6/MySQL-python/