This repository contains a Docker Compose configuration for running Odoo 19 with PostgreSQL 18 database.
- db: PostgreSQL 18.2 database server
- odoo: Main Odoo 19 application server
- odoo-init: Initialization service for setting up Odoo with all modules
- Docker
- Docker Compose
- At least 4GB of available RAM
- Ports 8069 and 5432 available on your host machine
-
Clone or download this configuration
-
Create the required directories:
mkdir -p config addons db/init
-
Initialize the database (runs once):
docker compose up odoo-init
-
Start the main Odoo service:
docker compose up -d odoo
-
Access Odoo at: http://localhost:8069
.
├── docker-compose.yml
├── config/ # Odoo configuration files
├── addons/ # Custom Odoo addons
│ └── hello_world/ # Example module
├── db/
│ └── init/ # Database initialization scripts (run on first DB creation)
└── README.md
- Database: odoo
- Username: admin
- Password: admin (set during first setup)
- Image: postgres:18.2
- Port: 5432 (exposed)
- Database: odoo
- User: odoo
- Password: odoo
- Data persistence:
db_datavolume
- Image: odoo:19
- Port: 8069 (exposed)
- Custom addons: Mount
./addonsto/mnt/addons - Configuration: Mount
./configto/etc/odoo
- Runs once to initialize the database with all modules (
-i all --stop-after-init) - Does not restart (
restart: no) - Same volumes as the main Odoo service
To use Odoo Enterprise source code, uncomment the enterprise volume lines in both the odoo and odoo-init services in docker-compose.yml:
- ../enterprise-19.0:/mnt/enterprise:roAn example hello_world module is included in addons/ demonstrating a basic Odoo module with:
- A model (
hello.world) withname,message, andis_publishedfields - List and form views
- A top-level menu item
- Access control for internal users
Place custom Odoo addons in the ./addons directory. They are automatically available via the /mnt/addons addons path.
docker compose up -ddocker compose down# All services
docker compose logs -f
# Specific service
docker compose logs -f odoodocker compose restart odoodocker compose exec db psql -U odoo -d odoodocker compose down -v
docker compose up -dPlace your odoo.conf file in the ./config directory. Example:
[options]
addons_path = /mnt/addons,/mnt/enterprise,/usr/lib/python3/dist-packages/odoo/addons
data_dir = /var/lib/odoo
db_host = db
db_port = 5432
db_user = odoo
db_password = odooPlace SQL scripts in ./db/init — they run automatically on first database creation via PostgreSQL's docker-entrypoint-initdb.d mechanism.
- Check if database is healthy:
docker compose ps
- Check logs for errors:
docker compose logs db docker compose logs odoo
If ports 8069 or 5432 are already in use, modify the port mappings in docker-compose.yml:
ports:
- "8070:8069" # Change host portEnsure the volumes have correct permissions:
sudo chown -R 101:101 config addonsVerify database service is running and healthy:
docker compose exec db pg_isready -U odoodocker compose exec db pg_dump -U odoo odoo > backup.sqldocker compose exec -T db psql -U odoo odoo < backup.sql