Create the Configuration File

Create the configuration directory and open the main configuration file in your editor of choice.

bash
sudo mkdir -p /etc/odoo
sudo nano /etc/odoo/odoo.conf

Paste the following production-ready configuration.

ini
[options]

admin_passwd = CHANGE_ME

db_user = odoo

addons_path = /opt/odoo/community/addons,/opt/odoo/custom,/opt/odoo/enterprise

logfile = /opt/odoo/logs/odoo.log

proxy_mode = True
http_interface = 127.0.0.1

workers = 0
max_cron_threads = 1

dbfilter = ^master$
list_db = False

limit_memory_soft = 268435456
limit_memory_hard = 536870912

limit_time_cpu = 120
limit_time_real = 240
Change the admin password

Replace CHANGE_ME with a strong, unique password. This password controls access to the Odoo database manager. Keep this file readable only by the odoo user.

Set correct file permissions.

bash
sudo chown odoo:odoo /etc/odoo/odoo.conf
sudo chmod 640 /etc/odoo/odoo.conf

Configuration Option Reference

OptionValuePurpose
proxy_modeTrueTrust X-Forwarded-* headers sent by Nginx. Required for HTTPS to work correctly.
http_interface127.0.0.1Bind Odoo to localhost only. Prevents direct public access to port 8069.
addons_pathcomma-separated pathsDirectories where Odoo looks for addons. Order matters: Community → Custom → Enterprise.
dbfilterregexRestrict Odoo to databases matching this regular expression. Prevents accidental exposure of other databases.
list_dbFalseHide the database selector page from the login screen.
workers0Use single-threaded mode. Set to 2 or more for multi-process mode on larger servers.
max_cron_threads1Number of threads dedicated to scheduled actions.

Database Configuration

Because this guide uses Unix socket authentication (peer auth), no TCP database credentials are required. The following options can be omitted or left blank.

bash
db_host =
db_port =
db_password =
Local socket authentication

PostgreSQL peer authentication allows the odoo OS user to connect to the odoo PostgreSQL role via a Unix domain socket without a password. This simplifies configuration and avoids storing credentials in the config file.

Memory Tuning

The values in this guide are suitable for a small Oracle Cloud Free Tier VM with approximately 1 GB RAM.

OptionValueMeaning
limit_memory_soft268 MBWorker is recycled when it exceeds this threshold
limit_memory_hard512 MBWorker is killed immediately if it exceeds this threshold
limit_time_cpu120 sMaximum CPU time per request
limit_time_real240 sMaximum wall-clock time per request
Production servers

For production servers with more RAM, increase limit_memory_soft and limit_memory_hard proportionally. Enable multi-process mode by setting workers to 2–4 per CPU core.

Verification

Test the configuration by starting Odoo manually before creating the systemd service.

bash
sudo -u odoo /opt/odoo/venv/bin/python3 /opt/odoo/community/odoo-bin \
    -c /etc/odoo/odoo.conf --stop-after-init

After the systemd service is created, verify it like this.

bash
sudo systemctl restart odoo
sudo systemctl status odoo --no-pager
tail -50 /opt/odoo/logs/odoo.log
  • Configuration file created at /etc/odoo/odoo.conf
  • admin_passwd changed from the default
  • proxy_mode = True is set
  • http_interface = 127.0.0.1 is set
  • addons_path includes Enterprise
  • File permissions: owner odoo, mode 640
Back to top