Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/odoo/documentation/llms.txt

Use this file to discover all available pages before exploring further.

Odoo development is best done from a source install — running Odoo directly from a cloned Git repository rather than a packaged release. This gives you full access to the codebase, lets you easily switch branches, and integrates cleanly with the contribution workflow. This guide walks you through every step from a bare machine to a running Odoo server.
This guide assumes a Linux or macOS environment. Windows developers should use WSL2 (Windows Subsystem for Linux) with Ubuntu for the best experience.

Prerequisites

Before cloning the repositories, make sure the following are installed on your system:
ToolMinimum versionPurpose
Git2.xCloning and version control
Python3.10+Running the Odoo server
piplatestInstalling Python packages
PostgreSQL12+Database backend
Node.js16+Asset bundling (Less/CSS)
wkhtmltopdf0.12.5PDF report rendering

Installation Steps

1
Install system dependencies
2
On Ubuntu/Debian:
3
sudo apt-get update
sudo apt-get install -y git python3 python3-pip python3-venv \
    postgresql postgresql-contrib \
    nodejs npm wkhtmltopdf \
    libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev \
    libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \
    libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev \
    libfribidi-dev libxcb1-dev
4
On macOS (using Homebrew):
5
brew install git python@3.11 postgresql node wkhtmltopdf
6
Configure PostgreSQL
7
Create a PostgreSQL user that matches your system username so Odoo can connect without a password:
8
sudo -u postgres createuser --createdb --username postgres --no-createrole --no-superuser $USER
9
Or, for a development machine where you want full superuser access:
10
sudo -u postgres createuser -s $USER
11
Start the PostgreSQL service:
12
# Ubuntu/Debian
sudo service postgresql start

# macOS
brew services start postgresql
13
Clone the Odoo repositories
14
Create a source directory and clone both the community and enterprise repositories:
15
mkdir -p $HOME/src
cd $HOME/src

# Core Odoo (community edition)
git clone git@github.com:odoo/odoo.git

# Enterprise modules (requires Odoo partner/employee access)
git clone git@github.com:odoo/enterprise.git
16
For tutorials and training exercises, also clone the tutorials repository:
17
git clone git@github.com:odoo/tutorials.git
18
Create a Python virtual environment
19
Always work inside a virtual environment to isolate Odoo’s dependencies:
20
cd $HOME/src/odoo
python3 -m venv .venv
source .venv/bin/activate
21
Add this activation to your shell profile if you want it loaded automatically:
22
echo 'source $HOME/src/odoo/.venv/bin/activate' >> ~/.bashrc
23
Install Python dependencies
24
With the virtual environment active, install all required packages:
25
pip install --upgrade pip
pip install -r requirements.txt
26
If you encounter an AttributeError: module '<MODULE_NAME>' has no attribute '<ATTRIBUTE>' error later, try reinstalling the affected package:
pip install --upgrade --force-reinstall <MODULE_NAME>
# or reinstall everything:
pip install --upgrade --force-reinstall -r requirements.txt
27
Launch the Odoo server
28
With all dependencies installed, start Odoo using odoo-bin:
29
cd $HOME/src/odoo
./odoo-bin --addons-path="addons/,../enterprise/,../tutorials" -d rd-demo
30
Odoo will create the rd-demo database on first run, install base modules, and start listening on port 8069.
31
Log in and enable developer mode
32
Open your browser at http://localhost:8069/
33
Default credentials:
34
  • Email: admin
  • Password: admin
  • 35
    To enable developer mode (required for accessing technical menus and debugging), go to Settings → General Settings → Developer Tools → Activate the developer mode, or append ?debug=1 to any URL.

    Key odoo-bin Arguments

    ArgumentDescription
    -d <database>The PostgreSQL database to use
    --addons-path <dirs>Comma-separated list of directories scanned for modules
    -i <modules>Install modules before starting (comma-separated)
    -u <modules>Update modules before starting (comma-separated)
    --limit-time-cpu <n>Max CPU seconds per request (useful when debugging)
    --limit-time-real <n>Max wall-clock seconds per request
    --test-enableRun tests after module installation
    --test-tags <tags>Filter which tests to run
    --log-sqlLog every SQL query (useful for performance analysis)

    Common startup commands

    # Start fresh with a specific database
    ./odoo-bin -d mydb --addons-path="addons/,../enterprise/,../tutorials"
    
    # Install a module for the first time
    ./odoo-bin -d mydb -i estate --addons-path="addons/,../enterprise/,../tutorials"
    
    # Update a module after code changes
    ./odoo-bin -d mydb -u estate --addons-path="addons/,../enterprise/,../tutorials"
    
    # Disable CPU/time limits for debugging
    ./odoo-bin -d mydb --limit-time-cpu=600 --limit-time-real=1200
    

    Setting Up the Tutorials Repository

    If you are following the Server Framework 101 tutorial, configure Git to push your work to your own fork:

    Useful Git Commands

    Switch branches (keep both repos in sync)

    When switching Odoo versions, both odoo and enterprise must be on the same branch:
    cd $HOME/src/odoo
    git switch 17.0
    
    cd $HOME/src/enterprise
    git switch 17.0
    

    Fetch and rebase

    cd $HOME/src/odoo
    git fetch --all --prune
    git rebase --autostash odoo/17.0
    
    cd $HOME/src/enterprise
    git fetch --all --prune
    git rebase --autostash enterprise/17.0
    
    Most Odoo developers use VSCode, VSCodium, PyCharm, or Sublime Text. Configure your linter with these Odoo-specific exceptions: Python (PEP8 exceptions):
    • E501 — line too long
    • E301 — expected 1 blank line, found 0
    • E302 — expected 2 blank lines, found 1
    JavaScript: Use ESLint with the Odoo configuration.

    Python Debugger

    For debugging server-side Python code, use ipdb or the built-in pdb:
    pip install ipdb
    
    Set a breakpoint anywhere in Python code:
    import ipdb; ipdb.set_trace()
    
    CommandDescription
    hShow help
    nExecute next line
    sStep into function call
    cContinue execution
    u / dMove up/down the call stack
    pp <expr>Pretty-print an expression
    wPrint the current stack trace
    qQuit the debugger

    Database Administration

    Connect to your development database with psql:
    psql -d rd-demo
    
    For GUI tools, connect via Unix socket:
    • Host: /var/run/postgresql
    • Port: 5432
    • Username: your system username
    Popular GUI clients: pgAdmin and DBeaver.

    Clearing Python Cache

    If you experience mysterious import errors after switching branches, clear the Python bytecode cache:
    find $HOME/src/odoo -name '*.pyc' -type f -delete
    find $HOME/src/odoo -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
    

    Build docs developers (and LLMs) love