Home / How To / How to install ERPNext on Ubuntu 18.04 LTS

How to install ERPNext on Ubuntu 18.04 LTS



ERPNext is a free, open source, modern and easy to use enterprise management software that is used by thousands of companies worldwide. It is a very simple ERP platform that supports retail, trade, services, manufacturing, human resources, nonprofits and other sectors. It is a powerful and complete ERP system written in Python above the Frappe framework. It uses Node.js for frontend and MariaDB to store its data. ERPNext provides a web-based interface for performing daily tasks. ERPNext provides an embedded reporting system with office suite integration.

In this tutorial, we will teach you how to install and configure ERPNext on Ubuntu 18.04 LTS server.

Requirements

  • A server running Ubuntu 1
    8.04. non-root users with sudo privileges set on your server.

Getting Started

First you need to update your system with the latest version. You can do this by running the following command:

  sudo apt-get update -y 
sudo apt-get upgrade -y

Once your system is updated, you must create a user for ERPNext. [19659002] You can do this with the following command:

  sudo useradd -m -s / bin / bash erpnext 
sudo passwd erpnext

Grant sudo privileges to ERPNext users with the following command:

  sudo usermod -aG sudo erpnext 

Next, log in to ERPNext user and installation environment variable with the following command:

  su - erpnext 
  nano .bashrc 

Add the following line:

  PATH = $ PATH: ~ / .local / bin /

Save and close the file when you are done. Then restart the system to apply all changes.

Install Mandatory Packages

First, log in to your system with the erpnext user and install some dependencies required by ERPNext for your system.

  sudo apt-get install libffi -dev python-pip python-dev libssl-dev wkhtmltopdf -y 

Then install Nginx and MariaDB server with the following command:

  sudo apt-get install nginx mariadb server - y 

After the installation is completed, you must make some changes to the 50-server.cnf file. You can do this with the following command:

  sudo nano /etc/mysql/mariadb.conf.d/50-server.cnfebrit19659009vard Make the following changes: 

  [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

Save and close the file. Then restart the MariaDB service to apply all changes:

  sudo systemctl restart mariadb 

You can now check the status of the MariaDB server with the following command:

  sudo systemctl status mariadb 

You should see the following output :

? mariadb.service - MariaDB 10.1.38 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor setting: enabled)
Active: active (running) since Sat 2019-02-16 06:26:48 UTC; 2h 38min ago
Document: man: mysqld (8)
https://mariadb.com/kb/en/library/systemd/
Process: 4640 ExecStartPost = / bin / sh -c systemctl unset environment _WSREP_START_POSITION (code = terminated, status = 0 / SUCCESS)
Process: 4636 ExecStartPost = / etc / mysql / debian-start (code = terminated, status = 0 / SUCCESS)
Process: 4505 ExecStartPre = / bin / sh -c [ ! -e /usr/bin/galera_recovery ] && VAR = || VAR = & # 39; / usr / bin / galera_recovery`; [ $? -eq 0 ] && systemctl set-
Process: 4503 ExecStartPre = / bin / sh -c systemctl unset environment _WSREP_START_POSITION (code = terminated, status = 0 / SUCCESS)
Process: 4482 ExecStartPre = / usr / bin / install -m755 -o mysql -g root -d / var / run / mysqld (code = terminated, status = 0 / SUCCESS)
Main PID: 4607 (mysqld)
Status: "Taking Your SQL Requests Now ..."
Details: 31 (limit: 1111)
CGroup: /system.slice/mariadb.service
?? 4607 / usr / sbin / mysqld

16 Aug 06:26:47 ubuntu1804 systemd [1]: Start MariaDB 10.1.38 database server ...
Aug 16 06:26:48 ubuntu1804 mysqld [4607]: 2019-02-16 6:26:48 140715015396480 [Note] / usr / sbin / mysqld (mysqld 10.1.38-MariaDB-0ubuntu0.18.04.1) starts
Aug 16 06:26:48 ubuntu1804 systemd [1]: Started MariaDB 10.1.38 database server.
Aug 16 06:26:48 ubuntu1804 / etc / mysql / debian-start [4642]: Upgrade MySQL tables if needed.
Aug 16 06:26:48 ubuntu1804 / etc / mysql / debian-start [4659]: / usr / bin / mysql_upgrade: & # 39; - basedir & # 39; always ignored
Aug 16 06:26:48 ubuntu1804 / etc / mysql / debian-start [4659]: Looking for "mysql" like: / usr / bin / mysql
Aug 16 06:26:48 ubuntu1804 / etc / mysql / debian-start [4659]: Looking for "mysqlcheck" as: / usr / bin / mysqlcheck
August 16 06:26:48 ubuntu1804 / etc / mysql / debian-start [4659]: This MySQL installation is already upgraded to 10.1.38-MariaDB, use - force if you still n
August 16 06:26:48 ubuntu1804 / etc / mysql / debian-start [4677]: Check for unsafe root accounts.
Aug 16 06:26:48 ubuntu1804 / etc / mysql / debian-start [4681]: Enable myisam restore for all MyISAM tables and aria recovery for all Aria tables

Installing Redis and Node.js

Then you need to install Redis and Node.js in your system. You can install them by running the following command:

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

Configure MariaDB

As By default, MariaDB installation is not secured, so you must secure it first. You can secure it with the following command:

  sudo mysql_secure_installation 

Answer all questions listed below:

  Enter the current root password (specify for none):
Setting root password? [Y/n]: N
Delete anonymous users? [Y/n]: Y
Remove root login remotely? [Y/n]: Y
Delete the test database and access it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y

When MariaDB is secured, log in to the MariaDB shell with the following command:

  sudo mysql -u root -p 

Enter your root password when prompted. Then create a database and user for ERPNext with the following command:

  MariaDB [(none)]> create database erpnextdb; 
MariaDB [(none)]> create user [email protected] identified with "password";

Next, grant all privileges to ERPNext with the following command:

  MariaDB [(none)]> GIVE ALL ON erpnextdb. * ON & # 39; erpnextuser & # 39; @ & # 39; localhost & # 39; IDENTIFIED OF & # 39; password & # 39; WITH GRANT OPTION; 
MariaDB [(none)]> GRANT all privileges on *. * Till & # 39; root & # 39; @ & # 39; localhost & # 39; IDENTIFIED BY & # 39; [email protected] & # 39; WITH GRANT OPTION;

Then flush the privileges and exit the MariaDB shell with the following command:

  MariaDB [(none)]> FLUSH PRIVILEGES; 
MariaDB [(none)]> EXIT;

Installing ERPNext

First create a directory for ERPNext and give the correct permissions with the following command:

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

Then change the directory to erpnext and install erpnext with the following command:

  cd / opt / erpnext 
  git clone https://github.com/frappe/bench bench-repo 

Output:

  Cloning to & # 39; bench-repo & # 39; ...
remote control: List items: 19, ready.
remote control: Count items: 100% (19/19), done.
remote control: Compression of objects: 100% (14/14), done.
remote control: Total 6144 (delta 10), recycled 13 (delta 5), ​​reused 6125
Receiving items: 100% (6144/6144), 29.70 MiB | 231.00 KiB / s, clear.
Loose deltas: 100% (3924/3924), done.

Then install bench with pip command:

  sudo pip install -e bench repo 

Then you initiate the bench directory with frappe framework:

  bench init erpnext 

Output:

  Building frappe assets ...

? Built js / print_format_v3.min.js
? Built js / dialog.min.js
? Built js / web_form.min.js
? Built js / social.min.js
? Built js / modules.min.js
? Built js / form.min.js
? Built js / list.min.js
? Built js / frappe-vue.min.js
? Built js / chat.js
? Built js / desk.min.js
? Built js / control.min.js
? Built css / frappe-rtl.css
? Built css / module.min.css
? Built css / report.min.css
? Built css / form.min.css
? Built css / list.min.css
? Built frappe / css / email.css
? Built css / web_form.css
? Built css / frappe-web.css
? Built css / desk.min.css
? Built js / frappe-web.min.js
? Built js / report.min.js
? Issued 31,313s
Done at 34.43 s.
INFO: bench.utils: set backups
no crontab for erpnext
INFO: bench.utils: set automatic update
no crontab for erpnext
The bench is erect

Then change the directory to erpnext and create a new site for the domain node1.example.com with the following command:

  bench new-site node1.example.com 

You will be prompted to enter your MySQL root password shown below:

   MySQL root password: 

Enter your root password and press Enter. You should see the following output:

  Installing frappe ...
Updating DocTypes for frappe: [========================================]
Updating country info: [========================================]
Set administrator password:
Re-enter the administrator password:
*** Schedules are disabled ***

Then provide authorized permissions for erpnext with the following command:

  sudo chown -R erpnext: erpnext / opt / erpnext / erpnext 

Finally, start the server with the following command:

  bench start 

see the following output:

  06:34:02 web.1 | * Run at http://0.0.0.0:8000/ (Press CTRL + C to exit)
06:34:02 web.1 | * Restart with inotify reloader
06:34:03 watch.1 | yarn run v1.13.0
06:34:03 watch.1 | $ node collection / watch.js
06:34:03 web.1 | * Debugger is active!
06:34:04 web.1 | * Debugger PIN: 159-307-235
06:34:13 watch.1 |
06:34:13 watch.1 | Collecting Watcher began
06:34:13 watch.1 |
06:34:13 watch.1 | Watching...
06:34:15 watch.1 | Rebuild frappe-web.css

Access ERPNext

ERPNext is now installed and listening on port 8000. Open your browser and type the URL http: //node1.example.come: 8000. You will be redirected to the following page:

 ERPNested login

Now enter the username as administrator and the password you entered during installation. Then click Sign in the button. You should see the following page:

 Select language

Next, select your language and click the Next button. You should see the following page:

 Set company name

Next, select your country and click the Next button. You should see the following page:

 Add a first user

Then enter your full name and email address. Then click the Complete Setup button. You should see the following page:

 ERPNext Dashboard

Congratulations! you have installed and configured ERPNext on Ubuntu 18.04 server. You can now easily configure ERPNext in a production environment.


Source link