
How to Install Docker & Docker Compose on Ubuntu, Windows, and macOS
- Taral Desai
- Odoo setup , Application
- April 4, 2022
Table of Contents
In this guide, weâll walk you through installing Docker and Docker Compose on Ubuntu (Linux), Windows, and macOS.
đł Why Install Docker for Odoo?
Planning to work with Odoo? Whether you’re setting it up for development, testing custom modules, or deploying it for production, Docker makes your life a lot easier.
Instead of going through the hassle of installing Odoo, PostgreSQL, and all the required dependencies manually, Docker allows you to launch everything with just one command. You get a fully functional Odoo environment that works consistently across different machines.
With Docker, you package Odoo and all its services into isolated containers that are easy to manage, replicate, and scale.
Tip
If you’re installing Docker on your system, this is your first step toward a smoother and faster Odoo setup.
đŚ Whatâs Docker Compose?
Docker Compose is a tool for defining and running multi-container Docker applications. Think of it as a YAML-powered orchestration system. Want to spin up Odoo with a PostgreSQL database? Just a few lines of code in docker-compose.yml, and your entire ERP environment is ready to run.
Example docker-compose.yml
:
services:
web:
image: odoo:18.0
depends_on:
- db
ports:
- "8069:8069"
db:
image: postgres:15
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
Tip
With this setup, running docker compose up will start both Odoo and PostgreSQL, giving you a complete local Odoo instance in seconds.
âď¸ Installation
OS requirements
To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions:
- Ubuntu Oracular 24.10
- Ubuntu Noble 24.04 (LTS)
- Ubuntu Jammy 22.04 (LTS)
- Ubuntu Focal 20.04 (LTS)
Set up Docker’s
apt
repository.sudo apt update sudo apt install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg echo \ "deb [arch=$(dpkg --print-architecture) \ signed-by=/etc/apt/keyrings/docker.gpg] \ https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Install the Docker packages.
To install the latest version, run:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Verify the installation.
docker --version docker compose version
Post-Installation: Run Without sudo
on Ubuntu
By default, Docker runs as the root
user and uses a Unix socket that only root
can access. Thatâs why you need to use sudo
with Docker commands.
The docker
Group Fix
To run Docker without sudo
, you can add your user to the docker
group. This group has access to the Docker socket.
Info
Many Linux systems create the docker
group when you install Docker.
Steps to Enable Docker Without sudo
- Create the docker group (if it doesnât exist):
sudo groupadd docker
- Add your user to the group:
sudo usermod -aG docker $USER
- Apply the group change:
Log out and log back in. This is important!
Note
If youâre using Linux inside a virtual machine, you may need to restart the VM for changes to take effect.
Alternatively, you can run:
newgrp docker
- Test it:
docker run hello-world
If everything works, youâll see a welcome message from Docker without using sudo
.
Warning
Anyone in the docker
group can control Docker and the systemâjust like root
. This is convenient but comes with risk. Only add users you trust.
If you’re concerned, check out Docker Rootless Mode, which lets you run Docker without giving users root-level access.
Fix Permission Errors
If you used sudo
with Docker before, you might see this error:
WARNING: Error loading config file: /home/user/.docker/config.json -
stat /home/user/.docker/config.json: permission denied
To fix it, reset the ownership of the .docker
folder:
sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g+rwx "$HOME/.docker" -R
Install WSL 2 (If You Havenât Already)
Docker Desktop uses WSL 2 as its default backend. If you havenât installed WSL 2 yet, hereâs how to do it:
Open PowerShell as Administrator and run:
wsl --install
Reboot/ Restart your computer if prompted.
Warning
If youâre on an older version of Windows, you might need to install WSL manually. See the official guide here.
Download and Install Docker Desktop
Note
Docker Desktop includes Docker Compose along with Docker Engine and Docker CLI which are Compose prerequisites.
Head over to the Docker Desktop for Windows page and download the installer.
Run the installer and follow the prompts:
- It will ask to install WSL 2 features and integration if not already installed.
- Check the option to use WSL 2 as the backend.
After installation, launch Docker Desktop. You may need to sign in or create a Docker Hub account (free).
Verify the Docker CLI & Docker Compose installation.
docker --version docker compose version
Info
Docker Desktop now includes Docker Compose by defaultâno need for a separate install!
OS requirements
- macOS Monterey (12.0) or later
- At least 4 GB RAM
- Apple Silicon (M1/M2) or Intel processor
Docker Desktop supports both architectures.
Download and Install Docker Desktop
Click “Download for Mac (Apple Chip)” or “Download for Mac (Intel Chip)” depending on your Mac.
Open the
.dmg
file and drag the Docker icon into the Applications folder.Launch Docker from Applications (youâll see the little whale icon in your menu bar).
Verify the Docker CLI & Docker Compose installation.
docker --version docker compose version
Note
Docker may ask for system permissionsâgrant them. It needs privileged access to run virtual machines.
Info
Docker Desktop now includes Docker Compose by defaultâno need for a separate install!
â Youâre All Set!
By now, Docker and Docker Compose should be up and running on your system. Youâre ready to launch Odoo or any other containerized app with ease.
Test your installation by running:
docker run hello-world
This will pull a test image and confirm everything is working correctly.
đ Conclusion
Docker and Docker Compose simplify application setup, especially for platforms like Odoo that depend on multiple services. With containers, you can replicate environments, test modules, and deploy fasterâall without the usual installation headaches.
Now that your system is ready, start exploring Dockerized Odoo, build custom modules, or connect to other servicesâall in a neat, isolated workspace.
Happy Odooing & Dockering! đł