Skip to Content

Odoo 19 Installation using Docker in Ubuntu

STEP : 1  ​Download Docker 

​ ​Open Terminal  - open the downloads folder

​ ​​cd /Downloads

​ ​ Touch install_docker.sh

​ ​ ​ls

​ ​ ​ls -al install_docker.sh

​ ​ chmod +x install _docker.sh 

​ ​ ​ls -al install_docker.sh

​ ​ open install_docker.sh

​ ​Copy paste the below script

​ ​ # Add Docker's official GPG key:

​ ​ ​sudo apt update

​ ​ ​sudo apt install ca-certificates curl

​ ​ ​sudo install -m 0755 -d /etc/apt/keyrings

​ ​ ​sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc

​ ​ ​sudo chmod a+r /etc/apt/keyrings/docker.asc

​ ​ ​# Add the repository to Apt sources:

​ ​ ​sudo tee /etc/apt/sources.list.d/docker.sources <<EOF

​ ​ ​Types: deb

​ ​ ​URIs: https://download.docker.com/linux/ubuntu

​ ​ ​Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")

​ ​ ​Components: stable

​ ​ ​Signed-By: /etc/apt/keyrings/docker.asc

​ ​ ​EOF

​ ​

STEP : 2  Run the script to install Docker.

​ ​ sudo apt-get update

​ ​ ​./install_docker.sh

STEP : 3  ​​Download the deb file 

​ ​ ​sudo apt-get update

​ ​ ​sudo apt-get install ./docker-desktop-amd64.deb

STEP : 4 Check docker version

​ ​ ​​Docker --version

​ ​ sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin​


STEP : 5​ Now Open the Docker Desktop and view the container. 


STEP : 6  ​Create a  folder as odoo docker and inside that create a yaml file and paste the below content


​ ​ ​#Odoo-docker-directory

​ ​ ​#├── addons

​ ​ ​#├── config

​ ​ ​#│   └── odoo.conf

​ ​ ​#├── docker-compose.yaml

​ ​ ​#├── odoo_pg_pass

​ ​ ​#└── sessions

​ ​ ​# Create a config file inside the config directory with the following content

​ ​ ​# [options]

​ ​ ​# addons_path = /mnt/extra-addons

​ ​ ​# docker-compose.yaml

​ ​ ​version: '3.1'

​ ​ ​services:

​ ​ ​  web:

​ ​ ​    image: odoo:latest

​ ​ ​    depends_on:

​ ​ ​      - db

​ ​ ​    restart: always

​ ​ ​    ports:

​ ​ ​      - "8069:8069"

​ ​ ​      - "8072:8072"

​ ​ ​    volumes:

​ ​ ​      - odoo-web-data:/var/lib/odoo

​ ​ ​      - ./config:/etc/odoo

​ ​ ​      - ./addons:/mnt/extra-addons

​ ​ ​    environment:

​ ​ ​      - PASSWORD_FILE=/run/secrets/postgresql_password

​ ​ ​    secrets:

​ ​ ​      - postgresql_password

​ ​ ​  db:

​ ​ ​    image: postgres:latest

​ ​ ​    environment:

​ ​ ​      - POSTGRES_DB=postgres

​ ​ ​      - POSTGRES_PASSWORD_FILE=/run/secrets/postgresql_password

​ ​ ​      - POSTGRES_USER=odoo

​ ​ ​      - PGDATA=/var/lib/postgresql/data/pgdata

​ ​ ​    restart: always

​ ​ ​    volumes:

​ ​ ​      - odoo-db-data:/var/lib/postgresql/data/pgdata

​ ​ ​    secrets:

​ ​ ​      - postgresql_password

​ ​ ​volumes:

​ ​ ​  odoo-web-data:

​ ​ ​  odoo-db-data:

​ ​ ​# Create a file named odoo_pg_pass in the same directory and enter your database password for odoo

​ ​ ​secrets:

​ ​ ​  postgresql_password:

​ ​ ​    file: odoo_pg_pass


Add another file as odoo_pg_pass and type your postgresql password and save it


STEP : 7  ​Run the below command within the odoo docker  folder 


​docker compose up -d


then it runs and open the odoo.


STEP : 8  ​Stop 


​docker compose down


STEP : 9  ​Restart


​docker compose restart web


STEP : 10  ​View Log File


​docker compose logs -f

# Odoo