Guide: Manual Install ERPNext on Ubuntu 16.xx & Debian v8 & 9

You need to install python headers.

apt-get install python-dev

Did bench reinstall and started all over, but the problem persists. I think it’s a bug with mariadb, cannot find a good documentation about it.

Based on what I read on stackflow here

One of the issues seems to be a migration factor.

I have tried this guide to install frappe on debian stretch but I am getting the below error and I am unable to resolve this error:

aditya@aditya:~$ bench init frappe-bench
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:./env/bin/pip -q install --upgrade pip
INFO:bench.utils:./env/bin/pip -q install wheel
INFO:bench.utils:./env/bin/pip -q install six
INFO:bench.utils:./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git   --origin upstream
Cloning into 'frappe'...
remote: Counting objects: 142230, done.
remote: Compressing objects: 100% (107/107), done.
remote: Total 142230 (delta 59), reused 59 (delta 21), pack-reused 142102
Receiving objects: 100% (142230/142230), 114.58 MiB | 1.66 MiB/s, done.
Resolving deltas: 100% (108147/108147), done.
('installing', u'frappe')
INFO:bench.app:installing frappe
INFO:bench.utils:frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir
Updating node libraries...
INFO:bench.utils:npm install
/bin/sh: 1: npm: not found
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/aditya/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/aditya/bench-repo/bench/commands/make.py", line 21, in init
    verbose=verbose, clone_from=clone_from, skip_bench_mkdir=skip_bench_mkdir, skip_redis_config_generation=skip_redis_config_generation)
  File "/home/aditya/bench-repo/bench/utils.py", line 72, in init
    update_npm_packages(bench_path=path)
  File "/home/aditya/bench-repo/bench/utils.py", line 442, in update_npm_packages
    exec_cmd('npm install', cwd=bench_path)
  File "/home/aditya/bench-repo/bench/utils.py", line 140, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: npm install

@adityaduggal

Looks like node & npm are not installed, do a node --version & npm --version check

apt install nodejs Test the install: node -v && npm -v

Well yes this shows that nodejs is not installed but when I try to install nodejs I get that nodejs is already in latest version:

root@aditya:/home/aditya# apt install nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version (4.8.2~dfsg-1).
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
root@aditya:/home/aditya# node -v
bash: node: command not found
root@aditya:/home/aditya# npm -v
bash: npm: command not found

Just found out the solution from here:

But still I am unable to get the npm -v as below:

root@aditya:/home/aditya# node -v
v4.8.2
root@aditya:/home/aditya# npm -v
bash: npm: command not found
root@aditya:/home/aditya# redis-server -v
Redis server v=3.2.6 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=826601c992442478

Turns out that I had missed command curl -sL https://deb.nodesource.com/setup_7.x | sudo bash -
This command is the one needed to install nodejs and npm on debian stretch

Glad to know you have resolved it.

Regards

Guys. Just went through the whole ordeal! Follow this and you will not have any problems.
System: Ubuntu GNOME 17.04, VCPU: 4, RAM: 4GB
IMPORTANT: If your system or VM has less < 3GB RAM your installation will encounter errors

Installing ERPNext
ALL “bench” commands must be executed from /home/frappe/frappe-bench

Ubuntu OS
#Install Ubuntu 17.04 (or the latest version that is supported by ERPNext Easy Install Script)
#Create user “frappe”, pass “frappe”
#Set to auto logon

sudo su
apt-get update && apt-get upgrade

Net Tools & VMware Tools
sudo apt-get install -y net-tools
#On the VMware web interface, install the VMware Tools
#Extract the “VMwareTools-xxx.tar.gz” to the Downloads folder
#Open a terminal in the extracted folder where the file “vmware-install.pl” is located
sudo ./vmware-install.pl

VNC Server
#http://c-nergy.be/blog/?p=10426
#Install X11VNC
sudo apt-get install x11vnc -y
#Set the VNC password
x11vnc -storepasswd
#Test
/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /home/frappe/.vnc/passwd -rfbport 5900 -shared

#If everything works fine, find the Startup Applications in the Ubuntu menu and add the test line above as one of the startup applications

SAMBA (Network File Sharing)
sudo apt-get install -y samba samba-common python-glade2 system-config-samba
sudo touch /etc/libuser.conf

#Add a SAMBA user
sudo system-config-samba
#In the GUI: Preferences > Users > Add the user “frappe” username passwords all “frappe”

Web Browser
sudo apt-get purge --auto-remove firefox
#install the Chromium Web Browser in the Ubuntu Software Center
#Activities > search Software > search Chromium

Pre-requisites
sudo su
apt install build-essential software-properties-common libssl-dev libmariadbclient-dev python-pip python-setuptools python-mysqldb mariadb-server dirmngr nginx git-core redis-server supervisor wkhtmltopdf curl

#Set MariaDB root password
mysql
UPDATE mysql.user SET authentication_string = PASSWORD(‘frappe’) WHERE User = ‘root’ AND Host = ‘localhost’;
UPDATE mysql.user SET plugin = ‘mysql_native_password’ WHERE user = ‘root’ AND plugin = ‘unix_socket’;
FLUSH PRIVILEGES;
exit
systemctl stop mariadb
systemctl start mariadb

#Config MariaDB
sudo gedit /etc/mysql/my.cnf

#Add the following:

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

[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

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

#Continue
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt install nodejs
#REBOOT SERVER

ERPNext (Easy)
#Set all passwords to frappe
#Official Link:
#GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
#https://frappe.github.io/frappe/user/en/bench/guides/setup-production.html

sudo su
apt-get update && apt-get upgrade
apt-get install python-minimal build-essential python-setuptools curl
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
curl “https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py” -o install.py
exit
sudo python install.py --production
cd /home/frappe/frappe-bench
sudo bench setup production
#Replace all config file, default fresh install port will be 80

ERPNext (Manual)
#Login as As frappe User
git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps bench-repo
sudo su
pip install -e bench-repo
exit

#continue as frappe user
bench init frappe-bench
#(if bench command doesn’t work rerun above pip install again)

#add a new bench site
cd frappe-bench
bench new-site site1.local
bench start

#Test the installation
#If there are issues in accessing the site @ http://[SERVER-IP:8000] do a bench reinstall
#Ctrl+C to abort

#Install ERPNext
bench get-app --branch master erpnext GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
bench --site site1.local install-app erpnext
bench start
sudo bench setup production frappe

#Replace all config file, default fresh install port will be 80

Share Folders
sudo system-config-samba
#In the GUI: Preferences > Users > Add the user “frappe” username passwords all “frappe”
#Add writable and visible share to /home/frappe/frappe-bench/apps/erpnext/erpnext

3 Likes

where I try to install bench

this is the error_

Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-OoSjlZ/psutil/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7zqIp0-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-OoSjlZ/psutil

Storing debug log for failure in /root/.pip/pip.log

What’s the complete traceback?
Can you check your pip version? You can do this by typing pip --version .
If it returns 10.0.0, you should reinstall pip to a lower version like 9.0.3 since pip 10.0.0 was causing errors in installs.

Hello I tryed again.

When I arriving here bench new-site site1.local

I have this error

MySQL root password:
================================================================================
Creation of your site - site1.local failed because MariaDB is not properly
configured to use the Barracuda storage engine.
Please add the settings below to MariaDB's my.cnf, restart MariaDB then
run `bench new-site site1.local` again.


[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

What i can do?

Have you added settings as per recommendation in error? you need to open my.cnf file and set innodb-file-format to ‘barracuda’ and character-set to ‘uf8mb4’

how can i open?

If your installation is on Ubuntu 16.04 then from command line you can use the command

vi /etc/my.cnf.d/frappe.cnf

If that file is missing, there may be something wrong with your installation. check if /etc/my.cnf file contains anything

i have this…mean empty?

Did you install mysql? check by command mysql --version

yes

mysql Ver 15.1 Distrib 10.0.36-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

nano /etc/mysql/my.cnf

Add the following in each section (if it isn’t already there)

[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
;Set buffer pool size to 50-80% of your computer’s memory
innodb_buffer_pool_size=512M
;Set the log file size to about 25% of the buffer pool size
innodb_log_file_size=128M
innodb_log_buffer_size=64M
;the default here is 4MB, or maybe 16MB?? in more recent versions, which sometimes allows for disconnects in the middle of transactions
max_allowed_packet=64M

[mysql]
default-character-set = utf8mb4
;You can improve performance by indexing. Also check innodb_buffer_pool_size, should be 50-60% of your memory

sudo systemctl restart mysqld

i add your edit and now i cant restart mysqld

The lines starting with ; are comment lines - try deleting those or use a # instead of ;
The bold sectio0n is a wrapped comment, which is probably what’s causing the problem - just remove those lines
You also need to adjust the values to suit the amount of RAM you have in your machine

So it should be like this (but tuned to your RAM setup)

[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

innodb_buffer_pool_size=512M
innodb_log_file_size=128M
innodb_log_buffer_size=64M
max_allowed_packet=64M

[mysql]
default-character-set = utf8mb4