0% found this document useful (0 votes)
78 views8 pages

How To Install Odoo 15 Steps On A Ubuntu 20.04 LTS System Installation

This document provides step-by-step instructions for installing Odoo 15 on an Ubuntu 20.04 server. It covers updating the system, securing it, installing Python and PostgreSQL dependencies, cloning the Odoo source code, configuring the Odoo service, and testing the installation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views8 pages

How To Install Odoo 15 Steps On A Ubuntu 20.04 LTS System Installation

This document provides step-by-step instructions for installing Odoo 15 on an Ubuntu 20.04 server. It covers updating the system, securing it, installing Python and PostgreSQL dependencies, cloning the Odoo source code, configuring the Odoo service, and testing the installation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

How to install Odoo 15 steps on a Ubuntu

20.04 LTS system installation?


Odoo 15 introduces exciting new features, a better user
experience, and performance enhancements. The database
management system in Odoo 15 needs Python 3.8 and
PostgreSQL. Let's get this party started right away.
How do I get Odoo 15 to work on Ubuntu 20.04?
This article will walk you through the process of installing Odoo 15
on an Ubuntu server running version 20.04 LTS.
The terminal will be used for all of these processes (Command
Line Interface).
Step-1: Update the server after logging in.
Using ssh, connect to the server:
ssh <username>@<IP address>

Ensure that system is updated:


sudo apt-get update
sudo apt-get upgrade

Step 2: Secure Server


Ensure that the system is safe against ssh assaults; Fail2ban can
assist avoid ssh attacks:
sudo apt-get install openssh-server fail2ban

Step 3: Install Python 3 and its Dependencies


Install the Python packages that Odoo requires:
Install pip3 as follows:
sudo apt-get install -y python3-pip

Then install Packages and libraries:


sudo apt-get install python-dev python3-dev libxml2-dev libxslt1-dev zlib1g-dev
libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev
libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev

Make sure that all of the packages have been installed correctly
and that there are no issues. Some web dependencies must be
installed after the Python packages have been successfully
installed.
sudo apt-get install -y npm

sudo ln -s /usr/bin/nodejs /usr/bin/node

sudo npm install -g less less-plugin-clean-css

sudo apt-get install -y node-less

Step : 4 Setup Database Server (PostgreSQL)


The database server used by Odoo is PostgreSQL. To install and
configure a database server for Odoo, follow these steps:
sudo apt-get install postgresql

Create a Postgres user to manage the database in the next stage.


The user name and password will be required later in the conf file.
To accomplish the activities, Postgres has its own system user
named 'Postgres. So, to change the user to Postgres, use the
following command:
sudo su - postgres

Next, we'll make an Odoo15 database user. When you run the
following command, it will prompt you for a password, which you
must re-enter. Keep this in mind for future reference:
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo15

The command below guarantees that the user has superuser


privileges:
psql

ALTER USER odoo15 WITH SUPERUSER;

Exit from psql and postgres user:


\q

exit

Step 5: System User


Next, we'll build a system user to execute Odoo roles as well as
provide security. This user's access to and operations on all Odoo files
and folders will be restricted.
Let us now create a new system user for the Odoo service, and then
restrict the rights for all Odoo-related files and directories to this user.
sudo adduser --system --home=/opt/odoo --group odoo

Step 6: Clone the Odoo Source repository on Github.


We can directly clone the Community Edition source code from
Odoo's GitHub repository. After the installation is complete, you can
add the Enterprise edition add-ons.
Install git on the server first:
sudo apt-get install git

The files will be added to the user's home directory after switching the
system user to 'odoo':
sudo su - odoo -s /bin/bash

The following command will clone the source directory, and the
operator dot(.) at the end of the command will clone the files to the
current user's home directory, which is /opt/odoo, which is the same
home directory specified when the user was created:
git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0 --single-branch .

Then exit from the user and continue the installation:


exit

Step 7: Download and install the Python packages you'll need.


The relevant packages must then be installed. The requirement.txt file
contains a list of all the packages. As a result, we can quickly install
these packages using just one command:
sudo pip3 install -r /opt/odoo/requirements.txt

To operate Odoo smoothly, you must ensure that all of the packages
are installed correctly.
Step 8: Download and install Wkhtmltopdf.
Odoo allows you to print reports as PDF files. Wkhtmltopdf aids in the
creation of PDF reports from HTML data. Furthermore, the report
engine converts the Qweb template reports to HTML format, and
Wkhtmltopdf generates the PDF report:
sudo wget
https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5
-1.bionic_amd64.deb

sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

sudo apt install -f

Step 9: Setup Conf file


The next step is to set up the Odoo conf file, which contains
information such as the addons path, database-related options, proxy
parameters, and more.
As a result, a configuration file should be created in the /etc directory.
A sample conf file can be found in the Debian directory of Odoo's
source code. Use the following command to copy from Debian to the
/etc directory:
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.conf

This file contains sample values, and you should edit the file with
proper values:
sudo nano /etc/odoo.conf

Update admin password and db_password from the following sample.


[options]
; This is the password that allows database operations:
admin_passwd = admin

db_host = False

db_port = False

db_user = odoo15

db_password = False

addons_path = /opt/odoo/addons

logfile = /var/log/odoo/odoo.log
The following aspects should be configured before the operations are
conducted:
db_user: the database user name.
db_password: provide db user password which is given while
creating the db user.
admin_passwd: This is the master password of Odoo which is used
to perform database operations in the database manager like create,
delete, duplicate, and many more.
db_host: the database host.
db_port: the database port.
addons_path: provide the path of directories that contain the Odoo
addons directories. You can mention multiple directories separated by
commas:
Eg: addons_path = /opt/odoo/addons, /opt/odoo/enterprise,
/opt/odoo/custom
logfile: the log file path.
Finally, you should set access rights of the conf file for the system
user odoo:
sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf
Also, as we did before, establish a log directory to store the odoo log
file, which will aid you in locating Odoo-related issues, and configure
rights for the user odoo:
sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo
Step 10: Odoo service file
Finally, we have to create a service to run Odoo. Let’s create a service file
‘odoo.service’ in /etc/systemd/system:
sudo nano /etc/systemd/system/odoo.service

Add the following content to the newly created service file


[Unit]

Description=Odoo

Documentation=http://www.odoo.com

[Service]

# Ubuntu/Debian convention:

Type=simple

User=odoo

ExecStart=/opt/odoo/odoo-bin -c /etc/odoo.conf

[Install]

WantedBy=default.target

Next set the permissions for the root user to this service file:
sudo chmod 755 /etc/systemd/system/odoo.service

sudo chown root: /etc/systemd/system/odoo.service

Step 11: Test Odoo 15

Now all the steps of installation are completed. Let's test the Odoo instance
with the following command:
sudo systemctl start odoo.service

Then check the status of the service using the following command. And if it
depicts as active, the installation of Odoo was successful:
sudo systemctl status odoo.service

Now you can access Odoo by entering the following URL:


“http://<your_domain_or_IP_address>:8069”
This will redirect you to the database creation page if everything is set up
correctly.

Check Odoo logs

You can also check the logs of Odoo platform that you have set up if you
are facing any issues related to the installation or any other reasons with
the following command. This command will show you the live logs in the
terminal:
sudo tail -f /var/log/odoo/odoo.log

At last, if you want to start the Odoo service automatically after rebooting
the server, use the following command:
sudo systemctl enable odoo.service

If you have made any changes in the addons, restart the Odoo service to
reflect the updates on your instance using the following command:
sudo systemctl restart odoo.service

You might also like