How to Install ERPNext with Nginx on Ubuntu Linux

|

,

|

ERPNext is an open-source ERP platform, supporting various sectors including manufacturing, distribution, retail, trading, services, education and non-profits. It encompasses human resources and accounting components for effective business management, used by thousands globally. This article provides detailed instructions for students and new users on ERPNext installation on Ubuntu 16.04 and 18.04 LTS, from installing prerequisites…

ERPNext is a simple and intuitive open-source ERP platform that supports manufacturing, distribution, retail, trading, services, education, non-profits, and other sectors. It also includes human resources and accounting components to help manage the business employees and finances.

ERPNext is probably the best open-source ERP management software to run your company. They are used by thousands of businesses worldwide to manage their ERP processes.

This open-source ERP software is built with open-source tools and offers features that help you run your business and collaborate with your customers and employees.

ERPNext is designed for ease of use to allow enterprises and business owners to collaborate and automate engaging experiences with customers throughout the entire process.

This brief tutorial will show students and new users how to install ERPNext on Ubuntu 16.04 and 18.04 LTS.

To install ERPNext, follow the steps below:

Install ERPNext Requirements

To install ERPNext, you’ll have to install some Python and other packages. as prerequisites. To get these packages installed on Ubuntu, please run the commands below:

sudo apt update
sudo apt install libffi-dev python-pip python-dev libssl-dev wkhtmltopdf curl git

Install Node Js and Redis

You’ll also need to install these two packages as well. Node js and Redis. To install them, run the commands below:

sudo curl --silent --location https://deb.nodesource.com/setup_8.x | sudo bash -
sudo apt-get install gcc g++ make
sudo apt-get install -y nodejs redis-server
sudo npm install -g yarn

Install Nginx / MariaDB

You’ll also need Nginx and a database server. MariaDB is an excellent open-source database you can use with this setup.

To install Nginx HTTP on the Ubuntu server, run the commands below…

sudo apt install nginx

After installing Nginx, the commands below can be used to stop, start, and enable the Nginx service to always start up with the server boots.

sudo systemctl stop nginx.service
sudo systemctl start nginx.service
sudo systemctl enable nginx.service

To install MariaDB, run the commands below.

sudo apt-get install mariadb-server mariadb-client

After installing MariaDB, the commands below can stop, start, and enable the service to start when the server boots.

Run these on Ubuntu 16.04 LTS

sudo systemctl stop mysql.service
sudo systemctl start mysql.service
sudo systemctl enable mysql.service

Run these on Ubuntu 18.04 and 18.10 LTS

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

After that, run the commands below to secure the MariaDB server by creating a root password and disallowing remote root access.

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.

  • Enter current password for root (enter for none): Press the Enter
  • Set root password? [Y/n]: Y
  • New password: Enter password
  • Re-enter new password: Repeat password
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]:  Y
  • Reload privilege tables now? [Y/n]:  Y

Next, open the MariaDB config file and make the highlighted changes below. Then, save the file.

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

On Ubuntu 16.04:

sudo nano /etc/mysql/my.cnf

Add the lines in the file and save.

# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

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
default-character-set = utf8mb4

Once MariaDB is installed and configured, run the commands below to create a new blank database for ERPNext.

To log on to the MariaDB database server, run the commands below.

sudo mysql -u root -p

Then, create a database called erpnext

CREATE DATABASE erpnext;

Create a database user called erpnextuser with a new password

CREATE USER 'erpnextuser'@'localhost' IDENTIFIED BY 'new_password_here';

Then, grant the user full access to the database.

GRANT ALL ON erpnext.* TO 'erpnextuser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;

Finally, save your changes and exit.

FLUSH PRIVILEGES;
EXIT;

Install / Configure ERPNext

At this time, your system is ready for ERPNext. First, create a new system user called erpnextuser. Then, create a password and add the user to the sudo group.

sudo useradd -m -s /bin/bash erpnextuser
sudo passwd erpnextuser
sudo usermod -aG sudo erpnextuser

After that, create a directory in /opt called erpnext.

sudo mkdir -p /opt/erpnext
sudo chown -R erpnextuser /opt/erpnext/

Then, change into the directory and install ERPNext.

su - erpnextuser
cd /opt/erpnext
git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo
bench init erpnext && cd erpnext

Finally, create a new site, for example, a domain.

bench new-site example.com
bench start

Accessing ERPNext Portal

Now that ERPNext and PostgreSQL are installed open your browser and browse to the server hostname or IP address followed by 8000

http://example.com:8000

You should then see the ERPNext setup page. Next, follow the wizard and install ERPNext.

After that, you’re all set!

Enjoy!

You may also like the post below:

Like this:



7 responses to “How to Install ERPNext with Nginx on Ubuntu Linux”

  1. Nikhil Avatar
    Nikhil

    Not worked on Ubuntu 18. Gave me error

  2. Bogus Avatar
    Bogus

    You wrote ::
    Step 3: Accessing ERPNext Portal

    Now that ERPNext and PostgreSQL are installed ……..

    Where as earlier you have installed Mariadb … May be just a typo…
    Please correct.

  3. @Momo Avatar
    @Momo

    Not worked, not included a lot of dependencies.

    npm install chalk
    npm install rollup
    npm install rollup-plugin-multi-entry
    npm install rollup-plugin-commonjs
    npm install rollup-plugin-node-resolve
    npm install rollup-plugin-postcss
    npm install rollup-plugin-buble
    npm install rollup-plugin-uglify
    npm install rollup-plugin-vue
    npm install vue-template-compiler

    And pip error in 16.04

  4. paolodema Avatar
    paolodema

    Missing actual app installation!
    the sequence is
    after
    bench new-site example.com
    do
    bench get-app erpnext https://github.com/frappe/erpnext
    bench –site example.com install-app erpnext
    and then
    bench start

  5. J.A.C.S.JAYAKODI Avatar
    J.A.C.S.JAYAKODI

    i want my shop use this software

  6. J.A.C.S.JAYAKODI Avatar
    J.A.C.S.JAYAKODI

    haw install erpnext software dextop mode

  7. Sanath Udayawansa Avatar
    Sanath Udayawansa

    I love to host erp next on contabo. Would you help me on this?

Leave a Reply to @Momo Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.