Command Line Parameter to use When Developing for Odoo 17

November 13, 2025 by
Command Line Parameter to use When Developing for Odoo 17
Liu

Odoo, a powerful open-source ERP system, offers flexible deployment and management options through its Command-Line Interface (CLI). Whether you’re running Odoo for development, testing, or production, the CLI parameters let you control how the server starts, which modules load, and where logs are written.

In this article, we’ll explore some of the most useful CLI options available in Odoo:

  • -d <database>
  • -u <modules>
  • --addons-path
  • -c <config>
  • --db-filter
  • --dev
  • -p <port>
  • --logfile


1. -d <database> — Specify the Database


This option tells Odoo which database to use when the server starts.

Example:

odoo -d mycompany_db

When you use -d, Odoo connects directly to the specified database (mycompany_db) on startup. If you omit it, Odoo will prompt you to select a database from the web interface (if database management is enabled).

Use Case:
Ideal when you want to automatically start Odoo using a particular database, especially in production environments.


2. -u <modules> — Update Modules


This parameter updates one or more modules during startup. It’s often used after making changes to custom modules or adding new ones.

Example:

odoo -d mycompany_db -u sales,crm,custom_module

What it does:
Odoo will reload and update the specified modules (sales, crm, and custom_module) in the given database.

Use Case:
Commonly used by developers after modifying module code or XML files.


3. --addons-path — Define Add-ons Directory


Odoo loads modules (add-ons) from specific directories. You can specify one or more directories using this option.

Example:

odoo --addons-path=/opt/odoo/addons,/opt/odoo/custom-addons

What it does:
Tells Odoo where to look for modules beyond the default add-ons path.

Use Case:
Useful when you maintain multiple sources of modules — for instance, official Odoo add-ons and your custom-developed modules.


4. -c <config> — Specify Configuration File


The configuration file contains all Odoo settings such as database parameters, log files, and ports.

Example:

odoo -c /etc/odoo/odoo.conf

What it does:
Loads settings from the specified configuration file instead of the default.

Use Case:
Recommended for production environments to ensure consistent server configuration.


5. --db-filter — Restrict Database Access


This option controls which databases Odoo can serve when multiple databases exist on the same PostgreSQL instance.

Example:

odoo --db-filter=mycompany.*

What it does:
Odoo will only display databases whose names start with “mycompany”.

Use Case:
Essential in multi-database setups or SaaS environments to prevent users from accessing unauthorized databases.


6. --dev — Enable Developer Mode Features


The --dev flag enables development-related tools and performance insights.

Example:

odoo --dev=reload,qweb,xml

Possible Options:

  • reload — auto-reloads Python files when changed.
  • qweb — shows QWeb template debug information.
  • xml — enables XML debugging.

Use Case:
Perfect for developers working on module customization or debugging.


7. -p <port> — Define the HTTP Port


By default, Odoo runs on port 8069. You can change this using -p.

Example:

odoo -p 9090

What it does:
Starts the Odoo server on port 9090.

Use Case:
Useful when running multiple Odoo instances or avoiding port conflicts.


8. --logfile — Specify Log File Location


This option defines where Odoo should write its log output.

Example:

odoo --logfile=/var/log/odoo/odoo-server.log

What it does:
Stores all server logs in the specified file instead of printing them to the terminal.

Use Case:
Recommended for production environments to track performance, errors, and user activity.


Example: Combining Parameters


You can combine multiple CLI parameters to fine-tune your Odoo server startup:

odoo -c /etc/odoo/odoo.conf -d mycompany_db -u custom_module \
--addons-path=/opt/odoo/addons,/opt/odoo/custom-addons \
--db-filter=mycompany.* -p 9090 --logfile=/var/log/odoo/odoo.log

This command:

  • Loads the configuration file
  • Connects to mycompany_db
  • Updates custom_module
  • Uses specified add-ons paths
  • Filters databases beginning with mycompany
  • Runs on port 9090
  • Logs output to /var/log/odoo/odoo.log


Conclusion


Odoo’s command-line interface offers powerful options for system administrators and developers to control how the server behaves. Mastering these parameters allows for smoother development workflows, better debugging, and more secure production deployments.

Command Line Parameter to use When Developing for Odoo 17
Liu November 13, 2025
Share this post
Archive