This project provides a reproducible, script-driven setup for Odoo 18 and PostgreSQL using Docker Compose.
Configuration is controlled via .env
and odoo.conf
.
- compose.yml – Docker Compose definition (Odoo + Postgres, persistent volumes, variable substitution).
- setup.sh – Idempotent setup script for database initialisation and service orchestration.
- .env – Environment variables (Postgres user, password, db, Odoo port).
- odoo.conf – Odoo server configuration.
- addons/ – Local Odoo addons directory (mounted in container).
- Docker
- Docker Compose plugin (
docker compose
) - Bash shell
-
Edit
.env
Set your Postgres/Odoo details:POSTGRES_USER=odoo_dev POSTGRES_PASSWORD=yourpassword POSTGRES_DB=custom_odoo_db_1 ODEV_PORT=8018
-
Edit
odoo.conf
as needed Ensure port and paths align with.env
and volumes. -
Run setup
./setup.sh
-
Access Odoo Open http://localhost:8018 (or your configured port).
- Loads
.env
variables - Brings down and cleans previous Docker containers/volumes
- Starts only the database, waits for readiness
- Runs Odoo initialisation (
--init=base
) in an isolated step - Brings up full stack in detached mode
-
View logs:
docker compose logs -f
-
Stop services:
docker compose down
.env
values must have no spaces before or after=
.- Only Odoo 18 and PostgreSQL 17 tested.
- All data is persisted via Docker named volumes.
-
If setup fails:
- Check
.env
for whitespace or missing variables. - Inspect logs:
docker compose logs -f
- Review output of
setup.sh
for early errors.
- Check
- To add Odoo modules:
Mount them in
addons/
and adjust the setup script’s init command if needed.
.
├── addons/
├── compose.yml
├── odoo.conf
├── setup.sh
└── .env
systemctl start docker
docker compose up -d && docker compose logs -f
docker compose down
docker ps -as
docker stop
docker compose logs -f