The odoo.conf configuration file is the heart of every Odoo ERP installation. It is where we define the most important parameters affecting the whole system - from the database connection and network settings to performance tuning. Configuring this file correctly is crucial for stable and secure Odoo operation.
Where to find the odoo.conf file?
The location of the configuration file depends on the operating system and how Odoo was installed. The most common locations are:
- Linux (Ubuntu/Debian): /etc/odoo/odoo.conf or /etc/odoo.conf
- Windows: C:\Program Files\Odoo\server\odoo.conf
- Source installation: in the Odoo root directory or in the location specified at startup
- Docker installation: the file is mounted as a volume or replaced by environment variables
- pip installation: the file is created manually in a location of your choice
If you are just installing Odoo, read our guide on how to install Odoo on Ubuntu or how to install Odoo on Windows.
Basic structure of the odoo.conf file
The odoo.conf file uses the INI format, where parameters are grouped into sections. The main section is [options], where we define all the key system settings. The basic structure looks like this:
[options] parameter = value
Most important configuration parameters
Database settings
Configuring the PostgreSQL database connection is the absolute basis. The key parameters are:
- db_host: database server address (default: localhost)
- db_port: PostgreSQL port (default: 5432)
- db_user: database user name
- db_password: database password
- db_name: name of a specific database (optional, can be omitted for multi-database setups)
- db_filter: regular expression filtering the available databases - in production it prevents access to unwanted databases
- db_maxconn: maximum number of database connections (default: 64)
Example configuration:
db_host = localhost db_port = 5432 db_user = odoo db_password = StrongPassword123 db_filter = ^production_db$
The db_filter parameter is particularly important in multi-database environments - you can use expressions such as ^%h$ (matching the host name) or ^production_.*$ (all databases starting with "production_").
You will find details on database configuration in the article how to configure a PostgreSQL database for Odoo.
Network settings
Network parameters define how Odoo communicates with the outside world:
- http_port: HTTP port (default: 8069)
- http_interface: network interface (default: 0.0.0.0 - all interfaces; in production often 127.0.0.1 for a proxy)
- proxy_mode: mode for running behind a reverse proxy such as Nginx or Apache (True/False) - enables handling of X-Forwarded-* headers
- longpolling_port: port for longpolling/websocket (default: 8072) - used in Odoo 19 for real-time communication
- gevent_port: alternative name for longpolling_port in some versions
Example:
http_port = 8069 http_interface = 127.0.0.1 proxy_mode = True longpolling_port = 8072
In Odoo 19, longpolling is essential for real-time features such as chat, notifications and interface updates. Make sure this port is also configured correctly in your reverse proxy.
If you want to change the default port, check our guide on how to change the Odoo port.
Paths and directories
Odoo requires several key paths to be defined:
- addons_path: paths to the module directories (comma-separated) - order matters, the first path has priority
- data_dir: directory for data files, user sessions, attachments and the filestore - must be writable by the Odoo user
- logfile: path to the log file (if not set, logs go to stdout)
Example:
addons_path = /opt/odoo/addons,/opt/odoo/custom-addons data_dir = /var/lib/odoo logfile = /var/log/odoo/odoo.log
The data_dir directory is critical for the system to work - it stores not only attachments but also user sessions. Make sure it has the proper permissions (usually owner: odoo:odoo, permissions: 750).
The addons_path parameter is especially important when installing custom modules - read more in the article how to install external modules in Odoo.
Performance and optimization
The odoo.conf file lets you fine-tune performance parameters:
- workers: number of worker processes (0 = multithreaded mode for development, >0 = multiprocessing for production)
- max_cron_threads: maximum number of threads for cron jobs (default: 2)
- limit_memory_soft: soft memory limit per worker in bytes - when exceeded, the worker exits after finishing its current request
- limit_memory_hard: hard memory limit per worker in bytes - the process is killed immediately when exceeded
- limit_time_cpu: maximum CPU time for a single request in seconds
- limit_time_real: maximum real time (wall time) for a single request in seconds
- limit_request: number of requests before a worker is automatically restarted - prevents memory leaks
Example configuration for a production server:
workers = 4 max_cron_threads = 2 limit_memory_soft = 2147483648 limit_memory_hard = 2684354560 limit_time_cpu = 600 limit_time_real = 1200 limit_request = 8192
The number of workers should be adjusted to the server's resources. A good starting point is: (number_of_CPU_cores × 2) + 1, but this needs to be tested under real load. Remember that each worker needs RAM - for small installations 2-4 workers may be enough.
Make sure your server meets the appropriate system requirements for Odoo 19.
Security
Key security parameters in the odoo.conf file:
- admin_passwd: master password for managing databases - without it, creating/deleting databases through the interface is impossible
- list_db: whether to show the list of databases (True/False) - always set to False in production
- db_maxconn: maximum number of database connections
- without_demo: whether to install demo data when creating a new database (True/False) - set to True in production
Security recommendations:
admin_passwd = SuperStrongMasterPassword456! list_db = False db_maxconn = 64 without_demo = True
The admin_passwd password should be long (at least 20 characters), random and stored securely. In high-security environments, consider using environment variables instead of keeping the password in a text file.
Example of a complete odoo.conf file
Below is an example of a comprehensive configuration file for an Odoo 19 production environment:
[options] # Database db_host = localhost db_port = 5432 db_user = odoo db_password = SecureDBPassword db_filter = ^production_.*$ db_maxconn = 64 # Network http_port = 8069 http_interface = 127.0.0.1 proxy_mode = True longpolling_port = 8072 # Paths addons_path = /opt/odoo/addons,/opt/odoo/enterprise,/opt/odoo/custom data_dir = /var/lib/odoo logfile = /var/log/odoo/odoo.log # Performance workers = 6 max_cron_threads = 2 limit_memory_soft = 2147483648 limit_memory_hard = 2684354560 limit_time_cpu = 600 limit_time_real = 1200 limit_request = 8192 # Security admin_passwd = MasterPassword789! list_db = False without_demo = True # Logging log_level = info log_handler = :INFO
How to apply changes to the odoo.conf file?
After editing the configuration file, you need to restart the Odoo service. Depending on the operating system:
Linux (systemd):
sudo systemctl restart odoo
Docker:
docker restart odoo # or for docker-compose: docker-compose restart odoo
Windows:
Restart the Odoo service via Windows Service Manager or:
net stop odoo-server net start odoo-server
Manual start:
./odoo-bin -c /path/to/odoo.conf
After the restart, check the logs to make sure Odoo started properly and loaded the new configuration.
Common problems and solutions
While configuring the odoo.conf file you may run into some typical problems:
- Database connection error: check the db_host, db_port, db_user and db_password parameters. Make sure PostgreSQL is running and accepting connections.
- Odoo does not start: verify the file syntax and directory permissions. Check the logs to see the exact error message.
- No access to modules: make sure the addons_path is correct and the directories exist and have the appropriate read permissions.
- Performance issues: adjust the number of workers to the server's resources. Too many workers can slow the system down through excessive memory consumption.
- Websocket/longpolling not working: check the longpolling_port configuration and make sure the reverse proxy forwards WebSocket connections.
- data_dir permission issues: the directory must be writable by the user running Odoo (usually the 'odoo' user).
Configuration best practices
To ensure Odoo runs optimally, it is worth following a few proven rules:
- Always back up the odoo.conf file before modifying it
- Use strong, unique passwords for admin_passwd and db_password - at least 20 characters with uppercase letters, lowercase letters, digits and special characters
- Do not store odoo.conf in a git repository - use environment variables or separate configuration files, and add odoo.conf to .gitignore
- Review the logs regularly to detect potential problems before they affect users
- Adjust the number of workers to the number of CPU cores and available RAM - test under real load
- In production, always set list_db = False and without_demo = True for security
- Monitor memory usage and adjust the limit_memory_soft and limit_memory_hard limits accordingly
- Use proxy_mode = True when Odoo runs behind Nginx or Apache
- Update the admin_passwd password regularly and store it in a secure password manager
- Document any custom settings in comments in the configuration file
FAQ - Frequently Asked Questions
Where is the default odoo.conf file located after installation?
The location of the odoo.conf file depends on the operating system and installation method. On Linux (Ubuntu/Debian) systems, when installed from a package, it is usually at /etc/odoo/odoo.conf. On Windows it is at C:\Program Files\Odoo\server\odoo.conf. If you installed Odoo from source or via pip, the file may not exist by default - in that case you need to create it manually in a location of your choice and point to it at startup with the -c parameter. In Docker installations the file is usually mounted as a volume from the host.
How to set the number of workers in odoo.conf?
The number of workers should be adjusted to the server's resources and the actual load. A popular starting point is the formula: (number_of_CPU_cores × 2) + 1. For example, for a server with 4 cores: workers = 9. In practice, however, fewer are often enough - for small installations 2-4 workers may be optimal. Remember that workers = 0 means multithreaded mode (suitable only for development), while a value greater than 0 enables multiprocessing mode (required for production). Each worker needs about 200-300 MB of RAM plus memory for handling requests, so make sure the server has sufficient resources. It is best to test different values under real load.
Can I have multiple odoo.conf configuration files?
Yes, you can and should create separate configuration files for different environments (development.conf, staging.conf, production.conf). When starting Odoo you specify the file with the -c parameter, for example: ./odoo-bin -c /path/to/production.conf. This approach makes it easy to switch between configurations and keeps settings for different environments better organized. You can also use environment variables to override selected parameters without modifying the file. In containerized environments (Docker), separate files for each environment are often used, mounted as volumes.
Summary
Correct configuration of the odoo.conf file is the foundation of stable and efficient Odoo ERP operation. Understanding the individual parameters allows you to tailor the system optimally to specific business requirements and technical infrastructure. In Odoo 19, pay special attention to the longpolling_port configuration for real-time features, as well as appropriate workers and memory limit settings for system stability. Remember to review and update the configuration regularly as your organization grows and your needs change.
If you run into problems during configuration or need help optimizing Odoo, don't hesitate to contact KK Innovations. Our team of experts has extensive experience implementing and configuring Odoo systems for companies of all sizes. We will help you create an optimal configuration tailored to your business and technical needs.