GithubHelp home page GithubHelp logo

erpnext-installation-guide's Introduction

ERPNext-installation-Guide

The complete guide to install ERPNext in your Ubuntu system

Pre-requisites

  Python 3.6+
  Node.js 14+
  Redis 5                                       (caching and real time updates)
  MariaDB 10.3.x / Postgres 9.5.x               (to run database driven apps)
  yarn 1.12+                                    (js dependency manager)
  pip 20+                                       (py dependency manager)
  wkhtmltopdf (version 0.12.5 with patched qt)  (for pdf generation)
  cron                                          (bench's scheduled jobs: automated certificate renewal, scheduled backups)
  NGINX                                         (proxying multitenant sites in production)

STEP 1 Install git

Git is the most commonly used version control system. Git tracks the changes you make to files, so you have a record of what has been done, and you can revert to specific versions should you ever need to. Git also makes collaboration easier, allowing changes by multiple people to all be merged into one source.

sudo apt-get install git

STEP 2 install python-dev

python-dev is the package that contains the header files for the Python C API, which is used by lxml because it includes Python C extensions for high performance.

sudo apt-get install python3-dev

STEP 3 Install setuptools and pip (Python's Package Manager).

Setuptools is a collection of enhancements to the Python distutils that allow developers to more easily build and distribute Python packages, especially ones that have dependencies on other packages. Packages built and distributed using setuptools look to the user like ordinary Python packages based on the distutils.

pip is a package manager for Python. It's a tool that allows you to install and manage additional libraries and dependencies that are not distributed as part of the standard library.

sudo apt-get install python3-setuptools python3-pip

STEP 4 Install virtualenv

virtualenv is a tool for creating isolated Python environments containing their own copy of python , pip , and their own place to keep libraries installed from PyPI. It's designed to allow you to work on multiple projects with different dependencies at the same time on the same machine.

sudo apt-get install virtualenv

CHECK PYTHON VERSION

python3 -V

IF VERSION IS 3.8.X RUN

sudo apt install python3.8-venv

IF VERSION IS 3.10.X RUN

 sudo apt install python3.10-venv

STEP 5 Install MariaDB 10.3 stable package

MariaDB is developed as open source software and as a relational database it provides an SQL interface for accessing data.

open this link

https://downloads.mariadb.org/mariadb/repositories/#mirror=piconets

For ubuntu 20.04

sudo apt-get install software-properties-common
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] https://ftp.icm.edu.pl/pub/unix/database/mariadb/repo/10.3/ubuntu focal main'
sudo apt update
sudo apt install mariadb-server

For ubuntu 18.04

sudo apt-get install software-properties-common dirmngr apt-transport-https
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] https://mirrors.aliyun.com/mariadb/repo/10.3/ubuntu bionic main'
sudo apt update
sudo apt install mariadb-server

IMPORTANT :During this installation you'll be prompted to set the MySQL root password. If you are not prompted for the same You can initialize the MySQL server setup by executing the following command

sudo mysql_secure_installation

STEP 6 MySQL database development files

sudo apt-get install libmysqlclient-dev

STEP 7 Edit the mariadb configuration ( unicode character encoding )

sudo nano /etc/mysql/my.cnf

add this to the my.cnf file

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

Now press (Ctrl-X) to exit

sudo service mysql restart

STEP 8 install Redis

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker.

sudo apt-get install redis-server

STEP 9 install Node.js 14.X package

Node.js is an open source, cross-platform runtime environment for developing server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux.

sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

STEP 10 install Yarn

Yarn is a JavaScript package manager that aims to be speedy, deterministic, and secure. See how easy it is to drop yarn in where you were using npm before, and get faster, more reliable installs. Yarn is a package manager for JavaScript.

sudo npm install -g yarn

STEP 11 install wkhtmltopdf

Wkhtmltopdf is an open source simple and much effective command-line shell utility that enables user to convert any given HTML (Web Page) to PDF document or an image (jpg, png, etc)

sudo apt-get install xvfb libfontconfig wkhtmltopdf

if you have to setup production server go to Step 16 else continue

STEP 12 install frappe-bench

sudo -H pip3 install frappe-bench

IMPORTANT: you may wish to log out and log back into your terminal before next step and You must login.

bench --version

STEP 13 initilise the frappe bench & install frappe latest version

bench init frappe-bench --frappe-branch version-13

cd frappe-bench/
bench start

STEP 14 create a site in frappe bench

bench new-site dcode.com

STEP 15 install ERPNext latest version in bench & site

bench get-app erpnext --branch version-13
###OR
bench get-app https://github.com/frappe/erpnext --branch version-13

bench --site dcode.com install-app erpnext

bench start

Optional step for cratetind production setup

STEP 16 Create a new user

sudo adduser dcode-frappe
sudo usermod -aG sudo dcode-frappe
su - dcode-frappe

Follow the steps from Step 12 to Step 15

Step 17 setup production

sudo bench setup production dcode-frappe
bench restart

Open the 0.0.0.0 or server IP in web browser and login to production server

Port cofiguration for multiple site

  bench use sitename



Switch off DNS based multitenancy (once)

  bench config dns_multitenant off

Create a new site

  bench new-site site2name

Set port

   bench set-nginx-port site2name 82

Re generate nginx config

   bench setup nginx

Reload nginx

  sudo service nginx reload
  

Reload supervisor
  sudo service supervisor restart

others

  sudo add-apt-repository ppa:certbot/certbot
  sudo apt update
  sudo apt install python-certbot-nginx
  sudo certbot --nginx -d example.com
  
  ./env/bin/python -m pip install -q -U -e /apps/frappe

If you installed with --production option and you want to stop production services, and start in develop mode

  sudo service supervisor stop
  sudo service redis stop
  sudo service nginx stop

To start in develop mode, you need to have Procfile in the frappe-bench directory.

  bench setup procfile

To start develop server:

  bench start

To restart the production mode agin

  sudo service supervisor start
  sudo service redis start
  sudo service nginx start

To check on the status of services - mainly whether they are active or not

  sudo service supervisor status
  sudo service redis status
  sudo service nginx status

erpnext-installation-guide's People

Contributors

d-code-hub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

erpnext-installation-guide's Issues

Getting 'module not found' error

After following every step till step 17, I open the server's ip address and get the following error,
ModuleNotFoundError : No module named 'erpnext'
Tried erasing and installing erpnext using this guide, over 3 times.... Still no luck...

system does not start by itself

Installation of the tutorial generates a GUI environment. Erpnext is not started for some reason (is this because of the VUE.js missing?). The GUI has no terminal so I changed

sudo apt-get install xvfb libfontconfig wkhtmltopdf

to

sudo apt-get install gnome-terminal xvfb libfontconfig wkhtmltopd

Work around: 1. set authentication and login in the GUI for your user to auto (right top of the screen>settings>user, 2. write simple bash script to start erpnext 3. add the script to startup application preferences in the gui

Mariadb tweaks

I believe that easy install script does some tweaks in the mariadb settings for performance improvements. Do you consider it also?

PS: Great script by the way.

Installation Always painful

Nodejs v14 is deprecated, causing the script to take exceedingly long to run. Once it does run, you learn that Ubuntu 20.04 no longer has a release file.

I had previously evaluated ERPNext for commercial use, these type of issues are why I opted against it. Please refresh your install processes.

Error when run : sudo apt-get install python3-dev

There is an error when run this command :
sudo apt-get install python3-dev

Error.txtor :

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libc-dev-bin libc6-dev libcrypt-dev libexpat1-dev libpython3-dev
libpython3.8-dev linux-libc-dev manpages-dev python3.8-dev zlib1g-dev
Suggested packages:
glibc-doc
The following NEW packages will be installed:
libc-dev-bin libc6-dev libcrypt-dev libexpat1-dev libpython3-dev
libpython3.8-dev linux-libc-dev manpages-dev python3-dev python3.8-dev
zlib1g-dev
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.8 MB of archives.
After this operation, 52.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libc-dev-bin amd64 2.31-0ubuntu9.2 [71.8 kB]
Ign:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 linux-libc-dev amd64 5.4.0-91.102
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libcrypt-dev amd64 1:4.4.10-10ubuntu4 [104 kB]
Get:4 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6-dev amd64 2.31-0ubuntu9.2 [2520 kB]
Get:5 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libexpat1-dev amd64 2.2.9-1build1 [116 kB]
Ign:6 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libpython3.8-dev amd64 3.8.10-0ubuntu120.04.1
Err:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 linux-libc-dev amd64 5.4.0-91.102
404 Not Found [IP: 52.15.155.232 80]
Get:7 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libpython3-dev amd64 3.8.2-0ubuntu2 [7236 B]
Get:8 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 manpages-dev all 5.05-1 [2266 kB]
Err:6 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libpython3.8-dev amd64 3.8.10-0ubuntu1
20.04.1
404 Not Found [IP: 52.15.155.232 80]
Get:9 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 zlib1g-dev amd64 1:1.2.11.dfsg-2ubuntu1.2 [155 kB]
Ign:10 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3.8-dev amd64 3.8.10-0ubuntu120.04.1
Get:11 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 python3-dev amd64 3.8.2-0ubuntu2 [1212 B]
**Error.txt:**10 http://security.ubuntu.com/ubuntu focal-updates/main amd64 python3.8-dev amd64 3.8.10-0ubuntu1
20.04.1
404 Not Found [IP: 52.15.155.232 80]
Fetched 5241 kB in 0s (28.2 MB/s)
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_5.4.0-91.102_amd64.deb 404 Not Found [IP: 52.15.155.232 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/python3.8/libpython3.8-dev_3.8.10-0ubuntu1~20.04.1_amd64.deb 404 Not Found [IP: 52.15.155.232 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/python3.8/python3.8-dev_3.8.10-0ubuntu1~20.04.1_amd64.deb 404 Not Found [IP: 52.15.155.232 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

cannot find vue.js on update

UNRESOLVED_IMPORT : 'vue/dist/vue.js' is imported by ../erpnext/erpnext/public/js/hub/marketplace.js,

tried npm install vue followed by bench update --reset but no improvement

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.