DevelopmentTutorials

Effortlessly Installing Odoo 14 on Ubuntu 22.04: A Step by Step Guide

Before you start the installation, you will need to install the prerequisites required to run Odoo 14 on your system. In this tutorial, you will learn how to install Odoo 14 on your Ubuntu system.

Update the Server

sudo apt-get update
sudo apt-get upgrade

Create Ubuntu user

sudo adduser --system --home=/opt/odoo --group odoo

The next step is to install libraries, packages, and dependencies to make everything work

Install Packages and libraries

sudo apt-get install -y python3-pip
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

Install 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 Postgresql

Odoo requires a PostgreSQL database to store its information, so we install the PostgreSQL server to process and accept database operations. After installation, the server can be started by activating the startup server at boot time

sudo apt-get install postgresql

Create Postgresql User

createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo14

Assign the user as a superuser to get more access

Psql
ALTER USER odoo14 WITH SUPERUSER;

Install Odoo

sudo apt-get install git

Change the system user as odoo

sudo su - odoo -s /bin/bash

Clone from odoo repositories

git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 --single-branch

Install python packages

sudo pip3 install -r /opt/odoo/requirements.txt

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

Server config file

sudo touch /etc/odoo-server.conf

sudo su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/odoo-server.conf"

sudo su root -c "printf 'admin_passwd = admin\n' >> /etc/odoo-server.conf"

sudo su root -c "printf 'xmlrpc_port = 8069\n' >> /etc/odoo-server.conf"

sudo su root -c "printf 'logfile = /var/log/odoo/odoo-server.log\n' >> /etc/odoo-server.conf"

sudo su root -c "printf 'addons_path=/odoo/odoo-server/addons\n' >> /etc/odoo-server.conf"

sudo chown odoo:odoo /etc/odoo-server.conf sudo chmod 640 /etc/odoo-server.conf

Log file

sudo mkdir /var/log/odoo sudo chown odoo:odoo /var/log/odoo

Create new service for odoo

To ensure that Odoo continues to work after boot, we need to create a service for it. The virtual Python environment is the core of the main goal of creating an isolated environment for Odoo itself and others.

For that, create a file in /etc/systemd/system named ‘odoo.service’.

sudo nano /etc/systemd/system/odoo.service

Set permissions for the root user to this file.

sudo chmod 755 /etc/systemd/system/odoo.servicesudo chown root: /etc/systemd/system/odoo.service

Run Odoo 14

sudo systemctl start odoo.service

Check odoo service status

sudo systemctl status odoo.service

You can now access Odoo through your web browser using your IP address (default port is 8069). After installing Odoo on Ubuntu, you will need to access it with this IP address. Make sure that Odoo is running successfully, and you can check the status with the following command.

“http://<your_domain_or_IP_address>:8069”

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button