You are on page 1of 15

ERPNext on a Raspberry Pi 3

with Debian 9
1. Purpose
The purpose of this guide is to document the procedure to install the software ERPNext –an open source
application to manage the main functions of your business– on a RaspberryPi computer running Debian 9
(stretch). If you execute the commands as described in this guide, you will have a running instance of
ERPNext right at your fingertips, ready to be configured for your business!

At the date of publication of this guide, the “easy-install” script developed by the ERPNext team is not
working with Debian 9, hence this guide.

While the performances of the Raspberry Pi 3 are well below those of a virtual machine running on a laptop,
desktop or a dedicated server, there are some advantages, like the low cost of the Pi, roughly $35, the power
consumption (2 watts) and the possibility to have many users working in parallel. This architecture is OK for
small companies with one to ten employees, having up to 50 invoices or stock movements per day. I am
personally using it for running my consulting company.

Both procedures (“Fast manual” and “Step-by-step manual”) have been tested on a Raspberry Pi 3, freshly
loaded with the latest Debian version: https://www.raspberrypi.org/downloads/raspbian/

I would like to thank saidsl who wrote a great article on installing ERPNext on Debian 9, published on the
ERPNext discussion board and which was an invaluable starting point. (https://discuss.erpnext.com/t/guide-
manual-install-erpnext-on-ubuntu-16-xx-debian-v8-9/22596)

2. Fast manual Installation


This section is for skilled users who know a little bit about the linux command line, how to create a file and
execute it. It automates all the steps to the maximum possible extent in order to minimize your time
watching the screen for a command to end. If you feel uncomfortable, just skip this section and use the step-
by-step installation.

What you must do:

1. Adapt to your needs the four key variables which are highlighted in yellow at the beginning of the
script;
2. Copy the entire table (put your mouse cursor at the top left of the table, then click, then press Ctrl-c);

#!/bin/sh
############################################################################
# This script configures a Raspberry Pi 3 in order to run the software #
# ERPNext (www.erpnext.com). #
############################################################################

# This section customizes your installation


# We STRONGLY recommend that you use 'frappe'
# as USERNAME. The other three variables can
# have the value of your choice
USERNAME='frappe' # DON'T CHANGE THIS unless you know what you do

Date: 2018-08-23 Revision: 67 page 1 of 15


USERPWD='frappe'
YOURSITENAME='pibiadmin' #mysite
MARIADBPWD='erpnext'

# This function measures the time it takes to


# perform each script. It puts the results in
# the file time.txt in the current folder the
# script is executed
TT() {
STEPEND=$(date +%s)
STEPDIFF=$((STEPEND-STEPSTART))
TOTALDIFF=$((STEPEND-START))
echo "${1} duration is ${STEPDIFF} seconds. Total time now is ${TOTALDIFF} seconds."
echo "${1} duration is ${STEPDIFF} seconds. Total time now is ${TOTALDIFF} seconds." >> time.txt
STEPSTART=$(date +%s)
}

# Initialize time variables used by TT function


START=$(date +%s)
STEPSTART=$(date +%s)
echo "Summary of durations" > time.txt

# 3.1. Make sure that you have the latest Debian version
sudo apt update && sudo apt -y upgrade && sudo apt update && sudo apt autoremove && sudo apt clean
TT "3.1. Make sure that you have the latest Debian version"

# 3.2. Create a ''frappe'' user


sudo adduser --quiet --disabled-password --shell /bin/bash --home /home/$USERNAME --gecos "$USERNAME"
$USERNAME
echo "$USERPWD\n$USERPWD\n" | sudo passwd $USERNAME
sudo usermod -aG sudo $USERNAME
TT "3.2. Create a ''$USERNAME'' user"

# 3.3. Install some basic packages


sudo apt -y install build-essential software-properties-common dirmngr curl
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
TT "3.3. Install some basic packages"

# 3.4. Install Mariadb


sudo apt -y install mariadb-server

# In order to run correctly, we need to set-up


# the mariadb root password. This can be done
# by running a few sql commands that are first
# put into a file, then injected in mysql
rm -f skdjfh.sql
cat > skdjfh.sql << EOF
use mysql;
update user set plugin='' where user='root';
update user set password=PASSWORD("$MARIADBPWD") where User='root';
flush privileges;
quit
EOF

sudo mysql -u root < skdjfh.sql


rm -f skdjfh.sql

# We need to change some parameters to run


# ERPNext. This is done by adding them at
# the end of a mariadb configuration file.
rm -f skdjfh.cnf
cat > skdjfh.cnf << EOF

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake=FALSE
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci

[mysql]
default-character-set=utf8mb4
EOF

# Adding the parameters to the configuration file


# then removing the temporary file
cat skdjfh.cnf | sudo tee -a /etc/mysql/mariadb.conf.d/50-server.cnf > /dev/null
rm -f skdjfh.cnf

Date: 2018-08-23 Revision: 67 page 2 of 15


TT "3.4. Install MariaDB"

# 3.5. Install few more packages required by ERPNext


sudo curl -sL https://deb.nodesource.com/setup_7.x | sudo bash -
sudo apt -y install nodejs nginx redis-server wkhtmltopdf git-core python-pip libmariadbclient-dev python-
mysqldb libssl-dev
sudo pip install --upgrade setuptools
sudo pip install MySQL-python --no-binary :all:
sudo apt -y install supervisor libffi-dev libjpeg-dev libxml2-dev libxslt1-dev
TT "3.5. Install few more packages"

# Create a new file that contains a script


# The 'cat' command can be used to create a file
# from a set text lines. The syntax is:
# cat > filename << EndOfFileMarker
# If you put the EndOfFileMarker between single quotes
# then the eventual variables prefixed with the dollar
# sign will NOT be replaced by their actual values.
# This is why we need to treat separately the line
# containing your chosen site name.
rm -f skdjfh.sh
cat > skdjfh.sh << EOFB
#!/bin/sh
############################################################################
# This script configures a Raspberry Pi 3 in order to run the software #
# ERPNext (www.erpnext.com). #
############################################################################

USERNAME='$USERNAME'
YOURSITENAME='$YOURSITENAME'
EOFB
cat >> skdjfh.sh << 'EOFB'

TT() {
STEPEND=$(date +%s)
STEPDIFF=$((STEPEND-STEPSTART))
TOTALDIFF=$((STEPEND-START))
echo "${1} duration is ${STEPDIFF} seconds. Total time now is ${TOTALDIFF} seconds."
echo "${1} duration is ${STEPDIFF} seconds. Total time now is ${TOTALDIFF} seconds." >> time.txt
STEPSTART=$(date +%s)
}

# Initialize time variables


START=$(date +%s)
STEPSTART=$(date +%s)
echo "Summary of durations" > time.txt

# 3.6. Install frappe and bench frameworks


sudo rm -rf bench-repo
sudo rm -rf frappe-bench
git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo
bench init frappe-bench && cd frappe-bench
bench update
bench config http_timeout 600
yse | bench setup supervisor
yes | bench setup nginx
bench new-site $YOURSITENAME
TT "3.6. Install frappe and bench frameworks"

# Create a new file that contains the third


# and final script to run
rm -f skdjfh.sh
cat > skdjfh.sh << 'EOFC'
#!/bin/sh
############################################################################
# This script configures a Raspberry Pi 3 in order to run the software #
# ERPNext (www.erpnext.com). #
############################################################################

EOFC
cat >> skdjfh.sh << EOFC
USERNAME='$USERNAME'
YOURSITENAME='$YOURSITENAME'
EOFC
cat >> skdjfh.sh << 'EOFC'

TT() {

Date: 2018-08-23 Revision: 67 page 3 of 15


STEPEND=$(date +%s)
STEPDIFF=$((STEPEND-STEPSTART))
TOTALDIFF=$((STEPEND-START))
echo "${1} duration is ${STEPDIFF} seconds. Total time now is ${TOTALDIFF} seconds."
echo "${1} duration is ${STEPDIFF} seconds. Total time now is ${TOTALDIFF} seconds." >> time.txt
STEPSTART=$(date +%s)
}

# Initialize time variables


START=$(date +%s)
STEPSTART=$(date +%s)
echo "Summary of durations" > time.txt

# 3.7. Configuration of ERPNext


bench get-app erpnext https://github.com/frappe/erpnext
bench --site $YOURSITENAME install-app erpnext
bench config http_timeout 600
yes | bench setup supervisor
yes | bench setup nginx
sudo bench setup production $USERNAME
ip addr| grep "inet 192" | awk -F'[: ]+' '{ print $3 }'
TT "3.7. Configuration of ERPNext"
echo ""
echo "Your Raspberry Pi now is ready to run ERPNEXT!"
EOFC
EOFB
cat >> skdjfh.sh << EOFB
sudo mv skdjfh.sh /home/$USERNAME/frappe-bench/c.sh
sudo chmod +x /home/$USERNAME/frappe-bench/c.sh

echo ""
echo "The Raspberry Pi will now reboot in 5 seconds."
echo "Reconnect as $USERNAME user and go to the frappe-bench folder and run c.sh"
sleep 5s
sudo shutdown -r now
EOFB

# We have created the second file, now we save it


# in the right folder under the newly created user
sudo mv skdjfh.sh /home/$USERNAME/b.sh
sudo chmod +x /home/$USERNAME/b.sh

echo ""
echo "The Raspberry Pi will now reboot in 5 seconds."
echo "Reconnect as $USERNAME user and run b.sh."
sleep 5s
sudo shutdown -r now

3. Open a new file on your raspberry pi 3:


nano a.sh

4. Paste the script (right click the window) and save the file (ctrl-x, then y);

5. Execute the script:


chmod +x a.sh && ./a.sh
The execution time of a.sh is about 25 minutes, depending on your internet connection speed.
6. After the reboot, connect as frappe user and run the second script:
./b.sh
The execution time of b.sh is about 50 minutes, depending on your internet connection speed.
7. After the reboot, connect as frappe user and go to the frappe-bench folder, then run the file c.sh:
cd frappe-bench
./c.sh
You will have to create a new Administrator password in this script. Be careful to enter it twice the
same way and remember it, it will be the password you will use for your first connection to
ERPNext.
The execution time of c.sh is about 10 minutes.

Date: 2018-08-23 Revision: 67 page 4 of 15


8. At the end of the script, you will see the IP address of your Raspberry Pi. Launch you favorite
browser and type the URL http://yourIPaddress to enjoy ERPNext. For your first login, use
“Administrator” as user name with the password you have defined during the execution of the c.sh
script.

Date: 2018-08-23 Revision: 67 page 5 of 15


3. Step-by-step manual installation
This section contains all the commands and their results. While it is longer to execute than the fast
installation described in section 2, it is a good way to learn more about how the Raspberry Pi, Debian and
Linux in general work.

It is assumed that you are already connected to your Raspberrry Pi through ssh and you have a nice prompt
waiting for your commands.

Tip: position your cursor on a command and triple-click to select it. Go to your Raspberry Pi window and
paste the command by right clicking

3.1. Make sure that you have the latest Debian version

Step Command Result


lsb_release -a No LSB modules are available.
1 Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch

This is OK, the current version is 9.1. If you don't have this version,
you can download it from
https://www.raspberrypi.org/downloads/raspbian/
2 Update and upgrade to The output varies but you should read something like this at the end:
the latest versions of
Reading package lists... Done
packages, then do some Building dependency tree
clean up: Reading state information... Done
All packages are up to date.
Reading package lists... Done
sudo apt update && sudo Building dependency tree
apt -y upgrade && sudo Reading state information... Done
apt update && sudo apt 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
autoremove && sudo apt
clean

3.2. Create a ''frappe'' user

Step Command Result


sudo adduser --quiet
3 --disabled-password
This command doesn't return any text
--shell /bin/bash
--home /home/frappe
--gecos "frappe" frappe
Enter new UNIX password:
4 Set up a password for the Retype new UNIX password:
user frappe: passwd: password updated successfully

sudo passwd frappe

5 Allow user frappe to use This command doesn't return any text
sudo:
sudo usermod -aG sudo
frappe

Date: 2018-08-23 Revision: 67 page 6 of 15


3.3. Install some basic packages

Step Command Result


sudo apt -y install Reading package lists... Done
6 build-essential Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudo apt -y install Reading package lists... Done
7 software-properties- Building dependency tree
common Reading state information... Done
software-properties-common is already the newest version (0.96.20.2-
1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudo apt -y install Reading package lists... Done
8 dirmngr Building dependency tree
Reading state information... Done
dirmngr is already the newest version (2.1.18-8~deb9u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudo apt-key adv --recv- Executing: /tmp/apt-key-gpghome.nxxkuc7VfV/gpg.1.sh --recv-keys
9 keys --keyserver --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
keyserver.ubuntu.com gpg: key F1656F24C74CD1D8: "MariaDB Signing Key <signing-
0xF1656F24C74CD1D8 key@mariadb.org>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
sudo apt -y install curl Reading package lists... Done
10 Building dependency tree
Reading state information... Done
curl is already the newest version (7.52.1-5+deb9u2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

3.4. Install MariaDB and check that everything is OK

Step Command Result


sudo apt -y install mariadb-server
11 After a very long list of
lines (several hundreds),
the last three lines are:
Setting up mariadb-server
(10.1.23-9+deb9u1) ...
Processing triggers for
libc-bin (2.24-
11+deb9u1) ...
Processing triggers for
systemd (232-25+deb9u1) ...

12 Remove file eventually left from a previous tentative to install: This command doesn't
return any text
rm -f skdjfh.sql

13 Create a file that contains the commands to set up the mariadb root This command doesn't
password (change it if you want, before copying the lines) return any text

cat > skdjfh.sql << EOF


use mysql;
update user set plugin='' where user='root';
update user set password=PASSWORD("erpnext") where User='root';
flush privileges;
quit
EOF

14 Modify mariadb parameters: This command doesn't


return any text
sudo mysql -u root < skdjfh.sql

Date: 2018-08-23 Revision: 67 page 7 of 15


Step Command Result
15 Remove the configuration file: This command doesn't
return any text
rm -f skdjfh.sql

16 Remove the file that contains mariadb parameters: This command doesn't
return any text
rm -f skdjfh.cnf

17 Configure mariadb user's parameters: This command doesn't


return any text
cat > skdjfh.cnf << EOF
[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake=FALSE
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci

[mysql]
default-character-set=utf8mb4
EOF

18 Append the configuration parameters to the mariadb configuration This command returns the
file: content of the file
skdjfh.cnf
cat skdjfh.cnf | sudo tee -a /etc/mysql/mariadb.conf.d/50-server.cnf

19 Remove the file that contains mariadb parameters: This command doesn't
return any text
rm -f skdjfh.cnf

3.5. Install few more packages

Step Command Result


sudo apt -y install nginx
20 After about 150 lines, the last three lines are:
Setting up nginx-full (1.10.3-1+deb9u1) ...
Setting up nginx (1.10.3-1+deb9u1) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
sudo curl -sL
21 https://deb.nodesource.co
After about 20 lines, the last three lines are:
m/setup_8.x | sudo bash -
Fetched 6,372 B in 5s (1,257 B/s)
Reading package lists... Done

## Run `apt-get install nodejs` (as root) to install Node.js v7.x and
npm
sudo apt -y install Reading package lists... Done
22 nodejs Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 10.1 MB of archives.
After this operation, 49.8 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_7.x stretch/main armhf nodejs
armhf 7.10.1-2nodesource1~stretch1 [10.1 MB]
Fetched 10.1 MB in 2s (3,661 kB/s)
Selecting previously unselected package nodejs.
(Reading database ... 36322 files and directories currently
installed.)
Preparing to unpack .../nodejs_7.10.1-
2nodesource1~stretch1_armhf.deb ...
Unpacking nodejs (7.10.1-2nodesource1~stretch1) ...
Setting up nodejs (7.10.1-2nodesource1~stretch1) ...

Date: 2018-08-23 Revision: 67 page 8 of 15


Step Command Result
Processing triggers for man-db (2.7.6.1-2) ...
sudo apt-get install gcc Included gcc g++ make instalation and yarn
g++ make
curl -sL
https://dl.yarnpkg.com/de
bian/pubkey.gpg | sudo
apt-key add -
echo "deb
https://dl.yarnpkg.com/de
bian/ stable main" | sudo
tee
/etc/apt/sources.list.d/y
arn.list
sudo apt-get update &&
sudo apt-get install yarn
v8.11.4
23 Check that nodejs and 5.6.0
npm are well installed;
node -v && npm -v
sudo apt -y install Reading package lists... Done
24 redis-server Building dependency tree
Reading state information... Done
The following additional packages will be installed:
redis-tools
Suggested packages:
ruby-redis
The following NEW packages will be installed:
redis-server redis-tools
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 722 kB of archives.
After this operation, 1,948 kB of additional disk space will be used.
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf redis-tools armhf 3:3.2.6-1 [381 kB]
Get:2 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf redis-server armhf 3:3.2.6-1 [341 kB]
Fetched 722 kB in 0s (1,253 kB/s)
Selecting previously unselected package redis-tools.
(Reading database ... 39452 files and directories currently
installed.)
Preparing to unpack .../redis-tools_3%3a3.2.6-1_armhf.deb ...
Unpacking redis-tools (3:3.2.6-1) ...
Selecting previously unselected package redis-server.
Preparing to unpack .../redis-server_3%3a3.2.6-1_armhf.deb ...
Unpacking redis-server (3:3.2.6-1) ...
Setting up redis-tools (3:3.2.6-1) ...
Processing triggers for systemd (232-25+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up redis-server (3:3.2.6-1) ...
Created symlink /etc/systemd/system/redis.service →
/lib/systemd/system/redis-server.service.
Created symlink /etc/systemd/system/multi-user.target.wants/redis-
server.service → /lib/systemd/system/redis-server.service.
Processing triggers for systemd (232-25+deb9u1) ...
redis-server -v Redis server v=3.2.6 sha=00000000:0 malloc=jemalloc-3.6.0 bits=32
25 build=826601c992442478
sudo apt -y install
26 wkhtmltopdf
After about 500 lines, the last three lines are:
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Processing triggers for systemd (232-25+deb9u1) ...
Processing triggers for libgdk-pixbuf2.0-0:armhf (2.36.5-2+deb9u1) ...
sudo apt -y install git-
27 core
After about 20 lines, the last three lines are:
Processing triggers for man-db (2.7.6.1-2) ...
Setting up git (1:2.11.0-3+deb9u2) ...
Setting up git-core (1:2.11.0-3+deb9u2) ...
sudo apt -y install
28 python-pip
After about 200 lines, the last three lines are:
Setting up python-secretstorage (2.3.1-2) ...

Date: 2018-08-23 Revision: 67 page 9 of 15


Step Command Result
Setting up python-keyring (10.1-1) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
sudo apt -y install Reading package lists... Done
29 libmariadbclient-dev Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libmariadbclient-dev
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 983 kB of archives.
After this operation, 5,773 kB of additional disk space will be used.
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf libmariadbclient-dev armhf 10.1.23-9+deb9u1 [983
kB]
Fetched 983 kB in 0s (2,030 kB/s)
Selecting previously unselected package libmariadbclient-dev.
(Reading database ... 50212 files and directories currently
installed.)
Preparing to unpack .../libmariadbclient-dev_10.1.23-
9+deb9u1_armhf.deb ...
Unpacking libmariadbclient-dev (10.1.23-9+deb9u1) ...
Setting up libmariadbclient-dev (10.1.23-9+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
sudo apt -y install Reading package lists... Done
30 python-mysqldb Building dependency tree
Reading state information... Done
Suggested packages:
python-egenix-mxdatetime python-mysqldb-dbg
The following NEW packages will be installed:
python-mysqldb
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 48.8 kB of archives.
After this operation, 156 kB of additional disk space will be used.
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf python-mysqldb armhf 1.3.7-1.1 [48.8 kB]
Fetched 48.8 kB in 0s (131 kB/s)
Selecting previously unselected package python-mysqldb.
(Reading database ... 50315 files and directories currently
installed.)
Preparing to unpack .../python-mysqldb_1.3.7-1.1_armhf.deb ...
Unpacking python-mysqldb (1.3.7-1.1) ...
Setting up python-mysqldb (1.3.7-1.1) ...
sudo apt -y install Reading package lists... Done
31 libssl-dev Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libssl-doc
The following NEW packages will be installed:
libssl-dev libssl-doc
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 2,825 kB of archives.
After this operation, 9,727 kB of additional disk space will be used.
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf libssl-dev armhf 1.1.0f-3+deb9u1 [1,369 kB]
Get:2 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf libssl-doc all 1.1.0f-3+deb9u1 [1,456 kB]
Fetched 2,825 kB in 1s (2,226 kB/s)
Selecting previously unselected package libssl-dev:armhf.
(Reading database ... 50344 files and directories currently
installed.)
Preparing to unpack .../libssl-dev_1.1.0f-3+deb9u1_armhf.deb ...
Unpacking libssl-dev:armhf (1.1.0f-3+deb9u1) ...
Selecting previously unselected package libssl-doc.
Preparing to unpack .../libssl-doc_1.1.0f-3+deb9u1_all.deb ...
Unpacking libssl-doc (1.1.0f-3+deb9u1) ...
Setting up libssl-dev:armhf (1.1.0f-3+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libssl-doc (1.1.0f-3+deb9u1) ...
sudo pip install Collecting setuptools
32 --upgrade setuptools Downloading setuptools-38.2.3-py2.py3-none-any.whl (489kB)
100% |████████████████████████████████| 491kB 497kB/s
Installing collected packages: setuptools
Found existing installation: setuptools 33.1.1
Not uninstalling setuptools at /usr/lib/python2.7/dist-packages,
outside environment /usr
Successfully installed setuptools-38.2.3

Date: 2018-08-23 Revision: 67 page 10 of 15


Step Command Result
sudo pip install MySQL- DEPRECATION: --no-use-wheel is deprecated and will be removed in the
33 python --no-binary :all: future. Please use --no-binary :all: instead.
Collecting MySQL-python
Downloading MySQL-python-1.2.5.zip (108kB)
100% |████████████████████████████████| 112kB 1.0MB/s
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 ... done
Successfully installed MySQL-python-1.2.5
sudo apt -y install Reading package lists... Done
34 supervisor Building dependency tree
Reading state information... Done
The following additional packages will be installed:
python-meld3
Suggested packages:
supervisor-doc
The following NEW packages will be installed:
python-meld3 supervisor
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 317 kB of archives.
After this operation, 1,604 kB of additional disk space will be used.
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf python-meld3 all 1.0.2-2 [37.3 kB]
Get:2 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf supervisor all 3.3.1-1+deb9u1 [280 kB]
Fetched 317 kB in 0s (666 kB/s)
Selecting previously unselected package python-meld3.
(Reading database ... 53605 files and directories currently
installed.)
Preparing to unpack .../python-meld3_1.0.2-2_all.deb ...
Unpacking python-meld3 (1.0.2-2) ...
Selecting previously unselected package supervisor.
Preparing to unpack .../supervisor_3.3.1-1+deb9u1_all.deb ...
Unpacking supervisor (3.3.1-1+deb9u1) ...
Setting up python-meld3 (1.0.2-2) ...
Setting up supervisor (3.3.1-1+deb9u1) ...
Created symlink /etc/systemd/system/multi-
user.target.wants/supervisor.service →
/lib/systemd/system/supervisor.service.
Processing triggers for systemd (232-25+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
sudo apt-get install Reading package lists... Done
35 libffi-dev Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libffi-dev
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 159 kB of archives.
After this operation, 332 kB of additional disk space will be used.
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf libffi-dev armhf 3.2.1-6 [159 kB]
Fetched 159 kB in 0s (381 kB/s)
Selecting previously unselected package libffi-dev:armhf.
(Reading database ... 53743 files and directories currently
installed.)
Preparing to unpack .../libffi-dev_3.2.1-6_armhf.deb ...
Unpacking libffi-dev:armhf (3.2.1-6) ...
Processing triggers for install-info (6.3.0.dfsg.1-1+b1) ...
Setting up libffi-dev:armhf (3.2.1-6) ...
Processing triggers for man-db (2.7.6.1-2) ...
sudo apt -y install Reading package lists... Done
36 libjpeg-dev Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libjpeg62-turbo-dev
The following NEW packages will be installed:
libjpeg-dev libjpeg62-turbo-dev
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 237 kB of archives.
After this operation, 544 kB of additional disk space will be used.
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf libjpeg62-turbo-dev armhf 1:1.5.1-2 [181 kB]
Get:2 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf libjpeg-dev all 1:1.5.1-2 [56.1 kB]
Fetched 237 kB in 0s (535 kB/s)
Selecting previously unselected package libjpeg62-turbo-dev:armhf.

Date: 2018-08-23 Revision: 67 page 11 of 15


Step Command Result
(Reading database ... 53778 files and directories currently
installed.)
Preparing to unpack .../libjpeg62-turbo-dev_1%3a1.5.1-2_armhf.deb ...
Unpacking libjpeg62-turbo-dev:armhf (1:1.5.1-2) ...
Selecting previously unselected package libjpeg-dev.
Preparing to unpack .../libjpeg-dev_1%3a1.5.1-2_all.deb ...
Unpacking libjpeg-dev (1:1.5.1-2) ...
Setting up libjpeg62-turbo-dev:armhf (1:1.5.1-2) ...
Setting up libjpeg-dev (1:1.5.1-2) ...
sudo apt -y install Reading package lists... Done
37 libxml2-dev Building dependency tree
Reading state information... Done
The following additional packages will be installed:
icu-devtools libicu-dev
Suggested packages:
icu-doc
The following NEW packages will be installed:
icu-devtools libicu-dev libxml2-dev
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Need to get 16.6 MB of archives.
After this operation, 73.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf icu-devtools armhf 57.1-6 [156 kB]
Get:2 http://mirror.iway.ch/raspbian/raspbian stretch/main armhf
libicu-dev armhf 57.1-6 [15.8 MB]
Get:3 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf libxml2-dev armhf 2.9.4+dfsg1-2.2+deb9u1 [668 kB]
Fetched 16.6 MB in 3s (4,491 kB/s)
Selecting previously unselected package icu-devtools.
(Reading database ... 53798 files and directories currently
installed.)
Preparing to unpack .../icu-devtools_57.1-6_armhf.deb ...
Unpacking icu-devtools (57.1-6) ...
Selecting previously unselected package libicu-dev.
Preparing to unpack .../libicu-dev_57.1-6_armhf.deb ...
Unpacking libicu-dev (57.1-6) ...
Selecting previously unselected package libxml2-dev:armhf.
Preparing to unpack .../libxml2-dev_2.9.4+dfsg1-
2.2+deb9u1_armhf.deb ...
Unpacking libxml2-dev:armhf (2.9.4+dfsg1-2.2+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up icu-devtools (57.1-6) ...
Setting up libicu-dev (57.1-6) ...
Setting up libxml2-dev:armhf (2.9.4+dfsg1-2.2+deb9u1) ...
sudo apt -y install Reading package lists... Done
38 libxslt1-dev Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libxslt1-dev
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 488 kB of archives.
After this operation, 2,246 kB of additional disk space will be used.
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian
stretch/main armhf libxslt1-dev armhf 1.1.29-2.1 [488 kB]
Fetched 488 kB in 0s (1,086 kB/s)
Selecting previously unselected package libxslt1-dev:armhf.
(Reading database ... 54124 files and directories currently
installed.)
Preparing to unpack .../libxslt1-dev_1.1.29-2.1_armhf.deb ...
Unpacking libxslt1-dev:armhf (1.1.29-2.1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libxslt1-dev:armhf (1.1.29-2.1) ...

Date: 2018-08-23 Revision: 67 page 12 of 15


Step Command Result
39 Reboot the server:
sudo shutdown -r now

3.6. Install frappe and bench frameworks


Step Command Result
Linux pi1 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l
40 Restart your ssh session
and log in as 'frappe': The programs included with the Debian GNU/Linux system are free
software;
the exact distribution terms for each program are described in the
login as: frappe individual files in /usr/share/doc/*/copyright.
frappe@192.168.1.50's
password: Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
git clone Cloning into 'bench-repo'...
41 https://github.com/frappe remote: Counting objects: 4430, done.
/bench bench-repo remote: Compressing objects: 100% (21/21), done.
remote: Total 4430 (delta 1), reused 10 (delta 1), pack-reused 4407
Receiving objects: 100% (4430/4430), 29.32 MiB | 3.86 MiB/s, done.
Resolving deltas: 100% (2762/2762), done.
sudo pip install -e
42 bench-repo
After about 40 lines, the last line is:
Successfully installed Click-6.7 GitPython-0.3.2rc1 MarkupSafe-1.0
bench certifi-2017.11.5 chardet-3.0.4 gitdb-0.6.4 honcho-1.0.1 idna-
2.6 jinja2-2.10 psutil-5.4.1 python-crontab-2.2.7 python-dateutil-
2.6.1 requests-2.18.4 semantic-version-2.6.0 smmap-0.9.0 urllib3-1.22
virtualenv-15.1.0

43 This command takes After about 80 lines, the last line is:
about 25 minutes to
INFO:bench.utils:setting up auto update
execute, be patient! no crontab for frappe
Bench frappe-bench initialized
bench init frappe-bench
&& cd frappe-bench

44 Create a new site Remember the Administrator password that you entered at the end of
(change the name before the process. It will be required for your first login to ERPNext.
copying the command):
bench new-site
yoursitename

45 Reboot the server:


sudo shutdown -r now

3.7. Configuration of ERPNext


Step Command Result
46 Restart your ssh session

Date: 2018-08-23 Revision: 67 page 13 of 15


Step Command Result
and go to frappe-bench
folder:
login as: frappe
frappe@192.168.1.50's
password:

cd frappe-bench
bench get-app erpnext INFO:bench.app:getting app erpnext
47 https://github.com/frappe INFO:bench.utils:git clone https://github.com/frappe/erpnext --depth
/erpnext 1 --origin upstream
Cloning into 'erpnext'...
remote: Counting objects: 5963, done.
remote: Compressing objects: 100% (5245/5245), done.
remote: Total 5963 (delta 1103), reused 3072 (delta 567), pack-reused
0
Receiving objects: 100% (5963/5963), 173.09 MiB | 4.49 MiB/s, done.
Resolving deltas: 100% (1103/1103), done.
Checking out files: 100% (5940/5940), done.
('installing', u'erpnext')
INFO:bench.app:installing erpnext
INFO:bench.utils:./env/bin/pip install -q -e ./apps/erpnext --no-
cache-dir
Wrote css/frappe-web.css - 65.11 KB
Wrote js/frappe-web.min.js - 132.05 KB
Wrote js/control.min.js - 72.03 KB
Wrote js/dialog.min.js - 116.36 KB
Wrote css/desk.min.css - 309.44 KB
Wrote css/frappe-rtl.css - 32.49 KB
Wrote js/libs.min.js - 1.13 MB
Wrote js/desk.min.js - 459.79 KB
Wrote css/module.min.css - 2.08 KB
Wrote css/form.min.css - 4.47 KB
Wrote js/form.min.js - 195.7 KB
Wrote css/list.min.css - 15.04 KB
Wrote js/list.min.js - 149.77 KB
Wrote css/report.min.css - 7.89 KB
Wrote js/report.min.js - 260.22 KB
Wrote js/web_form.min.js - 247.55 KB
Wrote css/web_form.css - 24.42 KB
Wrote js/print_format_v3.min.js - 23.39 KB
Wrote css/erpnext.css - 8 KB
Wrote js/erpnext-web.min.js - 3.79 KB
Wrote js/erpnext.min.js - 152.6 KB
Wrote js/item-dashboard.min.js - 7.86 KB
Installing erpnext...
48 Be sure to put the correct Updating DocTypes for erpnext :
site name in the [========================================]
command below before
copying it:
bench --site yoursitename
install-app erpnext

49 As the Pi is relatively This command doesn't return any text


slow, we update the
timeout to 10 minutes:
bench config http_timeout
600
supervisor.conf already exists and this will overwrite it. Do you want
50 Set up the supervisor: to continue? [y/N]:

yes | bench setup


supervisor

Port configuration list:


51 Set up nginx:
Site yoursitename assigned port: 80
yes | bench setup nginx nginx.conf already exists and this will overwrite it. Do you want to
continue? [y/N]:

Date: 2018-08-23 Revision: 67 page 14 of 15


Step Command Result
sudo bench setup Port configuration list:
52 production frappe
Site yoursitename assigned port: 80
INFO:bench.utils:sudo /usr/bin/supervisorctl reread
frappe-bench-redis: available
frappe-bench-web: available
frappe-bench-workers: available
INFO:bench.utils:sudo /usr/bin/supervisorctl update
frappe-bench-redis: added process group
frappe-bench-web: added process group
frappe-bench-workers: added process group
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
INFO:bench.utils:sudo systemctl reload nginx
ip addr| grep "inet 192"
53 | awk -F'[: ]+' '{ print
Note your ip address:
$3 }'
192.168.1.50/24

54 Close your ssh session:


logout

Type in your browser the following URL to enjoy ERPNext (replace the IP adress with the one obtained at
step 50):
http://192.168.1.50/login

For your first login, use “Administrator” as user name with the password you have defined during the
execution of the last script.

4. Conclusion
That's it, you have a running version of ERPNext on your Raspberry Pi. This is where this guide stops, as
any question related to ERPNext itself is beyond the defined purpose. Visit the ERPNext website and forum
for support at https://discuss.erpnext.com.

I hope you have enjoyed this guide as much as I enjoyed writing it!

Date: 2018-08-23 Revision: 67 page 15 of 15

You might also like