# Odoo ERP System

> Comprehensive open-source ERP and business management suite.

- Category: Full Web Stacks
- Difficulty: intermediate
- Components: odoo, postgresql
- Tags: erp, crm, odoo, business, accounting
- Source: https://docker.recipes/full-stacks/odoo-erp

## Overview

Odoo is a comprehensive open-source business management suite that combines enterprise resource planning (ERP), customer relationship management (CRM), and numerous business applications into a single unified platform. Originally released in 2005 as OpenERP, Odoo has evolved into one of the most popular business management solutions, offering modules for accounting, inventory, sales, project management, manufacturing, and human resources. This modular approach allows businesses to start with core functionality and expand their system as needs grow. PostgreSQL serves as Odoo's primary database backend, providing the robust data integrity and performance characteristics essential for business-critical operations. PostgreSQL's ACID compliance ensures transaction reliability for financial data, while its advanced indexing and query optimization capabilities handle complex business logic across multiple modules. The database's support for both relational and JSON data types perfectly complements Odoo's flexible architecture, allowing for structured business data alongside customizable fields and configurations. This stack combination delivers a production-grade business management platform suitable for organizations ranging from small businesses to large enterprises. The pairing leverages PostgreSQL's proven reliability in handling concurrent users and complex business transactions while supporting Odoo's multi-tenancy capabilities for hosting multiple company databases within a single instance.

## Features

- Complete ERP suite with integrated CRM, accounting, inventory, sales, and project management modules
- Multi-company support allowing management of multiple business entities within single Odoo instance
- Modular architecture enabling selective installation of business applications based on specific needs
- Advanced PostgreSQL backend with JSONB support for flexible custom fields and configurations
- Built-in reporting engine with dynamic dashboards and customizable business intelligence views
- Workflow automation and business process management with approval chains and notifications
- Multi-currency and multi-language support for international business operations
- REST API and XML-RPC interfaces for third-party integrations and custom applications

## Use cases

- Small to medium businesses implementing comprehensive business management system
- Growing companies transitioning from spreadsheets to integrated ERP solution
- Multi-location businesses requiring centralized inventory and accounting management
- Service companies needing project management with time tracking and invoicing integration
- Retail businesses managing e-commerce integration with inventory and accounting
- Manufacturing companies requiring production planning and supply chain management
- Non-profits managing donors, grants, and program tracking in unified system

## Prerequisites

- Minimum 4GB RAM recommended for production deployment with multiple concurrent users
- Port 8069 available for Odoo web interface access
- Basic understanding of ERP concepts and business process management
- PostgreSQL administration knowledge for database maintenance and optimization
- Understanding of Odoo's module system for customization and app installation
- SSL certificate and reverse proxy setup recommended for production environments

## docker-compose.yml

```yaml
services:
  odoo:
    image: odoo:17
    container_name: odoo
    environment:
      - HOST=db
      - USER=odoo
      - PASSWORD=${DB_PASSWORD}
    volumes:
      - odoo-web:/var/lib/odoo
      - odoo-addons:/mnt/extra-addons
      - ./odoo.conf:/etc/odoo/odoo.conf:ro
    ports:
      - "8069:8069"
    depends_on:
      - db
    networks:
      - odoo-network
    restart: unless-stopped

  db:
    image: postgres:15-alpine
    container_name: odoo-db
    environment:
      - POSTGRES_USER=odoo
      - POSTGRES_PASSWORD=${DB_PASSWORD}
      - POSTGRES_DB=postgres
    volumes:
      - postgres-data:/var/lib/postgresql/data
    networks:
      - odoo-network
    restart: unless-stopped

volumes:
  odoo-web:
  odoo-addons:
  postgres-data:

networks:
  odoo-network:
    driver: bridge
```

## .env

```bash
# Odoo ERP
DB_PASSWORD=secure_odoo_password
```

## Usage notes

- Web UI at http://localhost:8069
- Create database on first visit
- Set master password for database management
- Install apps from marketplace
- Community edition is free

## Troubleshooting

- Database connection error 'could not connect to server': Verify PostgreSQL container is running and DB_PASSWORD environment variable matches between services
- Odoo fails to start with 'database does not exist': Access web interface to create initial database through setup wizard on first run
- Performance issues with slow page loads: Increase PostgreSQL shared_buffers and effective_cache_size, consider adding pgbouncer for connection pooling
- Module installation fails with permission errors: Ensure odoo-addons volume has proper write permissions for custom module installation
- Memory errors during large data imports: Increase container memory limits and PostgreSQL work_mem configuration for bulk operations
- Login issues after container restart: Clear browser cache and verify master password hasn't changed in database management settings

