Skip to content

Complete Guide to odoo.conf Configuration

DeployMonkey Team · March 11, 2026 9 min read

The odoo.conf file controls nearly every aspect of how Odoo runs: how it connects to the database, how many workers it spawns, how much memory each worker can use, where it writes logs, and how it behaves behind a reverse proxy. Most default values are wrong for production. This guide covers every important setting with production-appropriate recommendations.

Where odoo.conf Lives

Default locations by installation type:

  • Native package install: /etc/odoo/odoo.conf
  • Docker (official image): /etc/odoo/odoo.conf (mount your own to override)
  • Source install: specify with --config /path/to/odoo.conf

The file uses Python's ConfigParser format. All settings go under the [options] section:

[options]
key = value

Database Settings

[options]
; PostgreSQL connection
db_host = localhost          ; or 'db' for Docker, False for Unix socket
db_port = 5432               ; False for Unix socket default
db_name = odoo               ; or False to show database selector
db_user = odoo
db_password = your_password  ; or False if using peer auth

; Connection pool
db_maxconn = 64              ; max DB connections per worker
                         ; keep below PostgreSQL max_connections / workers

For Unix socket connections (faster on same-host PostgreSQL), set db_host = False and db_port = False. The Odoo process must run as the same OS user as the PostgreSQL role, or use peer authentication.

Addons Path

addons_path = /usr/lib/python3/dist-packages/odoo/addons,/mnt/extra-addons,/mnt/enterprise

List all directories that contain Odoo modules, comma-separated. Order matters — Odoo loads the first match when module names conflict. Always put the official addons path first, then community/custom paths.

Data Directory

data_dir = /var/lib/odoo

This is where Odoo stores file attachments, sessions, and the filestore. In Docker, this must be a mounted volume or data is lost on container restart. In production, ensure this directory is on a disk with sufficient space — a busy Odoo instance can accumulate gigabytes of attachments.

Worker Configuration

This is the most impactful set of settings for performance and stability. See the full worker configuration guide for details.

; Set workers > 0 to enable multi-process mode (required for production)
; Formula: (CPU cores * 2) + 1
workers = 4

; Cron workers (separate from HTTP workers)
max_cron_threads = 1         ; 1 for most deployments, 2 for heavy scheduled tasks

; Long-polling workers for real-time features
; Handled by gevent, not counted in 'workers'

With workers = 0, Odoo runs in single-threaded mode. This is fine for development but means one slow request blocks all others in production.

Memory Limits

; Hard limit — worker is killed when exceeded (bytes)
limit_memory_hard = 2684354560   ; 2.5 GB

; Soft limit — worker restarts gracefully after current request (bytes)
limit_memory_soft = 2147483648   ; 2 GB

; These limits apply per worker process

Set limit_memory_soft to roughly 80% of limit_memory_hard. Odoo workers are expected to grow and restart — this is normal. If workers are restarting constantly, you need more RAM or fewer workers.

In Docker, set your container memory limit slightly above limit_memory_hard * workers. If the container limit is too low, the OOM killer terminates the container before Odoo can self-limit.

Time Limits

; CPU time limit per request (seconds)
limit_time_cpu = 600

; Real (wall clock) time limit per request (seconds)
limit_time_real = 1200

; Real time limit for long-polling connections
limit_time_real_cron = 1800     ; allow longer for cron jobs

These prevent runaway requests from consuming CPU indefinitely. A request hitting limit_time_cpu raises a WorkerTimeoutError and the worker is restarted. For Odoo instances doing heavy data processing (imports, reports), you may need to raise these values.

Request Size Limits

; Maximum size of HTTP request body (bytes)
limit_request = 8388608         ; 8 MB default

; Increase for large file uploads (e.g., document management)
; limit_request = 67108864      ; 64 MB

Proxy Mode

; REQUIRED if running behind Nginx or any reverse proxy
proxy_mode = True

With proxy_mode = True, Odoo trusts the X-Forwarded-For and X-Forwarded-Proto headers from the reverse proxy. Without this, all requests appear to come from localhost, breaking IP-based rate limiting and audit logs. With this set but no reverse proxy, users can spoof their IP address — never enable it on a server directly exposed to the internet.

Logging

; Log file path (omit to log to stdout)
logfile = /var/log/odoo/odoo.log

; Log level: debug, info, warn, error, critical
log_level = warn               ; use 'info' temporarily when debugging

; Rotate logs
logrotate = True

; Per-module log levels (override global)
log_handler = :WARNING,odoo.http.rpc.request:INFO

In Docker, log to stdout (omit logfile) and use Docker's logging driver for rotation. On native installs, use logrotate system tool with a config in /etc/logrotate.d/odoo.

XMLRPC and Long-Polling Ports

; HTTP port (default 8069)
http_port = 8069

; Long-polling port for real-time features (default 8072)
longpolling_port = 8072

; Bind address (0.0.0.0 for all interfaces, 127.0.0.1 for localhost only)
http_interface = 127.0.0.1     ; always use 127.0.0.1 if behind a reverse proxy

Binding to 127.0.0.1 instead of 0.0.0.0 prevents direct access to Odoo from the internet, forcing all traffic through your reverse proxy. This is a critical security setting. See our Odoo security best practices guide.

Admin Password (Master Password)

; Master password for the database manager
; Set a strong value — this controls database creation/deletion
admin_passwd = your_very_strong_master_password

; Or disable the database manager entirely (recommended for single-DB production)
; list_db = False

See the full guide on changing the Odoo master password.

Email

; SMTP for outgoing mail (can also configure in Settings UI)
smtp_server = smtp.gmail.com
smtp_port = 587
smtp_ssl = starttls            ; or 'ssl' for port 465, False for no encryption
smtp_user = [email protected]
smtp_password = your_app_password

; From address for system emails
email_from = [email protected]

Security Settings

; Disable debug mode activation via URL (recommended for production)
; Users cannot add ?debug=1 to the URL
; Enforce via Odoo Settings UI: Technical > System Parameters > web.base.url

; Disable database selector (recommended for single-DB deployments)
list_db = False

Complete Production odoo.conf Template

[options]
; Database
db_host = localhost
db_port = 5432
db_name = odoo
db_user = odoo
db_password = CHANGE_THIS
db_maxconn = 64

; Paths
addons_path = /usr/lib/python3/dist-packages/odoo/addons,/mnt/extra-addons
data_dir = /var/lib/odoo

; Workers (adjust for your CPU count)
workers = 4
max_cron_threads = 1

; Memory (2 GB soft / 2.5 GB hard)
limit_memory_soft = 2147483648
limit_memory_hard = 2684354560

; Time limits
limit_time_cpu = 600
limit_time_real = 1200

; Network
http_interface = 127.0.0.1
http_port = 8069
longpolling_port = 8072
proxy_mode = True

; Logging
logfile = /var/log/odoo/odoo.log
log_level = warn

; Security
admin_passwd = CHANGE_THIS_TO_STRONG_PASSWORD
list_db = False

How DeployMonkey Manages Configuration

On DeployMonkey, odoo.conf is generated and managed automatically based on your plan and instance settings. Worker counts are tuned to your allocated CPU, memory limits match your plan's RAM allocation, and proxy mode is always enabled since every instance sits behind our load balancer.

You can view and override specific settings from the DeployMonkey control panel — no SSH or file editing required. Configuration changes are applied with a controlled restart and verified with a healthcheck before traffic is routed back.

Start your free instance and get a correctly configured Odoo from day one.

Frequently Asked Questions

Can I put sensitive values like db_password in environment variables instead?

Yes. Odoo reads environment variables prefixed with ODOO_ or set via the --db-password CLI flag. In Docker, use Docker secrets (mounted as files) and reference the file path — more secure than environment variables that can appear in process listings.

What happens if I set workers = 0 in production?

Odoo runs in single-threaded mode. One slow request (large report, import) blocks all other users. For any production deployment with more than one concurrent user, set workers to at least 2.

How do I apply odoo.conf changes without restarting?

You cannot — odoo.conf is read at startup. To apply changes, restart the Odoo service or container. For Docker: docker compose restart odoo.

Does limit_memory_hard apply to the entire Odoo process or per worker?

Per worker process. With 4 workers, your total memory usage could reach 4 × limit_memory_hard plus the main process. Size your server RAM accordingly.