Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 39 ยท Concepts and Setup

Installing Odoo from Source and with Docker

Install Odoo Community for development, either from the Git source with a Python virtual environment or with Docker Compose, and start your first database.

To develop for Odoo you need a running server on your own machine. There are two popular ways: run the Python source code directly (best for debugging and for learning how Odoo works) or use the official Docker images (best for a quick, repeatable setup). This lesson shows both, then explains the moving parts so you can adapt the commands to your operating system.

The Odoo server and PostgreSQL cannot run in the browser, so the commands below are read-only. The runnable example at the end is a Python stand-in that builds the same configuration text. Exact version requirements (Python, PostgreSQL, Node) change between series, so check the "Installation" page of the official documentation for your version.

What you need

  • Python of a version supported by your Odoo series.
  • PostgreSQL (a recent supported version) with a database user allowed to create databases.
  • Git to download the source.
  • wkhtmltopdf if you want to print PDF reports (chapter 7).
  • Optional: Node.js packages such as rtlcss for right-to-left languages.

Option 1: run from source

The source of the Community edition is public on GitHub. A typical Linux or macOS sequence looks like this (read-only):

Terminal
# 1. Get the code for one series (shallow clone is much smaller)
git clone --depth 1 --branch 18.0 https://github.com/odoo/odoo.git
cd odoo

# 2. Create an isolated Python environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# 3. Create a PostgreSQL user that may create databases
sudo -u postgres createuser --createdb --pwprompt odoo

# 4. Start the server and initialise a database with the base module
./odoo-bin -d demo -i base --db_user=odoo --db_password=secret

On Windows you use the same ideas with py -m venv venv, venv\Scripts\activate and python odoo-bin, and install PostgreSQL with its Windows installer. WSL2 (a Linux environment inside Windows) is often easier.

After the log shows that the HTTP service is running on port 8069, open http://localhost:8069 in your browser. The first database created with -i base has an admin user; with the default setup the login is admin and the password you choose or the default admin, which you must change before any real use.

Option 2: Docker Compose

The Odoo team publishes images named odoo with a tag for each series, and PostgreSQL has an official image too. This is the standard compose.yaml pattern (read-only):

YAML
services:
  web:
    image: odoo:18.0
    depends_on:
      - db
    ports:
      - "8069:8069"
    environment:
      HOST: db
      USER: odoo
      PASSWORD: odoo
    volumes:
      - odoo-data:/var/lib/odoo
      - ./addons:/mnt/extra-addons
  db:
    image: postgres:15
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: odoo
      POSTGRES_PASSWORD: odoo
    volumes:
      - db-data:/var/lib/postgresql/data

volumes:
  odoo-data:
  db-data:

Start it with docker compose up -d and open http://localhost:8069. Three details matter:

  • HOST, USER and PASSWORD tell the Odoo image how to reach PostgreSQL.
  • The volume odoo-data keeps the filestore and sessions when you recreate the container.
  • The folder ./addons is mounted as /mnt/extra-addons. The image already lists that path as an addons path, so any module you drop there becomes available. This is where your custom modules will live.
flowchart LR
    Host["Your machine<br/>port 8069"] --> W["web container<br/>Odoo"]
    W --> D["db container<br/>PostgreSQL"]
    W --- V1[("odoo-data volume<br/>filestore")]
    D --- V2[("db-data volume<br/>database files")]
    W --- A["./addons<br/>your modules"]

Containers can be destroyed and rebuilt; the volumes keep the data.

The database manager

On a fresh server with no database, the browser shows the database manager. You enter a master password, a database name, an email and password for the first user, a language and a country, and whether to load demo data. Demo data fills the apps with sample customers and products. It is perfect for learning, but never load it in production.

You can reach the manager later at /web/database/manager unless an administrator has disabled it (production servers should, see chapter 8).

First checks

If something fails, these three checks solve most problems:

  1. Is PostgreSQL reachable? The log line "connection refused" usually means a wrong host, port or password.
  2. Is the port free? Another program may already use 8069.
  3. Are the Python packages complete? An ImportError means pip install -r requirements.txt did not finish or ran outside the virtual environment.

A runnable stand-in: build the command

The first thing many developers do is script their start command. This stand-in builds an odoo-bin command line from a settings dictionary, which is a good way to see which options exist. It only prints text.

Python Stand-in: build an odoo-bin command

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The next lesson explains each of these options and how to store them in a configuration file instead of typing them every time.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. On which port does Odoo serve its web interface by default?

    8069 is Odoo's default HTTP port. 5432 is PostgreSQL's default.
  2. 2. In the official Docker setup, where do you place your own modules?

    The image includes /mnt/extra-addons as an addons path, so a mounted folder there is picked up.
  3. 3. Why should you avoid demo data in production?

    Demo data is sample content for learning and testing; a real database should start clean.
  4. 4. What does the -i base option do when starting odoo-bin with a new database?

    -i (--init) installs the listed modules. The base module creates the core tables.

Summary

  • Odoo needs Python, PostgreSQL and the source code (or a Docker image).
  • From source: clone one series branch, make a virtual environment, install requirements, create a PostgreSQL user, run odoo-bin.
  • With Docker: use the odoo and postgres images, mount volumes for data and a folder for custom addons.
  • The default web port is 8069, and the database manager creates the first database.
  • Load demo data only for learning and testing.

Next: odoo.conf and Command-Line Options