Odoo is a well-known open-source platform built for ERP and CRM work. Companies use it to manage accounting, inventory, sales, and projects, and many run these modules together as one connected system.
Docker keeps the Odoo installation self-contained. Everything Odoo needs remains inside the container, so an update or migration never touches the rest of your Ubuntu server. Fewer conflicts, cleaner rollbacks, and an environment you can replicate on another machine in minutes.
This article covers the full process for installing Odoo on Ubuntu with Docker: setting up Docker Compose, writing the configuration files, and launching Odoo for the first time.
How Do You Install Odoo Using Docker on Ubuntu?
Follow the steps below in order, since each one depends on the setup from the last.
Step 1: Update Your Ubuntu System
Before touching Docker or Odoo, get the server current with sudo apt update and sudo apt upgrade. Open your terminal and run:
sudo apt update && sudo apt upgrade -y
This pulls the latest package lists and patches. An outdated system often causes most installation errors, so it’s worth taking a moment to update your system.
Step 2: Install Docker and Docker Compose
Docker handles the containers themselves, while Docker Compose lets you manage several of them as one unit. You’ll need both here, because Odoo runs alongside a separate PostgreSQL container for its database.
Install the Compose plugin:
sudo apt install docker-compose-plugin
Then check that it installed correctly:
docker compose version
If a version number is displayed, you can proceed.
Related Read: What Is PostgreSQL? A Beginner-Friendly Guide
Step 3: Create a Project Directory
Please allocate a dedicated space for your Odoo setup on the server, rather than distributing files throughout the filesystem. Create the folder and switch into it:
mkdir ~/odoo && cd ~/odoo
Everything else in this guide—the Compose file, configuration, and custom addons—lives inside this directory.
Step 4: Set Up the Docker Compose File
Define the Compose file to establish Odoo and PostgreSQL as services. Open a new file for it:
nano docker-compose.yml
Paste in the following:
version: '3.8'
services:
web:
image: odoo:17.0
depends_on:
db:
condition: service_healthy
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config/odoo.conf:/etc/odoo/odoo.conf
- ./addons:/mnt/extra-addons
restart: always
networks:
- odoo-net
db:
image: postgres:15
environment:
- POSTGRES_DB=odoo
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- odoo-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U odoo"]
interval: 10s
timeout: 5s
retries: 5
restart: always
networks:
- odoo-net
volumes:
odoo-web-data:
odoo-db-data:
networks:
odoo-net:
driver: bridge
Two services are defined here: web for Odoo and db for PostgreSQL, plus the volumes that keep your data intact across restarts.
Now pull your database credentials out of that file and into a separate .env file:
nano .env
POSTGRES_USER=odoo
POSTGRES_PASSWORD=your_strong_password
Swap in your password here. Separating credentials this way is a small practice, but it matters once this setup moves to production or is shared with a team.
Related Read: Odoo review: Is it the right ERP for your business?
Step 5: Configure Odoo Settings
Set up the folders for configuration and any custom add-ons you plan to use later:
mkdir -p ~/odoo/config ~/odoo/addons
touch ~/odoo/config/odoo.conf
Open the config file:
nano ~/odoo/config/odoo.conf
Add the following:
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
admin_passwd = your_strong_password
db_host = db
db_port = 5432
db_user = odoo
db_password = your_strong_password
dbfilter = .*
Use your own passwords, not the placeholders. Port 8069 already taken? In the Compose file, set the mapping to “8080:8069“. Odoo runs on 8080 after that.
Step 6: Start the Docker Containers
From your project folder, bring the containers up in detached mode:
cd ~/odoo
docker compose up -d
This one command pulls both images, sets up the container network, and creates the volumes Odoo needs to store its data. It all runs in the background, freeing your terminal immediately.
Related Read: How to Install Docker on Ubuntu?
Step 7: Verify the Containers Are Running
Run this to check on your containers:
docker ps
You should see two entries, one for Odoo and one for PostgreSQL, both marked Up under STATUS. If either one is missing, run docker ps -a to spot stopped containers, then check the logs to identify the cause.
Step 8: Access the Odoo Web Interface
Head to your browser and open:
http://your_server_ip:8069
Use your server’s real IP address in place of your_server_ip, plus the port number if you set a different one in Step 5.
You’ll land on a database setup screen first. Please provide a name, an admin email, and a password, and let us know if you would like demo data loaded as well, as this information can be useful for experimentation.
Once that’s done, Odoo drops you in as the admin. From here you can install apps, bring your team on board, and start setting things up the way your business actually works.
A Few Important Considerations
A working install is just the starting point. A few habits can help you avoid future issues:
Passwords deserve real attention.
The admin and database passwords guard your entire Odoo instance. Don’t leave defaults in place once you move past testing.
Backups aren’t optional.
Everything your business depends on stays inside that PostgreSQL volume. Please establish a backup schedule now, before the need arises.
Updates should be deliberate, not automatic.
When a new Odoo version comes out, update the image tag in your Compose file, then run docker compose pull and docker compose up -d. Check that your custom modules still work before rolling the output on a live system.
Hardware matters more than people expect.
Odoo runs fine on 2GB of RAM and two CPU cores for smaller setups, but plan to scale those numbers up as your team and data grow.
Your .env file is sensitive.
Treat it like a password vault. Keep it off GitHub and out of anywhere your team’s public repos might expose it.
Check in on your containers occasionally.
A quick docker ps and a glance at the logs now and then can catch problems early, especially right after an update or a configuration change.
