A lightweight, robust, and isolated Docker environment tailored for Odoo 18 development. This repository serves as a foundational template to quickly spin up a local instance of Odoo with PostgreSQL, optimized for developers who deploy to Odoo.sh or custom cloud infrastructures.
This template explicitly separates the infrastructure setup from your private business logic (custom modules). It uses SSH and Git best practices to ensure no sensitive data or proprietary code is ever exposed in this configuration repository.
Odoo's module loading logic is strict. This repository is structured to perfectly map your local development folders to the Docker container without causing permission loops or nested-module reading errors.
.
├── addons/ # Mapped to /mnt/extra-addons in the container
│ ├── custom_modules/ # Put your custom Odoo apps here (e.g., my_sales_module)
│ └── enterprise/ # Clone the Odoo Enterprise repo here (From odoo admin)
├── config/
│ └── odoo.conf # Master configuration file
├── docker-compose.yml # Container orchestration
└── .gitignore # Security shield
Important
Security Note: The .gitignore is heavily configured to ignore the contents of addons/. This repo manages the environment, while your custom modules inside addons/ should be managed by their own Git repositories or submodules in odoo.sh or something similar.
git clone [https://github.com/rogeliovc/odoo18-enterprise-docker-stack.git](https://github.com/rogeliovc/odoo18-enterprise-docker-stack.git) my-local-odoo
cd my-local-odooClone your private company repositories or create new modules inside the addons/custom_modules directory. Ensure you have your SSH keys configured locally to fetch private repos.
cd addons/custom_modules
git clone git@github.com:your-company/private-modules.git .cd enterprise
# put or execute git cloneReturn to the root directory and start the environment in detached mode:
docker compose up -dAccess Odoo at: http://localhost:8069
When running Odoo locally via Docker without a Reverse Proxy (like Nginx), you might encounter terminal spam and connection drops regarding port 8072. Odoo tries to route live chat and notifications through a dedicated websocket port when multiprocessing is enabled.
The Fix included in this repo:
Inside config/odoo.conf, we explicitly set workers = 0.
This forces Odoo into Multithreading mode (instead of multiprocessing). Odoo will now smoothly handle both standard HTTP traffic and Websocket requests through the single 8069 port, eliminating the error and making the local server highly stable for debugging.
When working with multiple developers, you might have empty submodule folders locally if you lack read permissions for certain third-party apps.
Crucial Rule: Never use git add . in your root custom modules folder if you have uninitialized submodules. Doing so will push empty folders to Odoo.sh, breaking the deployment for your team.
Instead, use Surgical Commits:
# Only stage the specific module you created/modified
git add addons/custom_modules/my_new_module/
git commit -m "[ADD] my_new_module: Initial structure"
git push origin <your-odoo-sh-branch> # e.g., 18.0-PU or 18.0-featureDepending on the files you modify, Odoo requires different update strategies inside this Docker environment:
Python (.py) or Manifest (__manifest__.py) changes:
- Python runs in RAM. You must restart the container:
docker compose restart web - Go to Odoo UI -> Apps -> Find your module -> Click Upgrade.
XML (.xml) changes (Views, Menus, Actions):
- No Docker restart needed.
- Go to Odoo UI -> Apps -> Click Upgrade on your module.
Adding a completely NEW module folder:
- Ensure Developer Mode is active.
- Go to Apps -> Click Update Apps List in the top menu.
- Search for your module and click Install.
This template is open-source and available under the MIT License. Feel free to fork it, modify it, and use it to bootstrap your Odoo development journey.