Getting Started with Odoo and OCA Modules via Docker
This guide provides a comprehensive walkthrough on installing Odoo Community Association (OCA) modules. If you haven't yet set up an Odoo server, utilizing Docker offers a swift and efficient solution, enabling you to deploy your Odoo instance within minutes directly from the command line. A significant advantage of this approach lies in its ability to 'containerize' the Odoo server, isolating it within a dedicated virtual environment. This ensures that your Odoo installation operates without affecting other components or services on your host system. This method is not only practical and quick but also highly secure for development and testing environments, though it is robust enough to support full production deployments as well. While the instructions are primarily tailored for Ubuntu OS, they can be easily adapted for macOS and Windows systems.
Installation Steps
-
Install Docker and Docker Compose
The foundational step involves installing Docker and Docker Compose on your operating system. These tools are essential for managing containerized applications.
- Install Docker Engine: For detailed instructions, refer to the official Docker documentation.
- Install Docker Compose: Follow the guide available in the official Docker Compose documentation.
-
Create the Directory Structure
Next, establish the necessary directory structure. This setup will house your Odoo configuration and data. We recommend using
odooas your base installation directory.mkdir odoo && cd odoo mkdir -p ./volumes/postgres ./volumes/odoo/addons ./volumes/odoo/filestore \ ./volumes/odoo/sessionsThis command creates the main
odoodirectory, navigates into it, and then sets up subdirectories for PostgreSQL data, Odoo addons, filestore, and sessions, ensuring proper data persistence and organization. -
Create
docker-compose.ymlConfiguration FileWithin your newly created
odoodirectory, you need to create adocker-compose.ymlfile. This file defines the services, networks, and volumes for your multi-container Docker application. Copy and paste the following content into this file:version: '3.3' services: postgres: image: postgres:9.5 volumes: - ./volumes/postgres:/var/lib/postgresql/data environment: - POSTGRES_USER=odoo odoo: image: elicocorp/odoo:10.0 command: start ports: - 127.0.0.1:8069:8069 volumes: - ./volumes/odoo/addons:/opt/odoo/additional_addons - ./volumes/odoo/filestore:/opt/odoo/data/filestore - ./volumes/odoo/sessions:/opt/odoo/data/sessions links: - postgres:db environment: - ADDONS_REPO=https://github.com/OCA/business-requirement.git - ODOO_DB_USER=odooThis configuration sets up two services:
postgresfor your database andodoofor the Odoo application. Note theADDONS_REPOenvironment variable, which points to the OCAbusiness-requirement.gitrepository, allowing Odoo to fetch these modules. -
Launch Your Odoo Containers
With the
docker-compose.ymlfile in place, navigate to yourodoodirectory in the terminal and execute the following command to launch your Odoo and PostgreSQL containers in detached mode:docker-compose up -d odooThe
-dflag runs the containers in the background, allowing you to continue using your terminal. -
Access Odoo in Your Web Browser
Once the containers are running, open your preferred web browser and navigate to the URL configured in your
docker-compose.ymlfile. By default, this is typicallyhttp://127.0.0.1:8069. This will take you to the Odoo database creation page. -
Create a New Database
Upon accessing the Odoo interface for the first time, you will be prompted to create a new database. Provide the necessary details, such as a master password, database name, and admin credentials, then proceed to create the database.
-
Update the Addons List
To ensure that your newly added OCA modules are recognized by Odoo, you need to update the applications list. First, activate 'Developer Mode' (also known as 'Debug Mode') from the 'Settings' menu. Then, navigate to the 'Apps' menu and click on 'Update Apps List'. This action refreshes the list of available modules, including those fetched from the OCA repository.
-
Install Business Requirements Modules
After updating the app list, search for 'Business Requirements' within the 'Apps' menu. You should now see the OCA 'Business Requirements' modules listed. Click 'Install' to add these modules to your Odoo instance, thus integrating their functionalities into your system.
Further Customization and Optimization
This completes the basic installation and setup of OCA modules within your Odoo Docker environment. For further enhancements, customization, or to configure advanced parameters such as changing default passwords or adding more repositories, consult the comprehensive Odoo Docker documentation. This resource will guide you through optimizing your Odoo setup for various operational needs.
