How To Install ERPNext on CentOS 7

Install ERPNext on CentOS

ERPNext is a completely robust ERP framework intended for small and medium-sized businesses. It covers an extensive variety of features, including accounting, CRM, inventory, selling, purchasing, manufacturing, projects, HR and payroll, website, e-commerce, and more – all of which make it profoundly adaptable and extendable.

ERPNext is developed in Python and depends on the Frappe Framework. It utilizes Node.js for the front end, Nginx for the web server, Redis for caching, and MariaDB for the database.

ERPNext is Open Source under the GNU General Public License v3.

In this article, we will show you how to install ERPNext on CentOS 7 on one of our optimized ERPNext hosting servers.

Prerequisites:

Make sure your server met the following requirements.

  • 2GB of RAM or higher
  • 2 or more CPU cores
  • Fresh CentOS 7 Installation
  • Full root access

Update the System and Install the Dependencies

Log in to your server via SSH:

ssh username@server_ip

Before starting with the ERPNext installation, it is a good idea to update the system packages to their latest versions.

sudo yum update -y

Install the development tool dependencies by running the following command:

sudo yum groupinstall -y "Development Tools"
sudo yum install python-devel

Install ERPNext

Installing Node JS

Since ERPNext uses Node JS for its front end, we first need to set up the latest version of Node JS. As of writing, the current LTS version of Node.js is version 10.x.

To install, first, we need to run the following command to add NodeJS’ official repository to the system.

sudo curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -

Once the repository is added, run the following command:

sudo yum install -y nodejs

To verify, run the following to check node version, must be 10.x.x:

node --version

Installing ERPNext using a script

Fortunately, ERPNext developers have created an easy install script to save time and avoid any problems with configuring your ERPNext server. This python script will install the prerequisites & bench, as well as set up the ERPNext site.

We can set up ERPNext on two environments, development and production. For the development environment, there will be no Nginx installed and you need to start ERPNext manually. For a production environment,  Nginx is installed and the process will be managed by supervisor. You will learn more about supervisor later on in this tutorial.

When installing under a production environment, we need to make sure that we uninstall Apache first as the installer script will set up Nginx. It is also recommended to uninstall MariaDB to avoid conflicts during installation for both production and development. For a development environment, it is safe to leave Apache installed and running as Nginx will not be installed.

To stop and uninstall Apache (required for production set up only):

sudo systemctl stop httpd
sudo yum remove -y httpd httpd-tools apr apr-util

To stop and uninstall MariaDB (recommended for both development and production setup):

sudo systemctl stop mariadb
sudo yum remove -y mariadb mariadb-server
sudo rm -rf /var/lib/mysql /etc/my.cnf

To start with the installation, we first need to download the official script using wget:

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

The script will require three parameters:

domain = your development/production domain
erp_user = preferred local ERPNext user
bench_name = preferred bench name

For development installation, supply the following command.

sudo python install.py --develop --site [domain] --user [erp_user]--bench-name [bench_name] --verbose

For production installation, use the following command:

sudo python install.py --production --site [domain] --user [erp_user] --bench-name [bench_name] --verbose

An example would be:

sudo python install.py --develop --site erp-dev.rosehosting.com --user erpnext --bench-name erpnext-dev --verbose

The following is the process that will be done by the script:
* Install all the pre-requisites
* Install the command line based bench
* Set up a new bench – contains ERPNext files
* Finally, set up a new ERPNext site on the bench

During the installation, the script will ask for the database and Administrator password. Always remember to use a strong password. Passwords will be located at ~/passwords.txt after installation.

Starting ERPNext

On a development environment setup, it is required to start the ERPNext application manually. The ERPNext application listens on port 8000.

Development

su - [erp_user]
cd [bench_name]
bench start

You can now access your setup at:

http://[domain]:8000
Login: Administrator
Password: The one that you input during installation

Production

There’s no need to do anything, processes will be managed by the supervisor.

Supervisor is a process control system that enables you to monitor and control processes on systems running Linux. When supervisor is running, it will automatically start the application at boot and will handle process failures. The installer script automatically configured supervisor for your ERPNext application.

You can check processes handled by supervisor by using the command:

sudo supervisorctl status all

You can now log in to your production website without using port 8000 as the Nginx web server is already configured as a reverse proxy for port 8000.

After logging in, you should now be able to finalize the initial setup of your ERPNext application.


Of course, you don’t have to install ERPNext on CentOS 7 if you have a CentOS VPS with us. You can simply ask our support team to install ERPNext on CentOS 7 for you. They are available 24/7 and will be able to help you with the installation.

If you enjoyed reading this blog post on How to Install ERPNext on CentOS 7, feel free to share it on social networks using the shortcuts below, or simply leave a comment. Also, in case you are using the latest CentOS, we have a new detailed, step-by-step tutorial on How To Install ERPNext on CentOS 8.

10 thoughts on “How To Install ERPNext on CentOS 7”

  1. I get this error:
    Traceback (most recent call last):
    File “install.py”, line 413, in
    install_bench(args)
    File “install.py”, line 135, in install_bench
    run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
    File “install.py”, line 327, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
    File “/usr/lib64/python2.7/subprocess.py”, line 542, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=george’]’ returned non-zero exit status 2
    [george@prenus ~]$ ansible –version
    ansible 2.8.3
    config file = None
    configured module search path = [u’/home/george/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
    ansible python module location = /usr/lib/python2.7/site-packages/ansible
    executable location = /usr/bin/ansible
    python version = 2.7.5 (default, Jun 20 2019, 20:27:34) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

    Reply
    • Check if pip is installed on your server and then run the script again.

      You can install pip with the following command:
      yum -y install python-pip

      Reply
  2. when run : sudo python install.py –develop –site [domain] –user [erp_user]–bench-name [bench_name] –verbose

    there is error in :
    TASK [Install psutil]
    “msg”: “stdout: Collecting psutil\n Using cached https://files.pythonhosted.org/packages/e1/b0/7276de53321c12981717490516b7e612364f2cb372ee8901bd4a66a000d7/psutil-5.8.0.tar.gz\n Complete output from command python setup.py egg_info:\n /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘python_requires’\n warnings.warn(msg)\n /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘long_description_content_type’\n warnings.warn(msg)\n error in psutil setup command: ‘extras_require’ must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.\n \n —————————————-\n\n:stderr: Command \”python setup.py egg_info\” failed with error code 1 in /tmp/pip-build-w0yYCt/psutil/\nYou are using pip version 8.1.2, however version 21.2.4 is available.\nYou should consider upgrading via the ‘pip install –upgrade pip’ command.\n”

    —————————————————————
    I try to use :
    pip install –upgrade pip
    pip install –upgrade setuptools

    but it don’t wroks :(

    Reply
    • You can try running “pip install –upgrade setuptools” then install psutil: “pip install psutil”

      Then you can re-run the command “sudo python install.py –develop –site [domain] –user [erp_user]–bench-name [bench_name] –verbose”

      Reply
    • Frappe updated their repository structure, you can check the repository at https://github.com/frappe/bench

      Additionally, you can update the command to use their easy-install script: https://raw.githubusercontent.com/frappe/bench/refs/heads/develop/easy-install.py

      Reply

Leave a Comment