# Summary: Install Odoo (18 or 19) without Docker on Mac Use this in **another folder** to install Odoo 18 (or 19) from scratch. All steps assume a new project directory (e.g. `odoo18`). --- ## 1. Prerequisites (no sudo) - **Miniconda** – Python + conda without system install. - **PostgreSQL** – Installed via conda (no Homebrew needed). - **Odoo source** – Downloaded as ZIP or git clone. --- ## 2. One-time setup in the new folder Replace `odoo18` (or your folder name) and `18.0` (or `19.0`) as needed. ### 2.1 Download Miniconda (if not reusing existing) ```bash cd /path/to/your/odoo18 curl -sL "https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh" -o /tmp/miniconda.sh # For Intel Mac use: Miniconda3-latest-MacOSX-x86_64.sh bash /tmp/miniconda.sh -b -p ./miniconda3 ``` ### 2.2 Create conda env with Python 3.12 and PostgreSQL ```bash export PATH="$(pwd)/miniconda3/bin:$PATH" conda create -y -p ./.conda-envs/odoo python=3.12 conda install -y -p ./.conda-envs/odoo postgresql ``` ### 2.3 Get Odoo source **Option A – ZIP (no git):** ```bash curl -sL "https://github.com/odoo/odoo/archive/refs/heads/18.0.zip" -o odoo.zip unzip -q odoo.zip && mv odoo-18.0 odoo && rm odoo.zip chmod +x odoo/odoo-bin ``` **Option B – Git:** ```bash git clone https://github.com/odoo/odoo.git --branch 18.0 --depth 1 odoo chmod +x odoo/odoo-bin ``` ### 2.4 Install Python dependencies (use binary for psycopg2 if no pg_config) ```bash # Replace psycopg2 with psycopg2-binary in requirements (no PostgreSQL dev headers needed) sed 's/^psycopg2==/psycopg2-binary==/' odoo/requirements.txt > odoo/requirements-binary.txt # For Python 3.12 the line is like: psycopg2==2.9.9 ; python_version >= "3.12" ... # So: sed -i '' 's/psycopg2==2.9.9/psycopg2-binary==2.9.9/' odoo/requirements.txt OR use a copy ./.conda-envs/odoo/bin/pip install --upgrade pip wheel setuptools ./.conda-envs/odoo/bin/pip install -r odoo/requirements-binary.txt ``` (If the exact `psycopg2` line differs for 18.0, adjust the sed or edit the file to use `psycopg2-binary` for your Python version.) ### 2.5 Create addons folders and config ```bash mkdir -p addons_extra addons_enterprise ``` **odoo.conf** (in project root; paths relative to `odoo/` when running): ```ini [options] db_user = YOUR_MAC_USERNAME db_password = db_host = localhost db_port = 5432 http_interface = 127.0.0.1 http_port = 8069 addons_path = ../addons_extra,../addons_enterprise,addons ``` Replace `YOUR_MAC_USERNAME` with `whoami` output. ### 2.6 Initialize and start PostgreSQL (conda) ```bash mkdir -p pgdata .conda-envs/odoo/bin/initdb -D pgdata -U $(whoami) .conda-envs/odoo/bin/pg_ctl -D pgdata -l pgdata/logfile start ``` ### 2.7 Run script (run.sh) Use a script that runs Odoo with the conda Python and config path. Example: ```bash #!/usr/bin/env bash SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$SCRIPT_DIR" CONFIG="$SCRIPT_DIR/odoo.conf" PYTHON="$SCRIPT_DIR/.conda-envs/odoo/bin/python" cd odoo && exec "$PYTHON" odoo-bin -c "$CONFIG" "$@" ``` Save as `run.sh`, then: `chmod +x run.sh` ### 2.8 Start script (start.sh) - Start PostgreSQL if not running (check `pgdata/postmaster.pid`; if missing, run `initdb` then `pg_ctl start`). - Run `./run.sh`. ### 2.9 Stop script (stop.sh) - `pkill -f odoo-bin` - `pg_ctl -D pgdata stop` --- ## 3. Daily use | Action | Command | |---------------|--------| | Start Odoo + DB | `./start.sh` | | Stop | `./stop.sh` | | Only run Odoo | `./run.sh` (PostgreSQL must be running) | | Open app | http://localhost:8069 | | Create DB | In browser: Create database (name, master password, email). | --- ## 4. Connect to PostgreSQL (like pgAdmin on Windows) - **Tool:** DBeaver Community (or pgAdmin): https://dbeaver.io/download/ - **Connection:** Host `localhost`, Port `5432`, User `YOUR_MAC_USERNAME`, Password empty. - **Databases:** Default `postgres` has no Odoo tables. Use the **database you created in Odoo** (e.g. `test`, `myodoo`) → Schemas → public → Tables. - **pgAgent error:** Safe to ignore; click OK. Odoo does not use pgAgent. --- ## 5. Differences for Odoo 18 vs 19 | Item | Odoo 18 | Odoo 19 | |------------|--------------|----------------| | Branch/zip | `18.0` | `19.0` | | requirements.txt | Slightly different pins | Use repo’s file | | Config option | Pre-19 may use `xmlrpc_port` | Use `http_port` | Same steps; only change branch/version in clone or ZIP URL and use that version’s `requirements.txt` (with `psycopg2-binary` if needed). --- ## 6. Folder layout (target) ``` odoo18/ (or odoo19) ├── miniconda3/ ├── .conda-envs/odoo/ ├── pgdata/ ├── odoo/ (source: addons + odoo-bin) ├── addons_extra/ (custom / third-party modules) ├── addons_enterprise/ (enterprise repo contents if needed) ├── odoo.conf ├── run.sh ├── start.sh ├── stop.sh └── test_odoo.sh (optional: curl http://127.0.0.1:8069) ``` --- ## 7. .gitignore (suggested) ``` venv/ odoo/ odoo.conf pgdata/ miniconda3/ .conda-envs/ .conda-pkgs/ *.pyc __pycache__/ ``` --- You can copy this file into the new folder (e.g. `odoo18`) and follow it step by step, changing only the version (18.0/19.0) and paths as needed.