Install Odoo Community & Enterprise
Clone the source repositories, create a Python virtual environment, and install all required Python dependencies.
Clone the Repositories
Clone both Community and Enterprise repositories into the directory structure created in the previous chapter.
cd /opt/odoo git clone https://github.com/odoo/odoo.git community git clone git@github.com:odoo/enterprise.git enterprise
Use the same branch for both repositories — for example master or saas-18.2.
Mixing branches between Community and Enterprise will cause dependency conflicts and runtime errors.
Checkout the correct branch
cd /opt/odoo/community git checkout saas-18.2 cd /opt/odoo/enterprise git checkout saas-18.2
Cloning the Enterprise repository requires an active Odoo Enterprise subscription and a configured SSH key registered with your GitHub account linked to Odoo.
Create a Python Virtual Environment
A virtual environment isolates Odoo's Python dependencies from the system Python installation, preventing conflicts and making it easier to manage package versions.
cd /opt/odoo python3 -m venv venv source venv/bin/activate
Verify that Python and pip are pointing to the virtual environment.
which python which pip
Both commands should output paths under /opt/odoo/venv/. If they still point to the system Python, the virtual environment was not activated correctly.
Install Python Dependencies
Upgrade the core packaging tools and then install all packages listed in Odoo's requirements file.
pip install --upgrade pip wheel setuptools pip install -r community/requirements.txt
This step can take 5–15 minutes depending on your VM's CPU and network speed. Several packages (lxml, Pillow, greenlet) require compilation from source.
Common Installation Issues
| Error | Cause | Resolution |
|---|---|---|
ModuleNotFoundError |
Missing or broken dependency | Deactivate, delete venv/, recreate and reinstall |
| PEP 668 externally-managed error | Running pip outside of venv | Activate the virtual environment with source venv/bin/activate |
lxml build failure |
Missing libxml2-dev or libxslt1-dev |
Install the missing Ubuntu package from Chapter 1 |
python-ldap failure |
Missing libldap2-dev or libsasl2-dev |
Install the missing Ubuntu package from Chapter 1 |
psycopg2 failure |
Missing libpq-dev |
Install the missing Ubuntu package from Chapter 1 |
Final Directory Layout
After this chapter, your directory tree should look like the following.
/opt/odoo/ ├── community/ ← Odoo Community (git repository) ├── enterprise/ ← Odoo Enterprise (git repository) ├── custom/ ← Your custom addons (empty for now) ├── logs/ ← Odoo log files (empty for now) └── venv/ ← Python virtual environment
Always store custom addons in the separate custom/ directory.
Placing them inside community/ or enterprise/ will cause
conflicts during git pull upgrades.
Verification
- ✓ Community repository cloned into
/opt/odoo/community - ✓ Enterprise repository cloned into
/opt/odoo/enterprise - ✓ Both repositories are on the same branch
- ✓ Virtual environment created at
/opt/odoo/venv - ✓
pip install -r requirements.txtcompleted without errors
The next chapter covers creating the production odoo.conf configuration file with the correct settings for a reverse proxy deployment.