Configuration¶
Complete guide to configuring the Odoo 15 ERP system for your environment.
Configuration Overview¶
All configuration is centralized in the .env file, which serves as the single source of truth for the entire system.
┌─────────────────────────────────────────────────────────────┐
│ .env (Source of Truth) │
├─────────────────────────────────────────────────────────────┤
│ ENVIRONMENT → test / production │
│ COMPOSE_FILE → Docker compose files to use │
│ DB_* → Database connection │
│ DOMAIN_* → Domain names for nginx │
│ LETSENCRYPT_EMAIL → SSL certificate email │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ production_deploy.sh │ ssl-init.sh │ docker-compose │
└─────────────────────────────────────────────────────────────┘
Environment Files¶
| File | Purpose | Git Tracked |
|---|---|---|
.env.example |
Template with placeholder values | Yes |
.env |
Active configuration (has secrets) | No |
.env.test |
Clean test template | No |
# Create environment file from template
cp .env.example .env
# Edit configuration
nano .env
# Verify configuration
./production_deploy.sh config
Environment Selection¶
ENVIRONMENT Variable¶
# Set environment type
ENVIRONMENT=test # Local development
ENVIRONMENT=production # Production server
COMPOSE_FILE Variable¶
The COMPOSE_FILE variable determines which Docker Compose files are loaded:
# Test environment (default)
COMPOSE_FILE=docker-compose.yml:docker-compose.test.yml
# Production environment
COMPOSE_FILE=docker-compose.yml:docker-compose.prod.yml
| Environment | COMPOSE_FILE Value | Database | Ports Exposed |
|---|---|---|---|
| Test | ...test.yml |
Local PostgreSQL | All (8069, 8000, 8001, 8002, 80, 443) |
| Production | ...prod.yml |
AWS RDS | Only 80, 443 (nginx) |
No -f Flags Needed
With COMPOSE_FILE set in .env, all docker compose commands automatically use the correct files.
GIT_BRANCH Variable¶
Used by ./production_deploy.sh deploy and ./production_deploy.sh update.
Environment Variables Reference¶
Database Configuration¶
| Variable | Default | Description |
|---|---|---|
DB_HOST |
db |
Database hostname (db for Docker, RDS endpoint for production) |
DB_PORT |
5432 |
PostgreSQL port |
DB_NAME |
odoo |
Database name |
DB_USER |
odoo |
Database username |
DB_PASSWORD |
- | Database password (required) |
Odoo Configuration¶
| Variable | Default | Description |
|---|---|---|
ODOO_PORT |
8069 |
Internal Odoo port |
ODOO_ADMIN_PASSWORD |
- | Master password for database management |
Security
Use a strong, unique ODOO_ADMIN_PASSWORD. This controls access to database creation/deletion.
Domain Configuration¶
| Variable | Example | Description |
|---|---|---|
DOMAIN_LANDING |
yourcompany.com |
Main landing page domain |
DOMAIN_ERP |
erp.yourcompany.com |
Odoo ERP domain |
DOMAIN_PWA |
pwa.yourcompany.com |
Field PWA domain |
DOMAIN_DOCS |
docs.yourcompany.com |
Documentation portal domain |
These domains are used by:
./scripts/ssl-init.shfor SSL certificate requestsnginx/conf.d/production.conf.templatefor server configuration
SSL Configuration¶
| Variable | Description |
|---|---|
LETSENCRYPT_EMAIL |
Email for Let's Encrypt certificate notifications |
SSL certificates are stored in nginx/ssl/live/{domain}/.
Landing Page Configuration¶
| Variable | Description |
|---|---|
LANDING_SECRET_KEY |
Flask secret key for sessions |
LANDING_THEME |
Theme: blue, slate, or earth |
HELPDESK_TEAM_ID |
Odoo helpdesk team ID for tickets |
RECAPTCHA_SITE_KEY |
Google reCAPTCHA v3 site key |
RECAPTCHA_SECRET_KEY |
Google reCAPTCHA v3 secret key |
Company Information¶
| Variable | Description |
|---|---|
COMPANY_NAME |
Company name displayed on landing page |
COMPANY_PHONE |
Contact phone number |
COMPANY_EMAIL |
Contact email address |
COMPANY_ADDRESS |
Short address (city, state) |
COMPANY_SHOWROOM_ADDRESS |
Full showroom address |
COMPANY_HOURS |
Business hours |
COMPANY_MAP_URL |
Google Maps URL |
AWS Configuration¶
Required for backups and S3 storage (signatures, photos):
| Variable | Description |
|---|---|
AWS_ACCESS_KEY_ID |
AWS access key |
AWS_SECRET_ACCESS_KEY |
AWS secret key |
AWS_REGION |
AWS region (e.g., us-east-1) |
S3_BUCKET |
S3 bucket for signatures/photos |
S3_BACKUP_BUCKET |
S3 bucket for backups |
Timezone¶
| Variable | Default | Description |
|---|---|---|
TZ |
America/Chicago |
System timezone |
Verify Configuration¶
Using the Config Command¶
Output:
Current Configuration (from .env):
Environment: test
Database: odoo_test (host: db, user: odoo)
Git Branch: main
Domains:
Landing: localhost
ERP: erp.localhost
PWA: pwa.localhost
Docs: docs.localhost
Check Environment Variables¶
# Verify environment file is loaded
docker compose config | grep DB_HOST
# Check running configuration
docker compose exec odoo env | grep -E "(DB_|ODOO_)"
Test Database Connection¶
# Test from Odoo container
docker compose exec odoo python3 -c "
import psycopg2
import os
conn = psycopg2.connect(
host=os.environ.get('HOST', 'db'),
database=os.environ.get('DB_NAME', 'odoo'),
user=os.environ.get('USER', 'odoo'),
password=os.environ.get('PASSWORD')
)
print('Connection successful!')
conn.close()
"
Odoo Configuration File¶
The main Odoo configuration is in configs/odoo.conf.
Key Settings¶
[options]
# Addons paths
addons_path = /mnt/extra-addons/helpdesk,/mnt/extra-addons/odoo
# Data directory (bind mount to ./odoo-data)
data_dir = /var/lib/odoo
# Performance settings
workers = 0 # Set to 2-4 for production
max_cron_threads = 1
limit_memory_hard = 2684354560 # 2.5GB
limit_memory_soft = 2147483648 # 2GB
limit_time_cpu = 600
limit_time_real = 1200
# Logging
log_level = info
logrotate = True
# Disable demo data on new databases
without_demo = all
# Security
list_db = True # Set to False in production
Production Recommendations¶
| Setting | Test | Production |
|---|---|---|
workers |
0 | 2-4 |
list_db |
True | False |
log_level |
info | warning |
limit_memory_hard |
2.5GB | 4GB+ |
Data Storage¶
Odoo Data (Bind Mount)¶
Odoo filestore is stored as a bind mount for easy backup:
./odoo-data/ → /var/lib/odoo (in container)
├── addons/ # Downloaded Odoo Apps store modules
├── filestore/ # Attachments, images, documents
│ └── <db_name>/ # Database-specific files
└── sessions/ # User session data
PostgreSQL Data¶
PostgreSQL uses a Docker named volume for data integrity:
Production uses AWS RDS (managed by Amazon).
Module Configuration¶
JustCall SMS¶
Configure in Odoo: Settings → Technical → System Parameters
| Key | Value |
|---|---|
justcall.api_key |
Your API key |
justcall.api_secret |
Your API secret |
See JustCall SMS Module for complete configuration.
Xero Integration¶
Configure OAuth2 credentials in Odoo: Accounting → Configuration → Xero
See Xero Integration for setup instructions.
Service Signatures¶
Configure S3 bucket for signature storage in .env:
S3_BUCKET=yourcompany-signatures
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
See Service Signature Module for details.
Next Steps¶
- Quick Start - Get productive in 5 minutes
- Deployment Guide - Deploy using production_deploy.sh
- Module Configuration - Configure individual modules