Complete Guide to Installing Odoo 17 on Mac, Windows, Linux and Docker

Step-by-step instructions with copy-paste commands for installing Odoo 17 on any platform

Complete Guide to Installing Odoo 17 on Mac, Windows, Linux and Docker

Table of Contents

Introduction

Odoo 17 offers significant improvements in performance, usability, and features. This guide provides step-by-step instructions for installing Odoo 17 on various platforms. All commands are formatted for easy copying and pasting.

Installing Odoo 17 on Windows

Option 1: Using the Official Windows Installer (Recommended for Beginners)

  1. Download the official Odoo 17 installer from the Odoo download page
  2. Run the downloaded .exe file
  3. Follow the installation wizard:
  • Choose installation directory
  • Configure PostgreSQL connection settings
  • Set up the master password (important for database management)

Option 2: Manual Installation on Windows

Prerequisites:

1. Python 3.10 or later: https://www.python.org/downloads/windows/
2. PostgreSQL 14 or later: https://www.postgresql.org/download/windows/
3. Git for Windows: https://git-scm.com/download/win
4. Visual Studio Build Tools: https://visualstudio.microsoft.com/visual-cpp-build-tools/

Installation Steps:

# Clone Odoo repository
git clone https://github.com/odoo/odoo.git --depth 1 --branch 17.0 --single-branch odoo17
cd odoo17

# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate

# Install dependencies
pip install setuptools wheel
pip install -r requirements.txt

# Run Odoo
python odoo-bin -c odoo.conf

Create a sample odoo.conf file with the following content:

[options]
; This is the password that allows database operations:
admin_passwd = my_secure_password
db_host = localhost
db_port = 5432
db_user = postgres
db_password = your_postgres_password
addons_path = ./addons
logfile = odoo.log

Installing Odoo 17 on Mac OS

Option 1: Using Homebrew

# Install Homebrew if you don't have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install dependencies
brew install [email protected] postgresql git node
brew services start postgresql

# Create PostgreSQL user
psql postgres -c "CREATE USER odoo WITH SUPERUSER PASSWORD 'your_password';"

# Clone Odoo repository
git clone https://github.com/odoo/odoo.git --depth 1 --branch 17.0 --single-branch odoo17
cd odoo17

# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install setuptools wheel
pip install -r requirements.txt

# Run Odoo
python3 odoo-bin -c odoo.conf

Create a sample odoo.conf file with the following content:

[options]
; This is the password that allows database operations:
admin_passwd = my_secure_password
db_host = localhost
db_port = 5432
db_user = odoo
db_password = your_password
addons_path = ./addons
logfile = odoo.log

Installing Odoo 17 on Linux (Ubuntu/Debian)

Option 1: Using the Debian/Ubuntu Package

# Add Odoo repository
wget -O - https://nightly.odoo.com/odoo.key | sudo apt-key add -
echo "deb http://nightly.odoo.com/17.0/nightly/deb/ ./" | sudo tee /etc/apt/sources.list.d/odoo.list

# Update package index and install Odoo
sudo apt-get update
sudo apt-get install odoo

# Start Odoo service
sudo systemctl start odoo
sudo systemctl enable odoo

Option 2: Manual Installation on Ubuntu/Debian

# Update system and install dependencies
sudo apt update
sudo apt upgrade -y
sudo apt install -y git python3-pip python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev xvfb libfontconfig wkhtmltopdf

# Install PostgreSQL
sudo apt install -y postgresql postgresql-client

# Create PostgreSQL user
sudo -u postgres createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo
# Enter a password when prompted

# Clone Odoo repository
git clone https://github.com/odoo/odoo.git --depth 1 --branch 17.0 --single-branch odoo17
cd odoo17

# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate

# Install Python dependencies
pip3 install setuptools wheel
pip3 install -r requirements.txt

# Create Odoo configuration file
sudo mkdir /etc/odoo
sudo cp debian/odoo.conf /etc/odoo/
sudo chown -R odoo: /etc/odoo/

# Create log directory
sudo mkdir /var/log/odoo
sudo chown -R odoo: /var/log/odoo/

# Create a dedicated system user
sudo adduser --system --home=/opt/odoo --group odoo

# Move Odoo to its final location
sudo cp -r ./ /opt/odoo/odoo17
sudo chown -R odoo: /opt/odoo

# Create systemd service file
cat <

Installing Odoo 17 with Docker

Option 1: Using the Official Odoo Docker Image

# Pull the official Odoo 17 image
docker pull odoo:17.0

# Pull the PostgreSQL image
docker pull postgres:14

# Create a network for Odoo and PostgreSQL
docker network create odoo-network

# Start a PostgreSQL container
docker run -d --name odoo-db \
  --network odoo-network \
  -e POSTGRES_USER=odoo \
  -e POSTGRES_PASSWORD=odoo \
  -e POSTGRES_DB=postgres \
  -v odoo-db-data:/var/lib/postgresql/data \
  postgres:14

# Start the Odoo container
docker run -d --name odoo17 \
  --network odoo-network \
  -p 8069:8069 \
  -e POSTGRES_USER=odoo \
  -e POSTGRES_PASSWORD=odoo \
  -e POSTGRES_DB=postgres \
  -e POSTGRES_HOST=odoo-db \
  -v odoo-web-data:/var/lib/odoo \
  -v odoo-addons:/mnt/extra-addons \
  odoo:17.0

Option 2: Using Docker Compose

Create a file named docker-compose.yml with the following content:

version: '3'
services:
  db:
    image: postgres:14
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
    volumes:
      - odoo-db-data:/var/lib/postgresql/data
    restart: always

  odoo:
    image: odoo:17.0
    depends_on:
      - db
    ports:
      - "8069:8069"
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
      - POSTGRES_HOST=db
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./addons:/mnt/extra-addons
    restart: always

volumes:
  odoo-web-data:
  odoo-db-data:

Then run:

# Start the containers
docker-compose up -d

# View logs
docker-compose logs -f

Setting Up Nginx as a Reverse Proxy

Nginx can be used as a reverse proxy to provide SSL termination and handle multiple Odoo instances.

Install Nginx

# Ubuntu/Debian
sudo apt update
sudo apt install nginx

# CentOS/RHEL
sudo yum install epel-release
sudo yum install nginx

# macOS
brew install nginx

Configure Nginx for Odoo

Create a new Nginx configuration file:

sudo nano /etc/nginx/sites-available/odoo.conf

Add the following configuration:

upstream odoo {
    server 127.0.0.1:8069;
}

upstream odoochat {
    server 127.0.0.1:8072;
}

server {
    listen 80;
    server_name your-domain.com;

    # Redirect to HTTPS
    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl;
    server_name your-domain.com;

    # SSL configuration
    ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
    ssl_session_timeout 30m;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
    ssl_prefer_server_ciphers off;

    # log
    access_log /var/log/nginx/odoo.access.log;
    error_log /var/log/nginx/odoo.error.log;

    # Increase proxy buffer size
    proxy_buffers 16 64k;
    proxy_buffer_size 128k;

    # Add Headers for Odoo proxy mode
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;

    # Increase timeouts
    proxy_read_timeout 600s;
    proxy_connect_timeout 600s;
    proxy_send_timeout 600s;

    # General proxy settings
    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

    # Handle longpoll requests
    location /longpolling {
        proxy_pass http://odoochat;
    }

    # Handle / requests
    location / {
        proxy_redirect off;
        proxy_pass http://odoo;
    }

    # Cache static files
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        proxy_cache_valid 200 304 60m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://odoo;
    }

    # Gzip
    gzip on;
    gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
    gzip_min_length 1000;
}

Enable the configuration:

sudo ln -s /etc/nginx/sites-available/odoo.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Configuring SSL with Let's Encrypt

Install Certbot

# Ubuntu/Debian
sudo apt update
sudo apt install certbot python3-certbot-nginx

# CentOS/RHEL
sudo yum install certbot python3-certbot-nginx

Obtain SSL Certificate

sudo certbot --nginx -d your-domain.com

Follow the prompts to complete the certificate issuance.

Auto-renewal Configuration

Certbot automatically creates a cron job or systemd timer for certificate renewal. You can test the renewal process with:

sudo certbot renew --dry-run

Troubleshooting

Common Issues and Solutions

PostgreSQL Connection Issues

If Odoo can't connect to PostgreSQL:

# Check PostgreSQL service status
sudo systemctl status postgresql

# Ensure PostgreSQL is listening on the right address
sudo nano /etc/postgresql/14/main/postgresql.conf
# Ensure listen_addresses = 'localhost' or '*'

# Check pg_hba.conf for proper client authentication
sudo nano /etc/postgresql/14/main/pg_hba.conf
# Add the line: host all all 127.0.0.1/32 md5

# Restart PostgreSQL
sudo systemctl restart postgresql

Permission Issues

If you encounter permission errors:

# Check Odoo log file
sudo cat /var/log/odoo/odoo.log

# Ensure correct ownership of directories
sudo chown -R odoo:odoo /etc/odoo/
sudo chown -R odoo:odoo /var/log/odoo/
sudo chown -R odoo:odoo /opt/odoo/

Port Access Issues

If you can't access Odoo on port 8069:

# Check if the port is in use
sudo netstat -tuln | grep 8069

# Check firewall settings
sudo ufw status

# Allow the port if needed
sudo ufw allow 8069/tcp

Checking Logs

# Odoo service logs
sudo journalctl -u odoo

# Odoo log file
sudo cat /var/log/odoo/odoo.log

# Docker logs
docker logs odoo17

# Nginx logs
sudo cat /var/log/nginx/odoo.error.log

Need More Help?

If you're still experiencing issues, consider:

Remember that proper server maintenance, security updates, and backups are crucial for any production Odoo deployment.

Complete Guide to Installing Odoo 17 on Mac, Windows, Linux and Docker
JD / Janeindiran January 6, 2025
Share this post
Archive