Installing ErpNext on CentOs 7 - Guide

Hi to all,

After trying to install ErpNext on a CentOs distribution I finally got it, so I share results with you all.

There are other posts related:

I use this guide to start with: http://comtronic.com.au/install-erpnext-centos7/

This is what I did to accomplish:

0- Get the CentOs V7 or any but the DVD Core version: CentOS-7-x86_64-Minimal-1511.iso

  • Set up everything:
    • Language
    • Time
    • root Password
    • HardDisk
  • If network is not up and running:

    nmtui (And modify as need it)
    service network restart (Restart service)

Ping google.com (To test Internet connection)

1- Run the following command:

yum erase chrony -y && yum install vim ntp ntpdate telnet deltarpm wget open-vm-tools -y && systemctl enable ntpd && systemctl enable ntpdate && yum update -y && init 6

2- Modify the file /etc/sysconfig/selinux with:

SELINUX=disabled
…then > init 6

3- Create directory:

mkdir /opt/erpnext
cd /opt/erpnext

4- Execute command:

wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh

5- Modify the setup_frappe.sh file:

…Locate function add_user(), on line 433 add :
usermod -aG wheel $FRAPPE_USER
…Later, locate line 478 then add:
usermod -G ‘’ $FRAPPE_USER

6- Execute and replace the word THE-PASSWORD-FOR-THE-MYSQL-SERVER with a password:

bash setup_frappe.sh --setup-production --mysql-root-password THE-PASSWORD-FOR-THE-MYSQL-SERVER --verbose

7- Stop nginx file config:

service nginx stop

8- Modify nginx config file on /etc/nginx/nginx.conf, with the following values:


user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
worker_connections 1024;
}

http {
log_format main '$remote_addr - $remote_user [$time_local] “$request” ’
'$status $body_bytes_sent “$http_referer” ’
‘“$http_user_agent” “$http_x_forwarded_for”’;

access_log  /var/log/nginx/access.log  main;

sendfile            on;
#tcp_nopush          on;
tcp_nodelay         on;
#keepalive_timeout   65;
types_hash_max_size 2048;

include             /etc/nginx/mime.types;
default_type        application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
index   index.html index.htm;
}

9- Then restart nginx service:

service nginx start

10- Modify the default company from site1.local to “testcompany.com”:

su frappe
cd ~/frappe-bench
mv sites/site1.local testcompany.com
bench --site testcompany.com install-app erpnext
sudo bench setup production frappe

…then:

sudo bench update

…At the end:

exit

11- Browse the testcompany.com site on port 80 with the IP or URL (testcompany.com) set on host.

Hope everyone find this guide usefull.

3 Likes

Please amend your steps to use the new setup procedure for this,

# Linux:

wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

# For development
sudo python install.py --develop

# For production
sudo python install.py --production

# If you're logged in as root, use --user flag to create a user and install using that user
sudo python install.py --develop --user frappe

setup_frappe Shell script is not supported from version 7

2 Likes

Exactly what I needed!

works on on centos 7 x86_64 Minimal 1611 fresh install (no update)

does not work on centos 7 x86_64 Minimal 1708 fresh install

Hi to all,

I have updated some steps to install ERPNEXT on CentOS 7:

Centos 7: 3.10.0-693.17.1.el7.x86_64
Date: February 23th 2018.

There are other posts related and credits goes to them also:

This is what I did to accomplish:

0- Get the CentOs V7 or any but the DVD Core version: CentOS-7-x86_64-Minimal-1511.iso

  • Set up everything:
  • Language
  • Time
  • root Password
  • HardDisk
  • If network is not up and running:

    nmtui (And modify as need it)
    service network restart (Restart service)
    Ping google.com (To test Internet connection)

1- Run the following command:

yum erase chrony -y && yum install vim ntp ntpdate telnet deltarpm wget open-vm-tools -y && systemctl enable ntpd && yum update -y && init 6

2- Disable CentOS 7 Firewall, modify the file /etc/sysconfig/selinux:

cat /etc/selinux/config | sed -e “s/SELINUX=enforcing/SELINUX=disabled/” > /etc/selinux/config2
mv -f /etc/selinux/config2 /etc/selinux/config
rm -f /etc/sysconfig/selinux
ln -s /etc/selinux/config /etc/sysconfig/selinux
init 6

3- Create directory:

> mkdir /opt/erpnext
> cd /opt/erpnext

4- Execute command:

> wget https://raw.githubusercontent.com/axatec/MIS-ERPNEXT-ScriptInstall/master/setup_frappe.sh

6- Execute and replace the word THE-PASSWORD-FOR-THE-MYSQL-SERVER with a password:

bash setup_frappe.sh --setup-production --mysql-root-password THE-PASSWORD-FOR-THE-MYSQL-SERVER --verbose

7- Stop nginx file config:

service nginx stop

8- Modify nginx config file on /etc/nginx/nginx.conf, with the following values:

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
worker_connections 1024;
}

http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

sendfile            on;
#tcp_nopush          on;
tcp_nodelay         on;
#keepalive_timeout   65;
types_hash_max_size 2048;

include             /etc/nginx/mime.types;
default_type        application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
index   index.html index.htm;
}

9- Then restart nginx service:

> service nginx start

10- Modify the default company from site1.local to “testcompany.com”:

> su frappe
> cd ~/frappe-bench
--->Drop existing site...(Mysql password will be required)
 > bench drop-site site1.local
---->Create company demo site
 **first create a demo site, this will be the default one
 Create:
  > bench new-site demo.testcompany.com
 Assign port:
  > bench set-nginx-port demo.testcompany.com 8080
---->Create company production test site
  > bench new-site production.testcompany.com
  Install ErpNext:
   > bench --site production.testcompany.com install-app erpnext
  Asign Port:
   > bench set-nginx-port production.testcompany.com 80
----->Update configs
  > sudo bench setup production frappe

…then, update repository:

> sudo bench update

…At the end:

> exit

11- Browse the production.testcompany.com site on port 80 with the IP or URL (production.testcompany.com) set on host.

Hope everyone find this guide usefull. (Shares and Comments are welcome).

7 Likes

Did you check your distro enviroment?
How did you install CentOs?

I have installed ERPnext on Ubuntu worked fine then Centos7 on Laptop hardware, it worked fine for!~

This time when I installed on Physical Server: O boy so many attempts to recover, but no Success on Installation!

Bench Installed successfully
but cant start bench … none of bench commands working …


bash-4.2$ bench start
Traceback (most recent call last):
File “/usr/bin/bench”, line 6, in
from pkg_resources import load_entry_point
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 3195, in
@_call_aside
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 3179, in _call_aside
f(*args, **kwargs)
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 3208, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 683, in _build_master
return cls._build_from_requirements(requires)
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 696, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 885, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘GitPython==0.3.2.1’ distribution was not found and is required by bench


Any given hand will appreciated!

The scrip was working fine
not not working

It’s not a good idea to disable selinux

Have you tried log out and log in again? Bench commands starts working

ref,
How To Install ERPNext in CentOS / RHEL || Erpnext || TechHack Tamil - YouTube