# How to Install Odoo and Set Up a Development Environment

> Source: https://netray.co/erp-help/how-to-install-odoo-and-set-up-a-development-environment
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: ERP Help

## Short answer

For development, install Odoo from source: install PostgreSQL and system libraries, clone the Odoo repository at your target version, create a Python virtual environment, install requirements, then start odoo-bin with a config file and a new database. Use Docker for a quick trial. Run with developer options and create your own addons folder for custom modules.

## Kind

how-to

## System

small-erp

## Erp

Odoo (Community)

## Module

Installation / Development setup

## Query

how to install odoo

## Alternate Queries

- how to develop odoo
- install odoo on ubuntu from source
- odoo development environment setup
- run odoo with docker

## Applies To

Odoo Community 16 to 18 on Ubuntu or Debian; Windows and macOS follow the same pattern. Check the official requirements for the Python version your Odoo version supports.

## Steps

### Install Odoo from source on Ubuntu

**Items:**

- Install PostgreSQL and create a database role for your user: sudo apt install postgresql, then sudo -u postgres createuser -s your_user.
- Install system packages for building Python dependencies, such as git, python3-dev, python3-venv, libxml2-dev, libxslt1-dev, libldap2-dev, libsasl2-dev, libpq-dev and libjpeg-dev.
- Clone the Odoo repository for your version, using a shallow clone of the matching branch such as 17.0.
- Create a virtual environment, activate it, and install requirements.txt from the cloned repository.
- Install wkhtmltopdf if you need PDF reports with correct headers and footers.
- Create an odoo.conf with addons_path, db_user and an admin password, then start the server with odoo-bin -c odoo.conf.
- Open http://localhost:8069, create a database, and install a base app such as Manufacturing or Sales to confirm it works.

## Sections

### Choosing an install method

**Body:**

Source install gives you full control, the ability to debug and the ability to switch branches, which is why developers prefer it. Packaged installs from the official Debian or RPM packages are quicker for servers. Docker is the fastest way to try a version without touching your machine. Windows has an installer that is convenient for evaluation, but development work is smoother on Linux or WSL.

Whichever you choose, match the Odoo version to the Python and PostgreSQL versions it supports. Mismatches cause strange dependency errors that waste hours.

### Source install commands

**Body:**

- The commands below show a typical Ubuntu setup. Adjust the branch to your target version and keep custom modules in a separate folder outside the Odoo repository so upgrades stay clean.
- The configuration file lists the folders where Odoo looks for modules. Put the standard addons first and your custom addons after them.

**Code:**

sudo apt update
sudo apt install -y git python3-venv python3-dev build-essential libpq-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libjpeg-dev postgresql
sudo -u postgres createuser -s $USER
git clone --depth 1 --branch 17.0 https://github.com/odoo/odoo.git
python3 -m venv odoo-venv
source odoo-venv/bin/activate
pip install wheel
pip install -r odoo/requirements.txt

[options]
admin_passwd = change_this_master_password
db_host = False
db_port = False
db_user = your_user
db_password = False
addons_path = /home/you/odoo/addons,/home/you/custom_addons

### Development workflow

**Body:**

Start the server in the foreground with the developer options so templates and Python reload on change. Use a dedicated development database and keep demo data on, so you can test quickly.

Odoo includes a scaffold command that creates the skeleton of a module. A module needs a manifest, a models folder and views; after creating it, update the apps list and install it, then restart with the update flag when you change models.

**Code:**

./odoo/odoo-bin -c odoo.conf -d dev_db -i base --dev=all
./odoo/odoo-bin scaffold my_module /home/you/custom_addons
./odoo/odoo-bin -c odoo.conf -d dev_db -u my_module

### Docker for a quick trial

**Body:**

The official Docker images for Odoo and PostgreSQL can be run together with a compose file. Mount a folder for your custom addons and a volume for data so that nothing is lost when the container is recreated.

Docker is an excellent way to test a version, but for step-through debugging, a source install in a virtual environment is simpler.

## Pitfalls

- Using a Python version the Odoo version does not support.
- Putting custom code inside the Odoo repository, which complicates upgrades.
- Leaving the master password at its default or exposing port 8069 publicly.
- Running as the postgres superuser or root instead of a normal role.
- Forgetting wkhtmltopdf, then wondering why PDF reports look wrong.

## Ai Angle

Once Odoo runs, developers still spend time finding the right model and field names. An assistant grounded in your Odoo schema can answer questions such as which fields hold a manufacturing order's component lines, and propose queries or ORM calls for a developer to review. Netray runs this on your own infrastructure, so an internal Odoo database is not sent to a public model.

## Faq

### What do I need to install Odoo?

**Answer:** A supported Python version, PostgreSQL, system libraries for building dependencies, and the Odoo source or package for your target version. Wkhtmltopdf is needed for good PDF output. The official documentation lists exact versions per Odoo release.

### Which Odoo version should I install?

**Answer:** For a new project, use a currently supported stable release, because older versions stop receiving fixes. If you depend on specific third-party modules, check that they support the version before you commit.

### How do I start developing a custom Odoo module?

**Answer:** Use the scaffold command to generate a module, add it to your addons path, update the apps list, and install it. Then define models in Python and views in XML, and update the module whenever you change them.

### Is Docker good enough for Odoo development?

**Answer:** Yes for trials and for running a consistent environment, if you mount your addons and data volumes. For debugging with breakpoints, a source install is often easier, though remote debugging into a container also works.

## Search terms

how to install odoo, install odoo ubuntu, odoo from source, odoo docker compose, how to develop odoo, odoo development environment, odoo scaffold module, odoo odoo-bin config

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
