Professional Documents
Culture Documents
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)
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). #
############################################################################
# 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"
[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
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)
}
EOFC
cat >> skdjfh.sh << EOFC
USERNAME='$USERNAME'
YOURSITENAME='$YOURSITENAME'
EOFC
cat >> skdjfh.sh << 'EOFC'
TT() {
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
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
4. Paste the script (right click the window) and save the file (ctrl-x, then y);
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
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
5 Allow user frappe to use This command doesn't return any text
sudo:
sudo usermod -aG sudo
frappe
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
16 Remove the file that contains mariadb parameters: This command doesn't
return any text
rm -f skdjfh.cnf
[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
## 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) ...
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
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
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!