Step 0: Install Docker Desktop on macOS
- Download Docker Desktop for Mac from the official Docker website: https://docs.docker.com/desktop/setup/install/mac-install/
- Based on your Mac's processor:
- For Apple silicon (M1, M2, etc.): Download "Mac with Apple silicon" installer
- For Intel chip: Download "Mac with Intel chip" installer
- Double-click the downloaded .dmg file to open the installer
- Drag the Docker icon to your Applications folder
- Open Docker Desktop from your Applications folder
- Follow the on-screen prompts to complete installation and grant necessary permissions
- Verify Docker is running by checking the Docker icon in your menu bar or by running this command in Terminal
bash
docker --version
Step 1: Create a Project Directory
bash
mkdir odoo-dev
cd odoo-dev
Step 2: Create a docker-compose.yml File
Create a docker-compose.yml file in your project directory:
bash
touch docker-compose.yml
Open the file in your preferred editor and add the following configuration:
yaml
version: '3'
services:
db:
image: postgres:13
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
volumes:
- odoo-db-data:/var/lib/postgresql/data
networks:
- odoo-network
odoo:
image: odoo:16.0
depends_on:
- db
ports:
- "8069:8069"
environment:
- HOST=db
- USER=odoo
- PASSWORD=odoo
volumes:
- ./addons:/mnt/extra-addons
- ./config:/etc/odoo
- odoo-web-data:/var/lib/odoo
networks:
- odoo-network
networks:
odoo-network:
volumes:
odoo-db-data:
odoo-web-data:
Step 3: Create Configuration Directory and File
Create a configuration directory and an Odoo configuration file:
bash
mkdir -p config
touch config/odoo.conf
Add the following content to config/odoo.conf:
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
admin_passwd = admin
db_host = db
db_port = 5432
db_user = odoo
db_password = odoo
Step 4: Create Custom Addons Directory
Create a directory for your custom modules:
bash
mkdir -p addons
Step 5: Start the Docker Containers
Launch your Odoo environment:
bash
docker-compose up -d
Step 6: Access Odoo
Open your browser and navigate to:
http://localhost:8069