Enable Dark Mode!
how-to-install-odoo-14-on-ubuntu-20.04-lts.jpg
By: Hajaj Roshan

How to Install Odoo 14 on Ubuntu 20.04 LTS

Odoo 14

Odoo has launched the latest version of Odoo 14 with so many exciting features. Let us see the steps to install Odoo 14 in the ubuntu server with the version of 20.04 LTS.

New: To install Odoo 15 on Ubuntu 20.04 LTS Server refer to our blog, How to install Odoo 15 on Ubuntu 20.04 LTS Server?

You can watch the following video if you need an illustrative understanding of the same:

Follow the below steps to install Odoo 14 on Ubuntu 20.04 LTS

Step-1: Keep update your Server

First of all login to the server using the ssh command. Eg: ssh username@<IP address>. Then use the following command to update your system. 
sudo apt-get update
sudo apt-get upgrade
Step 2: Secure your system
After updating the server we should ensure that the server is remotely accessible. Furthermore, install Fail2ban which is used to protect from SSH attacks
sudo apt-get install openssh-server fail2ban
Step 3: Create a system user
Now let us create a new system user for the Odoo service. Further, then we will limit the permissions of all Odoo related files and directories for this specific user.
sudo adduser --system --home=/opt/odoo --group odoo
Step 4: Installing Packages and libraries
The next step is to install some libraries and package dependencies to run Odoo. 
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 
Ensure that all packages are successfully installed. Moreover, there are some web dependencies that also need to be 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: 5: Configure Postgresql
As Odoo’s databases are handled by the Postgresql database server. Therefore,  next, we need to set-up Postgresql properly. 
Install Postgres from the Debian repository.
sudo apt-get install postgresql
Then we have to create a database user for managing Odoo databases. Therefore, initially, we need to switch users to Postgres
sudo su - postgres
Now create a user odoo14 with the following command. Furthermore, at the time you must have to provide a new password for the user odoo14 and that password is needed to provide in the Odoo configuration file at the last step of the installation.
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo14
Next, we have to assign this user as a superuser for getting more privileges.
psql
ALTER USER odoo14 WITH SUPERUSER;
This will print a success message in the terminal. In addition,  exit from the psql and Postgres. With the following commands.
\q
exit
Step 6: Get Odoo community from git
Now as the software is installed as the user settings are configured next, we have to place the Odoo source file into our server. Additionally, we can easily clone the community edition from Odoo’s GitHub repository. 
To clone from git we must first ensure that git is installed in the server.
sudo apt-get install git
Now before cloning, we have to change the system user as odoo (which is created in Step 3) to make the Odoo system more secure.
sudo su - odoo -s /bin/bash
The next step is to clone from odoo repositories and the corresponding branch
git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 --single-branch .
Source files are cloned to the home directory of user odoo. Moreover, the home directory of the user is specified at the time of user creation.  Which is /opt/odoo. 
Now exit and continue with the installation.
exit
Step 7: Install required python packages
Odoo uses various python packages and libraries for different purposes. To run Odoo we need to install them using pip3. Furthermore, the required dependencies are listed in the requirement.txt file which is contained in the Odoo folder. Therefore, we can specify this file to the pip install command which will automatically install packages listed in the file requirement.txt one by one
sudo pip3 install -r /opt/odoo/requirements.txt
We have to ensure that every package is installed without fail. On the contrary of a mishap, it will cause an error at the time of run odoo.
Odoo uses wkhtmltopdf for printing pdf reports. In addition, the latest edition of Odoo supports the 0.12.5 version of wkhtmltopdf to support headers and footers.
You can use the following commands to download and install wkhtmltopdf
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 8: Configuration of Odoo
Odoo wants to know some information such as database user, password, addons locations, etc. to run the system. Moreover, these will be provided in the configuration file. Therefore our net primary priority should be to create a configuration file for Odoo. Moreover, there is a sample file of configuration available within the Odoo folder which can be copied to a specific location. Usually, we place configuration files in /etc location.
To copy the configuration file to /etc :
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.conf
The next step is we need to provide the necessary details into the file.
sudo nano /etc/odoo.conf
Update conf file same as shown in the below code:
[options]
   ; This is the password that allows database operations:
   admin_passwd = admin
   db_host = False
   db_port = False
   db_user = odoo14
   db_password = False
   addons_path = /opt/odoo/addons
   logfile = /var/log/odoo/odoo.log
Furthermore, the configuration file should at least have the following parameters:
admin_passwd: Provide a strong password, it will be required during database create/delete/restore operations
db_host: the database host
db_port:  the database port
db_user: the database user name
db_password: provide db user password
addons_path: if you have enterprise edition or third party modules create another directory and specify the paths here separated by commas
logfile: The log file path
We need to set access rights to the system used in the conf file that can be done by using the following command:
sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf
Odoo will maintain logs in a log file that is specified in the configuration. Moreover, you can create a directory for logs. Usually, logs are contained in the location /var/log therefore, we can also create a directory inside this location named odoo.
sudo mkdir /var/log/odoo
As we did earlier, this directory has also set permission for user odoo.
sudo chown odoo:root /var/log/odoo
Step 9: Create a new service for odoo
As we have successfully configured odoo let's create a service for Odoo.
For that create a new file in /etc/systemd/system named ‘odoo.service’.
sudo nano /etc/systemd/system/odoo.service
Further place the following into the 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
Now we have to set permissions for the root user to this file.
sudo chmod 755 /etc/systemd/system/odoo.service
sudo chown root: /etc/systemd/system/odoo.service

Step 10: Run Odoo 14

As the installation procedures of the platform are successfully completed. Let’s start and run certain tests. Use the following command to start odoo service.
sudo systemctl start odoo.service
Moreover, check the status of odoo service using the following command:
sudo systemctl status odoo.service
If it is in the active state you can access Odoo by entering the following URL.
“http://<your_domain_or_IP_address>:8069”
If the process is operating without any errors 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 the odoo runs successfully, the installation process is completed. You can run the odoo using the previous command.
If you need the Odoo service to start automatically on boot time, you can use the following command.
sudo systemctl enable odoo.service
Are you searching for instructions on How to Configure Odoo with Nginx as Reverse Proxy you can understand it by reading our blog which can be obtained by selecting the link. If you finally Installed Odoo 14 in your System, you can download our Odoo Development Tutorial App from Odoo Apps Page to learn more about Odoo Development and Build a career in Odoo. 
Have a look at the following blog to explore more about Install Odoo 16 Ubuntu 20.04. Install Odoo 16 Ubuntu 20.04


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



9
Comments

Aymen

? odoo.service - Odoo Loaded: loaded (/etc/systemd/system/odoo.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2022-05-24 06:09:30 PDT; 6s ago Docs: http://www.odoo.com Process: 2326 ExecStart=/opt/odoo/odoo-bin -c /etc/odoo.conf (code=exited, status=203/EXEC) Main PID: 2326 (code=exited, status=203/EXEC) May 24 06:09:30 ubuntu systemd[1]: Started Odoo. May 24 06:09:30 ubuntu systemd[2326]: odoo.service: Failed to execute command: No such file or directory May 24 06:09:30 ubuntu systemd[2326]: odoo.service: Failed at step EXEC spawning /opt/odoo/odoo-bin: No such file or directory May 24 06:09:30 ubuntu systemd[1]: odoo.service: Main process exited, code=exited, status=203/EXEC May 24 06:09:30 ubuntu systemd[1]: odoo.service: Failed with result 'exit-code'.

24/05/2022

-

1:11PM

Widi

Have followed all also and localhost:8069 get the Internal Server Error 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 248, in __init__ self._cnx = pool.borrow(dsn) File "/opt/odoo/odoo/sql_db.py", line 558, in _locked return fun(self, *args, **kwargs) File "/opt/odoo/odoo/sql_db.py", line 624, in borrow result = psycopg2.connect( File "/usr/local/lib/python3.8/dist-packages/psycopg2/__init__.py", line 127, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: FATAL: Peer authentication failed for user "odoo14" - - -

23/06/2021

-

3:20AM

Michael G.

Not working. Some script would be usefull, this tutorial is overcomplicated and not working. Culdn't create opt/odoo folder

22/06/2022

-

8:22PM

Rassiel

Very good post. Thanks

21/10/2020

-

6:51AM

reply REPLY

Cybrosys

Hey Rassiel, thank you so much for your valuable comments.

BG

there is an error in finding requirements.txt file

20/10/2020

-

5:26PM

Nouman

Hello,, Follow above mentioned steps but odoo page give error. anyone have idea Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

20/06/2022

-

11:25AM

Shubham Singh

After following all the steps and try to execute “http://:8069”, we are getting 500 Internal server error. Please advise as to where we might gone wrong.Thanks anticipation

08/12/2020

-

1:24AM

Benedito Monteiro

Hello, I have followed the instructions below...from your webpage, but it is showing me an error. Now before cloning, we have to change the system user as odoo (which is created in Step 3) to make the Odoo system more secure. sudo su - odoo -s /bin/bash The next step is to clone from odoo repositories and the corresponding branch git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 --single-branch . Source files are cloned to the home directory of user odoo. Moreover, the home directory of the user is specified at the time of user creation. Which is /opt/odoo. Now exit and continue with the installation. sudo pip3 install -r /opt/odoo/requirements.txt error: could not open requirements file:[ erro 2 no such file or directory /opt/odoo/requirements.txt]

06/05/2022

-

4:40PM

Jack Smith

Is this the latest release of odoo14?

02/10/2020

-

12:43AM

reply REPLY

Cybrosys

Hi Jack Smith, Yes it is the latest Odoo 14 release



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