How to Set up Odoo CE 18 Docker Desktop (Windows OS)
- Tek Siong, Hock
- May 9
- 2 min read
If you are planning to use docker desktop for Odoo local development, and need to be convinced of the benefits.
Benefits of Docket Desktop for Odoo Development
Quick and simple set up, if you following the guide below. This will be especially handy when you have multiple version of Odoo, python libraries, etc, in your Windows development environment
Developer can develop and test your Odoo codes in the environment that mirror the server Ubuntu environment. Eg, schedule action.
Deploy the docker image to the remote server easily with the same environment.
Docker Desktop Features
Quick Setup – No manual dependency installation; containers handle everything.
Isolated Environment – Avoids conflicts with other software on your system.
Easy Updates – Change Odoo or PostgreSQL versions with a single command.
Portability – Move or deploy the same setup anywhere Docker runs.
Clean Removal – Delete containers without leaving traces on your host machine.
Quicks Start Guide
Pre Requisite
Get supporting files from folder
Install WSL command
In powershell
wsl --install
Search on Windows store install Ubuntu 24.04.5 LTS

Verify installation
wsl --status

Install Docker Desktop
Download from the following URL Windows | Docker Docs
Run installer

Run Docker
Docker-compose build download odoo specified in “dockerfile” file. Currently, it will download odoo 18 released in august 2024. To download odoo 18 released in december 2024, change “dockerfile” to other name (e.g. “dockerfile_old) and rename “dockerfile_dec” to “dockerfile”
Sample docker-compose.yml
```yaml
version: '3.7'
services:
odoo:
image: odoo:18
container_name: odoo
build: .
ports:
- "8080:8080" # Odoo web interface will be available on port 8069
environment:
- HOST=db
- USER=odoo
- PASSWORD=odoo
- DB_NAME=odoo # Specify the database name
volumes:
- ./custom/addons:/mnt/extra-addons # Mount your custom addons
- odoo-data:/var/lib/odoo # Persistent Odoo data
depends_on:
db:
condition: service_healthy # Wait for the database to be healthy
networks:
- odoo-net
command: >
odoo --xmlrpc-port=8080 --init=base --load=base --database=odoo
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8080 || exit 1"]
interval: 30s
timeout: 10s
retries: 5
db:
image: postgres:15
container_name: odoo-db
environment:
- POSTGRES_DB=odoo
- POSTGRES_USER=odoo
- POSTGRES_PASSWORD=odoo
volumes:
- odoo-db-data:/var/lib/postgresql/data
networks:
- odoo-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U odoo"]
interval: 30s
timeout: 10s
retries: 5
volumes:
odoo-data:
odoo-db-data:
networks:
odoo-net:
driver: bridge
```
In the respctive project folder extracted from Step 1
Build the docker image
docker-compose build

Run and build the container in the background
docker-compose up -d

On the docker desktop application, Containers

Login to Odoo

Login: admin
password: admin

Done, Odoo CE can be used locally

Adding Modules and Python Package (optional)
To stop service and remove containers
Run docker-compose down

In the project folder, navigate to custom> addons

Drop any third party module, check if there any python package requirements
Third party apps: https://apps.odoo.com/apps?series=18.0
Example , packaging and paramiko (python package)
Add the package name in the requirements.txt


Run
docker-compose build
And
docker-compose up -d
to build and update the container with the newly added module and package

Comentários