Instances
Odoo instance lifecycle, container management, ports, and configuration
An instance in oCore is a running Odoo application deployed as a Docker container on a managed server. Each instance has its own database, network ports, and configuration, and can be independently started, stopped, restarted, and scaled.
How instances work
Each Odoo instance runs as an isolated Docker container on a managed server. oCore handles:
- Container lifecycle -- Creating, starting, stopping, restarting, and removing containers
- Database provisioning -- Creating a dedicated PostgreSQL database for each instance
- Port allocation -- Assigning unique network ports for the Odoo web interface, longpolling, and development tools
- Configuration -- Managing the Odoo configuration file (
odoo.conf) with the correct database, port, and module settings
Instance lifecycle
| Status | Description |
|---|---|
| Creating | Docker image being pulled, database being created, container being started |
| Running | Instance is healthy and serving requests |
| Stopped | Container is stopped, database preserved, can be restarted |
| Restarting | Container is being restarted (e.g., after config change) |
| Failed | Creation or startup failed (check deployment logs) |
| Removing | Instance being cleaned up asynchronously |
Stopping an instance preserves its database and configuration. You can restart a stopped instance at any time without data loss. Only deleting an instance removes its data.
Odoo configuration
Each instance can be configured with:
| Setting | Description | Default |
|---|---|---|
| Odoo version | The Odoo release version (e.g., 17.0, 16.0) | Latest stable |
| Edition | Community (free) or Enterprise (requires license) | Community |
| Workers | Number of Odoo worker processes for request handling | Auto (based on CPU) |
| Max memory | Maximum memory per worker process (soft limit) | 2048 MB |
| DB filter | Database name filter for multi-database setups | Instance database |
| Custom modules | Path to custom Odoo modules from Git repository | None |
Odoo editions
- Community -- The open-source edition of Odoo, free to use. Includes core modules (CRM, Sales, Inventory, Accounting, etc.) and the standard web client.
- Enterprise -- The proprietary edition with additional modules (Studio, IoT, Quality, etc.) and the enterprise web client. Requires a valid Odoo license subscription.
Port allocation
Each instance receives three network ports on the host server:
| Port | Purpose | Example |
|---|---|---|
| Base port | Odoo web interface | 10000 |
| Base + 1 | Longpolling (live chat, real-time notifications) | 10001 |
| Base + 2 | Mailpit (development email testing) | 10002 |
Ports are allocated sequentially with a gap of 10 between instances. The first instance on a server gets ports 10000-10002, the second gets 10010-10012, and so on.
Ensure the allocated ports are not blocked by the server's firewall. If you are using a reverse proxy, configure it to forward traffic to the correct ports.
Container management
oCore manages Odoo containers through Docker on the target server via SSH. Available operations:
Start / Stop / Restart
- Start -- Starts a stopped container. The database is preserved from the previous run.
- Stop -- Gracefully stops the container (SIGTERM, then SIGKILL after timeout). Database connections are closed cleanly.
- Restart -- Stops and starts the container. Useful after configuration changes or module updates.
Logs
Container logs (stdout/stderr from Odoo) are accessible through the dashboard. Logs include:
- Odoo startup messages
- Module loading and upgrade output
- Request logs (when
--log-level=info) - Error tracebacks and warnings
Shell access
For advanced debugging, you can access a shell session inside the Odoo container through the oCore SSH gateway. This provides direct access to the Odoo filesystem, configuration files, and the Odoo shell.
Database management
Each instance has a dedicated PostgreSQL database. oCore manages:
- Creation -- Automatic database provisioning when the instance is created
- Backups -- Scheduled and on-demand database backups (see Deployments for pre-deploy snapshots)
- Restoration -- Restore from a backup to roll back changes
- Duplication -- Clone an instance's database for testing purposes
Resource limits
oCore can enforce resource limits on instances to prevent a single Odoo installation from consuming all server resources:
- CPU shares -- Relative CPU priority between containers
- Memory limit -- Hard limit on container memory usage
- Worker count -- Number of Odoo worker processes (directly affects CPU and memory usage)
As a guideline, each Odoo worker process consumes approximately 150-300 MB of RAM. A server with 4 GB RAM can comfortably run 2-3 instances with 2-4 workers each.
Further reading
- First Instance -- Deploy your first Odoo instance step by step
- Servers -- Server management and port allocation details
- Deployments -- How code changes are deployed to instances
- Projects & Environments -- Organizing instances with projects and environments