Flectra is a open source ERP and CRM software. In this article, you will learn how to install Flectra ERP on CentOS / RHEL 8.
Table of Contents:
- What is Flectra?
- Environment Specification
- Update Existing Software Packages in CentOS / RHEL 8
- Installing PostgreSQL Server on CentOS / RHEL 8
- Installing WKHTMLTOPDF on CentOS / RHEL 8
- Installing Python on CentOS / RHEL 8
- Installing Flectra Prerequisite Software Packages
- Installing Flectra ERP on CentOS / RHEL 8
- Create a Systemd Service for Flectra ERP
- Configure Linux Firewall for Flectra ERP
- Accessing Flectra ERP Web UI
- Conclusion
What is Flectra? :
Flectra is the Open Source ERP and CRM system for your Business. It is the next generation business information system helps you grow your business, with powerful modular design covering all essential aspects of a business.
Flectra is a suite of web based open source business apps forked from Odoo. The main Flectra Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management and many more.
Flectra is built using Python programming language and PostgreSQL database.
Environment Specification:
We are using a minimally installed CentOS 8 virtual machine with following specifications.
- CPU - 3.4 Ghz (2 cores)
- Memory - 2 GB
- Storage - 20 GB
- Operating System – CentOS Linux 8.2
- Hostname – flectra-01.centlinux.com
- IP Address - 192.168.116.231 /24
Update Existing Software Packages in CentOS / RHEL 8:
By using a SSH client, log on to flectra-01.centlinux.com virtual machine as root user.
It is a best practice to update existing software packages on your Linux operating system, especially before installing a new software.
Execute the dnf command to update existing software packages.
# dnf update -y
Last metadata expiration check: 0:22:15 ago on Mon 12 Oct 2020 09:30:17 PM PKT.
Dependencies resolved.
Nothing to do.
Complete!
Since, we frequently update our Linux server, therefore, there isn't any update available right now. The output may vary on your operating system.
Verify the Linux Kernel version that is being used in this installation guide.
# uname -r
4.18.0-193.19.1.el8_2.x86_64
Verify the Linux operating system version that is being used in this installation guide.
# cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
Installing PostgreSQL Server on CentOS / RHEL 8:
Flectra requires a PostgreSQL database as its data repository. Therefore, We are installing PostgreSQL and relevant software packages by using dnf command.
# dnf install -y postgresql-server libpq-devel
Start and Initialize PostgreSQL server instance by using following Linux command.
# postgresql-setup --initdb --unit postgresql
* Initializing database in '/var/lib/pgsql/data'
* Initialized, logs are in /var/lib/pgsql/initdb_postgresql.log
Enable and start PostgreSQL service as follows.
# systemctl enable --now postgresql.service
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service â /usr/lib/systemd/system/postgresql.service.
Our PostgreSQL Server is ready to use now. Create a database user for Flectra ERP.
# su - postgres -c "createuser -s flectra"
By keeping the scope of this document limited, we are installing the available version of PostgreSQL from default yum repository. You can refer to our previous post to install latest version of PostgreSQL server on CentOS 8.
Installing WKHTMLTOPDF on CentOS / RHEL 8:
Flectra ERP requires WKHTMLTOPDF software to generate reports in PDF format.
WKHTMLTOPDF software is not available in default yum repositories, But we can download WKHTMLTOPDF from their official website.
You can obtain the URL of WKHTMLTOPDF package from above link and then use wget command to download it directly in your Linux server.
# cd /tmp # wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.x86_64.rpm --2020-10-12 22:17:09-- ... HTTP request sent, awaiting response... 200 OK Length: 16237416 (15M) [application/octet-stream] Saving to: âwkhtmltox-0.12.6-1.centos8.x86_64.rpmâ wkhtmltox-0.12.6-1. 100%[===================>] 15.48M 66.0KB/s in 6m 20s 2020-10-12 22:23:34 (41.7 KB/s) - âwkhtmltox-0.12.6-1.centos8.x86_64.rpmâ saved [16237416/16237416]
Install WKHTMLTOPDF package by using below mentioned Linux command.
# dnf localinstall -y wkhtmltox-0.12.6-1.centos8.x86_64.rpm
WKHTMLTOPDF and dependent packages has been installed on your Linux operating system.
Installing Python on CentOS / RHEL 8:
Flectra ERP is built using Python programming language, therefore, you need Python runtimes to deploy Flectra application.
Python 3 is available in default yum repository, therefore we are installing it by using dnf command.
# dnf install -y python3 python3-devel
Installing Flectra Prerequisite Software Packages:
Flectra ERP has a handful of dependent software packages. We are installing all of these software packages using a single Linux command.
# dnf install -y git gcc wget nodejs libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel -y
Flectra ERP web requires 'less' JavaScript to properly render the style of the web pages. Therefore, we are installing it by using npm (Node Package Manager) command.
# npm install -g less
/usr/local/bin/lessc -> /usr/local/lib/node_modules/less/bin/lessc
+ less@3.12.2
added 12 packages from 45 contributors in 23.106s
Installing Flectra ERP on CentOS / RHEL 8:
Create a Linux user to own Flectra software and processes.
# useradd -r -m -U -d /opt/flectra -s /bin/bash flectra
Switch to flectra user.
# su - flectra
Last login: Wed Oct 14 23:35:55 PKT 2020 on pts/0
By using git command, create a clone of Flectra source code.
$ git clone --depth=1 --branch=1.0 https://gitlab.com/flectra-hq/flectra.git flectra
Cloning into 'flectra'...
remote: Enumerating objects: 26592, done.
remote: Counting objects: 100% (26592/26592), done.
remote: Compressing objects: 100% (18881/18881), done.
remote: Total 26592 (delta 8354), reused 23223 (delta 6860), pack-reused 0
Receiving objects: 100% (26592/26592), 146.00 MiB | 75.00 KiB/s, done.
Resolving deltas: 100% (8354/8354), done.
Checking out files: 100% (24066/24066), done.
Create a Python virtual environment for deploying Flectra ERP.
$ python3 -m venv flectra01
Activate the Python virtual environment.
$ source flectra01/bin/activate
(flectra01) $
Upgrade the version of pip package by using following Linux command.
(flectra01) $ pip install --upgrade pip
100% |ââââââââââââââââââââââââââââââââ| 1.5MB 326kB/s
Installing collected packages: pipâââââââ
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:ââââââââââ
Successfully uninstalled pip-9.0.3
Successfully installed pip-20.2.4â
Flectra ERP requires various Python modules to function properly. The source contains a complete list of required modules, therefore, we can use this file to install all the required modules in one go.
(flectra01) $ pip3 install -r flectra/requirements.txt
...
Successfully installed Babel-2.3.4 Jinja2-2.10.1 Mako-1.0.4 MarkupSafe-0.23 Pillow-4.0.0 PyYAML-3.12 Werkzeug-0.11.15 XlsxWriter-0.9.3 argparse-1.4.0 beautifulsoup4-4.9.3 certifi-2020.6.20 chardet-3.0.4 decorator-4.0.10 docutils-0.12 ebaysdk-2.1.5 feedparser-5.2.1 gevent-1.1.2 greenlet-0.4.10 html2text-2016.9.19 idna-2.7 linecache2-1.0.0 lxml-3.7.1 mock-2.0.0 num2words-0.5.6 numpy-1.14.3 oauthlib-2.0.7 ofxparse-0.16 olefile-0.46 passlib-1.6.5 pbr-5.5.0 psutil-4.3.1 psycopg2-2.8.5 pycrypto-2.6.1 pydot-1.2.3 pyldap-2.4.28 pyparsing-2.1.10 pyserial-3.1.1 python-dateutil-2.5.3 python-stdnum-1.14 pytz-2016.7 pyusb-1.0.0 qrcode-5.3 reportlab-3.3.0 requests-2.20.0 six-1.15.0 soupsieve-2.0.1 suds-jurko-0.6 traceback2-1.4.0 unittest2-1.1.0 urllib3-1.24.3 validate-email-1.3 vatnumber-1.2 vobject-0.9.3 xlrd-1.0.0 xlwt-1.3.0
Deactivate the Python virtual environment.
(flectra01) $ deactivate
Exit from flectra user shell.
$ exit
logout
Create directories for Flectra configuration, executables and log files.
# mkdir /opt/flectra/addons # mkdir /var/log/flectra # mkdir /etc/flectra # touch /var/log/flectra/flectra.log
Change the owner of the newly created directories to flectra user.
# chown -R flectra:flectra /opt/flectra/addons # chown -R flectra:flectra /var/log/flectra # chown -R flectra:flectra /etc/flectra
Edit Flectra configuration file.
# vi /etc/flectra/flectra.conf
Add following configurations in this file.
[options] admin_passwd = Ahmer@1234 db_host = False db_port = False db_user = flectra db_password = False logfile = /var/log/flectra/flectra.log logrotate = True proxy_mode = True addons_path = /opt/flectra/flectra/addons, /opt/flectra/addons
Create a Systemd Service for Flectra ERP:
To enable autostart of ERP at Linux startup, we need to create a Systemd service for Flectra ERP.
Use vim editor to create a service unit file.
# vi /etc/systemd/system/flectra.service
Add following directives in this file.
[Unit] Description=flectra [Service] Type=simple SyslogIdentifier=flectra PermissionsStartOnly=true User=flectra Group=flectra ExecStart=/opt/flectra/flectra01/bin/python3 /opt/flectra/flectra/flectra-bin -c /etc/flectra/flectra.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
Notify the Systemd about the changes in service file by using following systemctl command.
# systemctl daemon-reload
Enable and start Flectra service.
# systemctl enable --now flectra
Created symlink /etc/systemd/system/multi-user.target.wants/flectra.service â /etc/systemd/system/flectra.service.
Configure Linux Firewall for Flectra ERP:
To verify, is Flectra service running on default port 7073? execute the following Linux command.
# ss -tulpn | grep 7073
tcp LISTEN 0 128 0.0.0.0:7073 0.0.0.0:* users:(("python3",pid=19844,fd=5))
Allow Flectra service port in Linux firewall, to make the ERP accessible across the network.
# firewall-cmd --permanent --add-port=7073/tcp success # firewall-cmd --reload success
Accessing Flectra ERP Web UI:
Open URL http://flectra-01.centlinux.com:7073 in a web browser.
Fill out the form and click on "Create Database". The master password is one that we have set in the /etc/flectra/flectra.conf file.
You have reached at the Dashboard of the Flectra ERP. You can now customize the business suite according to your business requirement and start using it to manage different aspects of your business.
Conclusion:
We have successfully installed Flectra ERP on CentOS / RHEL 8 server. Read The Linux Command Line, 2nd Edition: A Complete Introduction by William Shotts, if you have difficulty in understanding this installation guide.