Knowledgebase

Question About Servers

How to Change Odoo Configuration Parameters via SSH Print

  • 0

In Odoo, configuration parameters are typically set in the configuration file, which is usually named odoo.conf. This file contains various settings and options that control the behavior of the Odoo application.

To change Odoo configuration parameters via SSH, follow these steps:

Step 1: Connect to the Server. Use SSH to connect to your server where Odoo is installed. Replace username with your server username and your_server_ip with the actual IP address of your server.

ssh username@your_server_ip  -p Port_number
e.g. ssh [email protected] -p 22

Step 2: Navigate to the Odoo configuration file. Use the cd command to navigate to the directory where your Odoo configuration file is located. The default location is often /opt/odoo/.  Contact your system administrator to confirm the directory where the Odoo files have been installed in your VPS. The command appears as the one below. Be sure to replace /etc/odoo/ with the correct path. 

cd /etc/odoo/

Step 3: Edit the configuration file. Use a text editor like nano or vim to open and edit the odoo.conf file. Use the command below to open the configuration file. 

sudo nano odoo.conf

If you're not sure how the configuration file has been named, you can use the 'ls' command inside the /etc/odoo directory to see a list of all the files. 

Step 4: Locate and modify configuration parameters. Inside the odoo.conf file, look for the parameters you want to change. Configuration parameters are typically specified in the format key = value. The configuration file should look like this: 

[options]
admin_passwd = admin_passwd
db_host = False
db_port = False
db_user = odoo17
db_password = False
addons_path = /opt/odoo17/odoo17/addons,/opt/odoo17/odoo17/custom-addons
xmlrpc_port = 8069

Modify the values according to your requirements.

Step 5: Save and exit. Save your changes and exit the text editor. In nano, you can press Ctrl + X, then press Y to confirm the changes, and finally press Enter.

Step 6: Restart Odoo. After making changes to the configuration file, you need to restart the Odoo service to apply the new configuration. Use the following command for Debian/Ubuntu:

sudo service odoo restart

Use the following command for CentOS/Almalinux:

sudo systemctl restart odoo

Alternatively, you may need to use a different command depending on how Odoo is managed on your system.

That's it! The changes you made in the odoo.conf file should now be in effect. Keep in mind that modifying configuration parameters may require a restart of the Odoo service to take effect.

The table below shows different configuration parameters that can be tweaked within Odoo.

Parameter Description
Database Settings
db_host = localhost Specify the database host.
db_port = 5432 Specify the database port 
db_user = odoo Specify the database user name
db_password = 123456 Specify the database password for db_user
db_name = odoo Specify the database name
db_template = template0 DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII). Use the same encoding as in the template database, or use template0 as template.
admin_passwd = 123456 Master Database password. This is set at first boot and can be set from within Odoo
db_maxconn = 64 specify the maximum number of physical connections to PostgreSQL
dbfilter = .* Filter listed database REGEXP
Logs Settings
logfile = /var/log/odoo/openerp-server.log The log filename. If not set, use stdout.
logrotate = True True/False. If True, create a daily log file and keep 30 files.
log-db = False True/False. If True, also write log to 'ir_logging' table in database
syslog = False True/False logs to the system's event logger: syslog
log-level = warn Log level - One of the following: info, debug_rpc, warn, test, critical, debug_sql, error, debug, debug_rpc_answer
log_handler = log_handler - can be a list of 'module:log_level' pairs. The default value is ':INFO' -- it means the default logging level is 'INFO' for all modules.
Service Settings
interface = localhost The IP address on which the server will bind. If empty, it will bind on all interfaces (default empty).
port = 8069 The TCP port on which the server will listen (default 8069).
secure = False Launch server over https instead of http (default False).
proxy_mode = True Set to True if you are deploying your App behind a proxy e.g. Apache using mod_proxy. --proxy_mode added, using Werkzeug ProxyFix class
addons_path = /opt/openerp/odoo/addons,/home/myaddons Specify the addons_path folders ordered by priority. addons_path=/first/path/,/second/path/
pidfile = False The file where the server pid will be stored (default False). We are letting the init script create the pid
timezone = False specify reference timezone for the server (e.g. Europe/Brussels)
secure_cert_file = server.cert specify the certificate file for the SSL connection
secure_pkey_file = server.pke specify the private key file for the SSL connection
xmlrpc = True xmlrpc - Set to False to disable the XML-RPC protocol
xmlrpc_interface = 127.0.0.1 xmlrpc_interface - Specify the TCP IP address for the XML-RPC protocol. The empty string binds to all interfaces.
xmlrpc_port = 8069 xmlrpc_port - Specify the TCP port for the XML-RPC protocol
longpolling_port = 8072 TCP port for long-polling connections in multiprocessing or gevent mode, defaults to 8072. Not used in default (threaded) mode.
import_partial = Use this for big data importation, if it crashes you will be able to continue at the current state. Provide a filename to store intermediate importation states.
unaccent = False Use the unaccent function provided by the database when available
translate_modules = ['all'] specify modules to export. Use in combination with --i18n-export
server_wide_modules = None Comma-separated list of server-wide modules, default=web
Email Settings
smtp_server = localhost Specify the SMTP server for sending email (default localhost).
smtp_user = False Specify the SMTP user for sending email (default False).
smtp_password = False Specify the SMTP password for sending email (default False).
smtp_ssl = False if True, SMTP connections will be encrypted with SSL (STARTTLS)
email_from = "[email protected]" Specify the SMTP email address for sending email
smtp_port = 25 Specify the SMTP port
Tuning Options
workers = 0 Specify the number of workers, 0 disable prefork mode. If count is not 0 , enables multiprocessing and sets up the specified number of HTTP workers (sub-processes processing HTTP and RPC requests). TKL Default is 0
max_cron_threads = 1 number of workers dedicated to cron jobs. Defaults to 2. The workers are threads in multithreading mode and processes in multiprocessing mode.
limit_time_cpu = 60 Prevents the worker from using more than <limit> CPU seconds for each request. If the limit is exceeded, the worker is killed
limit_time_real = 170 Prevents the worker from taking longer than <limit> seconds to process a request. If the limit is exceeded, the worker is killed.
limit_memory_soft = 255652815 Maximum allowed virtual memory per worker. If the limit is exceeded, the worker is killed and recycled at the end of the current request.
limit_memory_hard = 1395864371 Hard limit on virtual memory, any worker exceeding the limit will be immediately killed without waiting for the end of the current request processing.
limit_request = 8196 Number of requests a worker will process before being recycled and restarted.
osv_memory_age_limit = 1.0 Force a limit on the maximum number of records kept in the virtual osv_memory tables. This is a decimal value expressed in hours, and the default is 1 hour.
Testing and Demo Settings (For Developers)
test_enable = False Enable YAML and unit tests.
test_file = False Launch a python or YML test file.
test_report_directory = False If set, will save sample of all reports in this directory.
test_commit = False Commit database changes performed by YAML or XML tests.
without_demo = disable loading demo data for modules to be installed (comma-separated, use "all" for all modules). Default is none

 


Was this answer helpful?

« Back

Enterprise-Grade Hardware

  • Samsung
  • Juniper
  • Western Digital
  • Supermicro
  • LSI
  • Intel
  • R1Soft Backups
  • cPanel
  • MySQL
  • Parallels
  • HP Partner