Enable Dark Mode!
how-to-install-odoo-13-on-ubuntu-20-04-lts.png
By: Hajaj Roshan

How to Install Odoo 13 on Ubuntu 20.04 LTS

Technical Odoo 13

The latest version of Ubuntu 20.04 was released in April 2020, with a particular emphasis on security and performance. As they mentioned in their release note, the performance standards of Ubuntu 20.04 are much better compared to previous versions. Also, they focused on and improved the security side. About a server, both are very essential features. Let’s see how to install Odoo 13 on Ubuntu 20.04 LTS Server.

Step 1: Update your Server

First of all login to the server or connect through ssh using the terminal. Then update your system.
sudo apt-get update
sudo apt-get upgrade

Step 2: Secure the server

After updating the server, we ensure that the server is remotely accessible 
sudo apt-get install openssh-server fail2ban

Step 3: Add a new system user

Next, we will create a system user for running the Odoo service.
sudo adduser --system --home=/opt/odoo --group odoo

Step 4: Installing Packages and libraries

After creating the system user, you need to install some necessary tools and libraries that are required to build Odoo dependencies.

Install pip3:

sudo apt-get install -y python3-pip

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 
After installation of the packages and libraries, we need to install some web dependencies.
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
Install wkhtmltopdf to print PDF reports. ‘0.12.5’ is the recommended version for Odoo 13. You can install wkhtmltopdf using the following command:.
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: 5: Configure PostgreSQL

PostgreSQL must be correctly installed for Odoo to run. Odoo is using PostgreSQL as the database server.
Install PostgreSQL:
sudo apt-get install postgresql
After the successful installation of PostgreSQL, you have to create a new PostgreSQL user for managing Odoo databases.
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo13
After executing the command, the odoo13 user is generated, and a password is given.
Then change the user as a superuser.
psql
ALTER USER odoo13 WITH SUPERUSER;
Then use “\q” for exit from the psql and use the “exit” command to continue the installation

Step 6: Clone Odoo from git

After the configuration of PostgreSQL, you have to clone Odoo 13 from the Github repo. So first, ensure that git is installed on the server.
sudo apt-get install git
Then change the system user to the Odoo user, which is created for Odoo installation. This will help to avoid the risk related to access rights issues.
sudo su - odoo -s /bin/bash
Next, clone the Odoo 13 Community version from the Odoo GitHub repository.
git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 --single-branch .
This will download the source files to the created user’s home directory, which will be /opt/odoo
Then exit and continue the installation
exit

Step 7: Install Required Dependencies for Odoo

Odoo needs some dependencies to run smoothly. And these required dependencies are listed in the file requirements.txt located within the odoo directory
sudo pip3 install -r /opt/odoo/requirements.txt

Step 8: Configure Odoo

After the successful installation of dependencies, we have to configure Odoo. Odoo will maintain log files.
Create a directory to store the log file
sudo mkdir /var/log/odoo
Next, we will give complete access to this directory to the user odoo.
sudo chown odoo:root /var/log/odoo
After the processing of the log file, create a configuration file for Odoo. You can copy the file that comes with Odoo to an appropriate location.
To copy the configuration file:
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.conf
Now you have to make some changes to the configuration file. For that, you can use a text editor called ‘nano’
sudo nano /etc/odoo.conf
The configuration file is shown below:
[options]
   ; This is the password that allows database operations:
   ; admin_passwd = admin
   db_host = False
   db_port = False
   db_user = odoo13
   db_password = False
   addons_path = /opt/odoo/addons
   logfile = /var/log/odoo/odoo.log
The configuration file should have at least the following parameters:
admin_passwd: admin password for PostgreSQL database
db_host: the database host
db_port:  the database port
db_user: the database user name
db_password: the database password
addons_path: addons paths (separated by commas)
logfile: the log file path
Next, we have to give access rights to the previously created user.
sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf

Step 9: Test Odoo Installation

Now we have successfully completed the Odoo service creation and Odoo installation. Now start the Odoo service.
sudo systemctl start odoo.service
Now you can access Odoo using a web browser. Enter the following URL:
“http://<your_domain_or_IP_address>:8069”
If everything is working well, the page will be redirected to Odoo’s database creation page.
You can check the log file specified in the configuration file.
sudo tail -f /var/log/odoo/odoo.log
If Odoo is running successfully, the installation process has been completed. You can run Odoo using the previous command.
If you need the Odoo service to start automatically at boot time, you can use the following command:.
sudo systemctl enable odoo.service

Have a look at the following blog to explore more about How to Install Odoo 13 on Ubuntu 20.04 LTS


If you need any assistance in odoo, we are online, please chat with us.



4
Comments

Nicolas

Hello, I'm having a problem after installing Odoo. When I try to access the service via localhost:8069 I get an error saying that is unable to connect. What can be the problem ?

27/12/2020

-

3:54PM

Hajaj Roshan

Hi Paul, That's because you missed dot in the following git clone command at the end. git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 --single-branch . the dot will automatically choose the home directory of the current user which we set '/opt/odoo'. So don't miss the dot operator at the end of the command.

20/10/2020

-

11:00AM

Debasish Ghosh

Oodo is not not running: I think there is a syntax error in sudo nano /etc/systemd/system/odoo.service 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 # sudo tail -f /var/log/odoo/odoo.log return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized) File "/opt/odoo/odoo/sql_db.py", line 196, in __init__ self._cnx = pool.borrow(dsn) File "/opt/odoo/odoo/sql_db.py", line 547, in _locked return fun(self, *args, **kwargs) File "/opt/odoo/odoo/sql_db.py", line 613, in borrow result = psycopg2.connect( File "/usr/local/lib/python3.8/dist-packages/psycopg2/__init__.py", line 126, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: FATAL: Peer authentication failed for user "odoo13" - - -

11/11/2020

-

5:13AM

Paul

There is a problem with your process. When you get to "sudo pip3 install -r /opt/odoo/requirements.txt" it fails because your download instructions place the download in a folder named odoo inside the /opt/odoo/ home folder so the command would need to read "sudo pip3 install -r /opt/odoo/odoo/requirements.txt". then every instruction below would also need updated to reflect the correct path.

03/09/2020

-

9:59AM



Leave a comment



whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message