Skip to main content

Overview

Proper configuration is crucial for Odoo performance, security, and reliability. This guide covers all configuration options available in deployERP for fine-tuning your instances.

Configuration Methods

Dashboard UI

Visual configuration through web interface

Configuration Files

Direct editing of odoo.conf

API

Programmatic configuration updates

Core Configuration

Database Settings

db_host
string
default:"localhost"
PostgreSQL server hostname
  • Usually localhost for same-server database
  • Can be remote database IP/hostname
db_port
integer
default:"5432"
PostgreSQL server port
db_user
string
default:"odoo"
Database user for Odoo connections
db_password
string
required
Database user password (encrypted in storage)
db_name
string
required
Default database name
  • Can be comma-separated list for multi-database
  • Use False to show database selector
db_template
string
default:"template0"
Template for creating new databases

Server Settings

http_port
integer
default:"8069"
HTTP service port (internal)
longpolling_port
integer
default:"8072"
Longpolling/websocket port
proxy_mode
boolean
default:"true"
Enable when behind reverse proxy
server_wide_modules
string
default:"base,web"
Modules loaded for all databases

Performance Configuration

Worker Configuration

Optimize worker settings based on server resources:
# Recommended worker calculation
workers = (cpu_cores * 2) + 1

# Example configurations
# 2 CPU cores
workers = 5
max_cron_threads = 2

# 4 CPU cores  
workers = 9
max_cron_threads = 2

# 8 CPU cores
workers = 17
max_cron_threads = 4

Memory Limits

Configure memory limits per worker:
SettingDescriptionCalculationExample (4GB RAM)
limit_memory_softSoft limit per workerRAM * 0.8 / workers640 MB
limit_memory_hardHard limit per workerRAM * 0.9 / workers768 MB
# Memory configuration example
limit_memory_soft: 671088640  # 640 MB
limit_memory_hard: 805306368  # 768 MB

Request Limits

Control request processing:
limit_time_cpu
integer
default:"60"
CPU time limit per request (seconds)
  • Prevents runaway queries
  • Increase for heavy computations
limit_time_real
integer
default:"120"
Total time limit per request (seconds)
  • Includes database wait time
  • Should be 2x CPU limit
limit_request
integer
default:"8192"
Maximum number of requests per worker
  • Worker restarts after limit
  • Prevents memory leaks

Security Configuration

Access Control

admin_passwd
string
required
Master password for database operations
  • Required for database creation/deletion
  • Should be complex and secure
  • Stored encrypted
list_db
boolean
default:"false"
Show database list on login
  • Disable for production
  • Security best practice
dbfilter
string
Database visibility filter
  • Example: ^%d$ for subdomain matching
  • Example: ^production for specific prefix

Network Security

# Security configuration
security:
  # IP whitelisting
  allowed_ips:
    - 10.0.0.0/8
    - 192.168.1.0/24
    - 203.0.113.0/32
  
  # Session configuration
  session_timeout: 7200  # 2 hours
  password_reset_timeout: 3600  # 1 hour
  
  # CORS settings
  cors_origins: 
    - https://app.company.com
    - https://mobile.company.com

Email Configuration

SMTP Settings

Configure outgoing email:
smtp_server
string
SMTP server hostname
  • Example: smtp.gmail.com
  • Example: email-smtp.us-east-1.amazonaws.com
smtp_port
integer
default:"587"
SMTP server port
  • 587 for TLS
  • 465 for SSL
  • 25 for unencrypted (not recommended)
smtp_ssl
boolean
default:"false"
Use SSL/TLS encryption
smtp_user
string
SMTP authentication username
smtp_password
string
SMTP authentication password
email_from
string
Default sender email address

Email Templates

# Email configuration example
email:
  smtp_server: smtp.sendgrid.net
  smtp_port: 587
  smtp_user: apikey
  smtp_password: ${SENDGRID_API_KEY}
  email_from: [email protected]
  
  # Catchall configuration
  catchall_domain: company.com
  catchall_alias: catchall
  
  # Bounce handling
  bounce_alias: bounce
  bounce_address: [email protected]

Logging Configuration

Log Levels

Configure logging verbosity:
log_level
string
default:"info"
Global log level:
  • critical: Only critical errors
  • error: Errors only
  • warn: Warnings and above
  • info: Informational messages (default)
  • debug: Detailed debug information
  • debug_sql: Include SQL queries
log_handler
string
Specific module logging:
werkzeug:CRITICAL,odoo.sql_db:DEBUG

Log Rotation

logging:
  # Log file settings
  logfile: /var/log/odoo/odoo.log
  logrotate: true
  
  # Rotation settings
  log_rotation_size: 100  # MB
  log_rotation_count: 10  # Keep 10 files
  
  # Syslog integration
  syslog: false
  syslog_host: localhost
  syslog_port: 514

Advanced Configuration

Multiprocessing

# Advanced multiprocessing configuration
multiprocessing:
  # Enable multiprocessing
  workers: 8
  
  # Worker types
  max_cron_threads: 2
  
  # Gevent async workers (Odoo 15+)
  gevent_port: 8073
  
  # Worker recycling
  limit_request: 8192
  limit_time_cpu: 600
  limit_time_real: 1200

Database Options

# Advanced database configuration
database:
  # Connection pooling
  db_maxconn: 64
  db_minconn: 2
  
  # Query optimization
  osv_memory_age_limit: 1.0
  osv_memory_count_limit: false
  
  # Database maintenance
  pg_path: /usr/bin
  unaccent: true

File Storage

# File storage configuration
filestore:
  # Data directory
  data_dir: /opt/odoo/data
  
  # Attachment storage
  attachment_location: file  # or 'db' for database storage
  
  # Maximum file size (MB)
  max_upload_size: 128
  
  # Cleanup settings
  attachment_deletion_delay: 48  # hours

Module Configuration

Module Management

addons_path
string
required
Comma-separated list of module directories:
/opt/odoo/addons,/opt/odoo/custom-addons,/opt/odoo/enterprise
upgrade_path
string
Path to upgrade scripts directory
load_language
string
Languages to load on startup:
en_US,es_ES,fr_FR

Auto-install Configuration

modules:
  # Server-wide modules
  server_wide_modules: base,web
  
  # Auto-install on database creation
  init_modules:
    - sale_management
    - purchase
    - stock
    - account
  
  # Exclude modules
  exclude_modules:
    - hw_*
    - pos_*

Caching Configuration

Redis Integration

Enable Redis for improved performance:
redis:
  # Enable Redis cache
  enable_redis: true
  
  # Redis connection
  redis_host: localhost
  redis_port: 6379
  redis_db_index: 1
  redis_password: ${REDIS_PASSWORD}
  
  # Cache settings
  cache_timeout: 7200  # 2 hours
  cache_max_size: 10000  # Maximum cached items
  
  # Session storage
  session_redis: true
  session_redis_prefix: odoo_session_

Static Asset Caching

assets:
  # Asset bundling
  bundle_assets: true
  
  # CDN configuration
  cdn_enabled: true
  cdn_url: https://cdn.company.com
  
  # Cache headers
  cache_control: public, max-age=31536000
  
  # Compression
  gzip_enabled: true
  gzip_level: 6

Environment-Specific Configuration

Development Settings

# Development configuration
dev:
  # Debugging
  debug_mode: true
  log_level: debug
  
  # Auto-reload
  auto_reload: true
  
  # Development tools
  dev_mode: true
  
  # Disable caching
  disable_cache: true

Production Settings

# Production configuration
production:
  # Performance
  workers: 8
  limit_memory_hard: 2684354560
  
  # Security
  list_db: false
  debug_mode: false
  
  # Reliability
  max_cron_threads: 2
  unaccent: true

Configuration via API

Update configuration programmatically:
curl -X PATCH https://api.deployerp.com/v1/instances/{instance_id}/config \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workers": 8,
    "limit_memory_soft": 671088640,
    "limit_memory_hard": 805306368,
    "smtp_server": "smtp.sendgrid.net",
    "smtp_port": 587
  }'

Configuration Best Practices

Begin with default settings and adjust based on monitoring data
Track performance metrics after each configuration change
Keep a changelog of configuration modifications
Test configuration changes in staging before production
Review and optimize configuration quarterly

Troubleshooting

Common Configuration Issues

IssueCauseSolution
High memory usageToo many workersReduce worker count
Slow requestsLow CPU limitIncrease limit_time_cpu
Connection errorsWrong database settingsVerify db_host and credentials
Email failuresSMTP misconfigurationCheck SMTP settings and firewall

Configuration Validation

# Validate configuration
deployerp instance validate-config --instance=production

# Test specific settings
deployerp instance test-smtp --instance=production
deployerp instance test-db --instance=production