Install Odoo ERP using Docker and Docker Compose

This guide will help you set up and install Odoo, an open-source ERP and CRM system, using Docker and Docker Compose. Odoo is known for its modular approach, allowing businesses to customize and expand their systems as needed.

Prerequisites

  • Docker installed on your system
  • Docker Compose installed on your system

Create a Directory for Odoo

Create a new directory for the Odoo project and navigate into it:

mkdir odoo-docker
cd odoo-docker

Create the docker-compose.yml File

Create a docker-compose.yml file in the directory with the following content:

version: '3.1'

services:
  web:
    image: odoo:16.0
    container_name: odoo-web
    depends_on:
      - db
    ports:
      - "8069:8069"
    environment:
      - HOST=db
      - USER=odoo
      - PASSWORD=odoo
    volumes:
      - odoo-data:/var/lib/odoo
      - ./config:/etc/odoo
      - ./addons:/mnt/extra-addons

  db:
    image: postgres:13
    container_name: odoo-db
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=odoo
      - POSTGRES_PASSWORD=odoo
    volumes:
      - db-data:/var/lib/postgresql/data

volumes:
  odoo-data:
  db-data:

Configure the Environment Variables

In the docker-compose.yml file, you can adjust the environment variables as needed:

  • POSTGRES_DB: The name of the database for Odoo.
  • POSTGRES_USER: The username for the database.
  • POSTGRES_PASSWORD: The password for the database.

Start the Docker Containers

Run the following command to start all the services:

docker-compose up -d

This command will pull the necessary Docker images and start the containers for Odoo and PostgreSQL.

Access Odoo

Once the containers are up and running, open your web browser and navigate to http://localhost:8069. This will take you to the Odoo login and setup screen.

Stopping the Containers

To stop the running containers, use the following command:

docker-compose down

This command will stop and remove the containers, but your data will remain intact in the volumes.

Final Note

Using Docker and Docker Compose to install Odoo simplifies the setup process, allowing you to quickly deploy Odoo with PostgreSQL. This setup is ideal for development environments and can be adapted for production use as well.








Open-source Apps

9,500+

Medical Apps

500+

Lists

450+

Dev. Resources

900+