Install Odoo with OCA repository

Install Odoo

# Define the version you want here

apt install curl gpg
APT_URL="${VERSION}/nightly/deb/ ./"
curl -fsSL ${KEY_URL} | gpg -o /etc/apt/trusted.gpg.d/${PACKAGE}.gpg --dearmor
echo "deb [signed-by=/etc/apt/trusted.gpg.d/${PACKAGE}.gpg] ${APT_URL}" > /etc/apt/sources.list.d/${NAME}.list
apt update
apt install ${PACKAGE}

Add OCA repository

Create new repository file for APT with the following commands.

echo "deb [trusted=yes] ${VERSION} main" > /etc/apt/sources.list.d/odoo-oca.list
apt update

List all modules

apt search odoo-oca

Install all modules (probably not required for your instance).

apt install odoo-oca*

For a complete list of module, read List of modules page.

Then add the OCA path into you /etc/odoo/odoo.conf config file

addons_path = /usr/share/odoo-oca/,/usr/lib/python3/dist-packages/odoo/addons

Restart Odoo to care the new config file

systemctl restart odoo

Install nginx (optionnal)

apt install nginx
rm /etc/nginx/sites-enabled/default
nano /etc/nginx/sites-enabled/odoo
map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;

map $host $db {
   # Use this if you want to map hostname with database
   "~(?<vm>[\w-]*)_[\w-]*\.dev\.oniabsis\.com" $vm;

server {
    listen 80;
    server_name _;

    add_header Content-Security-Policy upgrade-insecure-requests;

    location / {
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        add_header Content-Security-Policy upgrade-insecure-requests;
        proxy_redirect off;
        proxy_set_header X-Odoo-dbfilter $db;


Sometime, some Odoo OCA packages requires to install additional packages. Look at the dependancies and install with

apt install python3-pip
pip install <thepackage>==<version>

Be careful, it's sometime important do not install latest version.

Updated by Olivier Bitsch 5 months ago · 18 revisions