Introduction #
Cloudpepper allows you to connect your Odoo instance to an external PostgreSQL database instead of using the local database on your server. This setup supports both managed services (e.g., DigitalOcean Managed PostgreSQL, AWS Aurora, Google Cloud SQL) and self-hosted PostgreSQL servers.
Using an external database offers significant advantages for critical Odoo systems:
- Performance: Offloads heavy database operations from your Odoo application server.
- Reliability: Leverages automated backups, point-in-time recovery (PITR), and high-availability (HA).
- Scalability: Allows you to scale your database resources (RAM/CPU) independently.
Requirements #
Before you begin, ensure you meet the following requirements:
- Cloudpepper Plan: You must be on the Pro or Agency plan.
- Supported Database: Any PostgreSQL database reachable by your server.
- Version Compatibility: The external database version must match the PostgreSQL version installed on your Cloudpepper server (e.g., Server PG 16 = Database PG 16).
- Default Database: The external cluster must contain a default database named
postgres(required for Odoo’s initial connection check). - Network Reachability: The database endpoint must be reachable from your Cloudpepper server (via public IP or private routing).
- IP Whitelisting: If your database uses a firewall or IP allowlist, you must allow:
- Your Cloudpepper Server IP (found in your server dashboard).
- Cloudpepper Platform IPs (View list). These are used by Cloudpepper’s systems to validate connections during operations.
Step 1. Verify Connection #
Before configuring the instance in Cloudpepper, we strongly recommend testing the connection manually from your server’s terminal. This confirms that your firewall rules and credentials are correct.
SSH into your Cloudpepper server and run:
psql -h <db_host> -p <port> -U <db_user> -d postgresIf this command prompts for a password and connects successfully, your environment is ready.
Step 2. Create the Odoo Instance #
- Navigate to your server in the Cloudpepper dashboard and click Create Instance.
- Select Advanced Options.
- Check the box Use External Database.
- Enter your connection details:
- Host: The endpoint or IP address of your database.
- Port: Default is
5432(Note: DigitalOcean sometimes uses25060). - Database Name: The specific name of the database where Odoo data will be stored.
- User: Your database username.
- Password: Your database password.
Note: Deleting an instance in Cloudpepper does not delete the external database. You are responsible for managing the lifecycle and backups of your external data.
Troubleshooting #
Creation fails immediately (Missing postgres database) #
If the creation fails instantly, it is often because the default postgres database is missing. Odoo requires this database to exist to perform initial checks, even if you are connecting to a different database.
Solution:
Connect to your database cluster (via CLI or provider dashboard) and run:
CREATE DATABASE postgres;Connection timeouts (Firewall Issues) #
If the creation process hangs, the database firewall is likely blocking the connection.
Solution:
Ensure you have whitelisted both your Cloudpepper Server IP and the Cloudpepper Platform IPs (View list).
Version Mismatch Errors #
If the instance creates but Odoo fails to start, your database versions might not match.
Solution:
- Check server version:
psql --version - Check database version: Ensure it matches exactly (e.g., both are PostgreSQL 14).