Home / How To / How to install Odoo ERP 13 on CentOS 8

How to install Odoo ERP 13 on CentOS 8



Odoo is a free, open source and most popular ERP software that offers a wide range of business applications including, customer relationship management (CRM), sales pipeline, project management, manufacturing, invoicing, accounting, e-commerce and many more. It is a web-based and fully-equipped application that helps you maintain ERP in any business. Odoo comes with 30 core modules and more than 4,500 community-created modules that help you customize it as a small store for a company-level business.

In this tutorial we will teach you how to install and configure Odoo 13 with Nginx as a reverse proxy on server CentOS 8.

Requirements

  • A server running CentOS 8 with at least 2 GB of RAM.
  • A valid domain name pointed to your server IP. In this tutorial we will use the exmaple.com domain.
  • A root password is configured on the server.

Getting Started

First update the system and install the EPEL archive with the following command:

  dnf update 
dnf install epel release

Then you need to install some tools and dependencies required to build Odoo on your system.

You can install them all with the following command:

  dnf install python36 python36-devel git gcc wget nodejs libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel 

When all packages are installed you can proceed to the next step.

Creating Odoo users

1

9659008] Then you must create a new system user named odoo and home directory / opt / odoo with the following command:

  useradd -m -U -r -d / opt / odoo -s / bin / bash odoo 

When you are finished, you can proceed to the next step.

Installing and configuring PostgreSQL

Odoo uses P ostgreSQL to store its data. So you need to install PostgreSQL on your server. You can install it with the following command:

  dnf install postgresql postgresql server postgresql-contrib 

After the installation is installed, the database is initialized with the following command:

  / usr / bin / postgresql-setup initdb 

You should have the following output:

   * Initiate the database in & # 39; / var / lib / pgsql / data & # 39;
* Initiated, logs can be found in /var/lib/pgsql/initdb_postgresql.log

Then the PostgreSQL service starts and enables it to start after system startup with the following command:

  systemctl start postgresql 
systemctl enable postgresql

You can now verify PostgreSQL with the following command: [19659009] systemctl status postgresq 19659010] You should see the following output:

? postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor setting: disabled)
Active: active (running) since Mon 2019-12-02 01:01:44 EST; 6s ago
Process: 31805 ExecStartPre = / usr / libexec / postgresql-check-db-dir postgresql (code = terminated, status = 0 / SUCCESS)
Head PID: 31808 (postmaster)
Details: 8 (limit: 12552)
Memory: 16.5M
CGroup: /system.slice/postgresql.service
?? 31808 / usr / bin / postmaster -D / var / lib / pgsql / data
?? 31809 postgres: logger process
?? 31811 postgres: checkpointer process
?? 31812 postgres: authoring process
?? 31813 postgres: wal author process
?? 31814 postgres: autovacuum launcher process
?? 31815 postgres: statistics collection process
?? 31816 postgres: bgworker: logical replication starter

Then you must create a new PostgreSQL user with the same name as system users as shown below:

  su - postgres -c "createuser -s odoo" 

Install Wkhtmltopdf

Next, you must install wkhtmltopdf- tool in your system so that Odoo can print PDF reports. You can install it with the following command:

  wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpmebrit19459014l8dnf localinstall wkhtmltox-0.12.5-1. centos7.x86_64.rpm 

Once installed, you can proceed to the next step.

Installing and Configuring Odoo 13

First switch to the Odoo user with the following command:

  su - odoo 

Then download the latest version of Odoo 13 from the Git repository using the git command: [19659009] gitklon https://www.github.com/odoo/odoo – section 1 – branch 13.0 / opt / odoo / odoo13

Then create a new virtual environment for the Odoo 13 instance with the following command:

  cd / opt / odoo 
python3 -m venv odoo13-venv

Next, enable the virtual environment with the following command:

  source odoo13-venv / bin / enable 

You should get the following output:

 (odoo13 venv) [[email protected] ~] $

Then install all Python modules required for Odoo 13 with the following command:

  pip3 install -r odoo13 / requirements.txt 

Once all necessary modules are installed, disable the virtual environment with the following command: [19659009] disable

Finally exit from the Odoo user with the following command:

  exit 

Then create a new directory to store Odoo custom modules and Odoo logs:

  mkdir / opt / odoo / odoo13- custom-addons 
mkdir / var / log / odoo13
touch /var/log/odoo13/odoo.log Greece 19659010 ?? Next, change the ownership of both directory to the odoo user with the following command:

  chown -R odoo: odoo / opt / odoo / odoo13-custom-addons 
chown -R odoo: odoo / var / log / odoo13 /

Then create a new configuration file for Odoo 13 with the following command:

  nano / etc /odoo.confebrit19659010??Add the following lines: 

 [options]
admin_passwd = [email protected]
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
logfile = /var/log/odoo13/odoo.log
logrotate = True
addons_path = / opt / odoo / odoo13 / addons, / opt / odoo / odoo13-custom-addons

Save and close the file when you are done.

Creating a Systemd Service File for Odoo 13

Next, you must create a new Systemd device file for Odoo 13 to manage the Odoo service. [19659002] You can create it with the following command:

  nano /etc/systemd/system/odoo13.service tu 1919919010 Add the following lines: 

 [Unit]
Description = Odoo13
# Requires = postgresql-10.6.service
# After = network.target postgresql-10.6.service

[Service]
Type = simple
SyslogIdentifier = odoo13
PermissionsStartOnly = true
User = Odöö
The group = Odöö
ExecStart = / opt / odoo / odoo13-venv / bin / python3 / opt / odoo / odoo13 / odoo-bin -c /etc/odoo.conf
DefaultOutput = journal + console

[Install]
WantedBy = multi-user.target

Save and close the file. Then reload the system daemon with the following command:

  systemctl daemon-reload 

Then start the Odoo service and activate it after system startup with the following command:

  systemctl start odoo13 
systemctl enable odoo13

also verify Odoo status with the following command:

  systemctl status odoo13 

You should get the following output:

? odoo13.service - Odoo13
Loaded: loaded (/etc/systemd/system/odoo13.service; disabled; vendor setting: disabled)
Active: active (running) since Mon 2019-12-02 01:15:43 EST; 2s ago
Main PID: 17022 (python3)
Details: 4 (limit: 12552)
Memory: 63.7M
CGroup: /system.slice/odoo13.service
?? 17022 / opt / odoo / odoo13-venv / bin / python3 / opt / odoo / odoo13 / odoo-bin -c /etc/odoo.conf

02 dec. 01:15:43 centos8 systemd [1]: Started Odoo13.

By default, Odoo listens to port 8069. You can check it with the following command:

  netstat -plntu | grep 8069 

You should see the following output:

 tcp 0 0 0.0.0.0:8069 0.0.0.0:* LISTEN 17022 / python3

Configure Nginx as a reverse proxy for Odoo 13

Then you must install and configure Nginx as a reverse proxy for the Odoo 13 instance.

Install Nginx Web Server with the following command:

  dnf install nginx 

After installing a new virtual host configuration file with the following command:]] upstream odoo {
server 127.0.0.1:8069;
}
server {
listen 80;
server name example.com;

access_log /var/log/nginx/odoo13.access.log;
error_log /var/log/nginx/odoo13.error.log;

location / {
proxy_set_header X-Forwarded-Host $ host;
proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $ scheme;
proxy_set_header X-Real-IP $ remote_addr;

proxy_redirect av;
proxy_pass http: // odoo;
}

location ~ * / web / static / {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http: // odoo;
}

gzip_typer text / css text / minor text / plain text / xml application / xml application / json application / javascript;
gzip på;
}

Save and close the file when you are done. Then start the Nginx service and enable it after system startup with the following command:

  systemctl start nginx 
systemctl enable nginx

You can verify the status of the Nginx service with the following command: [19659009] systemctl status nginx

You should see the following output:

? nginx.service - Nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor setting: disabled)
Active: active (running) since Mon 2019-12-02 01:25:15 EST; 6s ago
Process: 17244 ExecStart = / usr / sbin / nginx (code = terminated, status = 0 / SUCCESS)
Process: 17241 ExecStartPre = / usr / sbin / nginx-t (code = terminated, status = 0 / SUCCESS)
Process: 17239 ExecStartPre = / usr / bin / rm -f /run/nginx.pid (code = terminated, status = 0 / SUCCESS)
Main PID: 17245 (nginx)
Details: 3 (limit: 12552)
Memory: 5.4M
CGroup: /system.slice/nginx.service
?? 17245 nginx: master process / usr / sbin / nginx
?? 17246 nginx: worker process
?? 17247 nginx: worker process

02 dec. 01:25:15 centos8 systemd [1]: Start nginx HTTP and reverse proxy server ...
02 Dec 01:25:15 centos8 nginx [17241]: nginx: configuration file /etc/nginx/nginx.conf syntax is ok
02 dec. 01:25:15 centos8 nginx [17241]: nginx: configuration file /etc/nginx/nginx.conf test successful
02 dec. 01:25:15 centos8 systemd [1]: Started nginx HTTP and reverse proxy server.

Configure Firewall

Next, you must allow Nginx service through firewall to access the Odoo 13 instance from the remote system.

You can run the following command to allow the Nginx service via firewall:

  firewall-cmd --permanent --zone = public --add-service = nginx 
firewall-cmd --reload

By default, SELinux is enabled in CentOS 8. So you must allow HTTP via SELinux. You can allow it with the following command:

  setsebool -P httpd_can_network_connect on 

Access Odoo 13 Web Interface

Now Odoo 13 is installed and configured. It is time to access the web interface Odoo 13.

Open your web browser and enter the URL http://example.com . You will be redirected to the following page:

 Odoo ERP Setup Database Information

Now, enter your master password, database name, email, password, country and click on Create database scarce. You will be redirected to the Odoo 13 administration page:

 Odee ERP apps

Conclusion

In the above tutorial, you learned how to install and configure Odoo 13 on the CentOS 8 server. You have also learned how to configure Nginx as a reverse proxy for Odoo 13. You can now customize your Odoo 13 instance to suit your business needs.


Source link