Skip to content

docs: add external PostgreSQL configuration guide#511

Merged
jpshackelford merged 3 commits into
mainfrom
docs/external-postgres-requirements
May 19, 2026
Merged

docs: add external PostgreSQL configuration guide#511
jpshackelford merged 3 commits into
mainfrom
docs/external-postgres-requirements

Conversation

@jpshackelford
Copy link
Copy Markdown
Contributor

Summary

Add documentation for customers deploying OpenHands Enterprise with their own external PostgreSQL instance instead of the bundled database.

Changes

  • New page: enterprise/external-postgres.mdx — Comprehensive guide covering:

    • PostgreSQL version requirements (16.4.0+, PostgreSQL 17 also supported)
    • Required databases: openhands, bitnami_keycloak, litellm, runtime_api_db, automations
    • Two setup options:
      • Automatic creation: User with CREATEDB privilege
      • Manual creation: SQL scripts for creating all databases and granting permissions
    • Network requirements
    • Configuration guidance
  • Updated enterprise/k8s-install/index.mdx — Added card linking to the new external PostgreSQL guide

  • Updated docs.json — Added navigation entry for the new page

Context

This information was gathered from internal discussions about customer requirements for external PostgreSQL setup (specifically for customers who need to use their existing database infrastructure rather than the bundled PostgreSQL).


This PR was created by an AI agent (OpenHands) on behalf of John-Mason Shackelford.

@jpshackelford can click here to continue refining the PR

@jpshackelford jpshackelford marked this pull request as ready for review May 19, 2026 17:47
Copy link
Copy Markdown
Contributor

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation provides good coverage of external PostgreSQL setup, but needs clarification on specific privilege requirements and configuration details to ensure customers can successfully complete the setup.

Comment thread enterprise/external-postgres.mdx Outdated

## PostgreSQL Version

OpenHands Enterprise requires **PostgreSQL 16.4.0 or above**. PostgreSQL 17 is also supported.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Be more specific about version requirements. Is 16.4.0 a hard requirement, or will 16.0-16.3 work? If there's a specific reason for 16.4.0 (e.g., a critical bug fix or required feature), briefly mention it:

Suggested change
OpenHands Enterprise requires **PostgreSQL 16.4.0 or above**. PostgreSQL 17 is also supported.
OpenHands Enterprise requires **PostgreSQL 16.4.0 or later**. PostgreSQL 17 is also supported.

If earlier 16.x versions are actually fine, adjust accordingly.

Comment thread enterprise/external-postgres.mdx Outdated
Comment on lines +97 to +105

When configuring OpenHands Enterprise, provide your external PostgreSQL connection details
in the Admin Console or Helm values:

- **Host**: Your PostgreSQL server hostname or IP
- **Port**: PostgreSQL port (default: 5432)
- **Username**: The database user created above
- **Password**: The user's password
- **SSL Mode**: Configure based on your security requirements
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Important: This section lists configuration fields but doesn't specify HOW to provide them. Enterprise customers need concrete guidance.

Add specific details:

  • What are the actual Helm value names? (e.g., postgresql.external.host, postgresql.external.port?)
  • If using Admin Console, what section/page are these fields in?
  • Is there a single connection string, or separate credentials per service?

Suggestion: Add a subsection with actual Helm values example or Admin Console screenshot reference:

### Helm Values

When deploying via Helm, configure the external PostgreSQL connection in your `values.yaml`:

```yaml
postgresql:
  external:
    enabled: true
    host: "your-postgres-host"
    port: 5432
    username: "openhands_user"
    password: "your-secure-password"
    sslMode: "require"

Admin Console

When using the Admin Console, navigate to Settings → Database and configure the external PostgreSQL connection.


(Adjust field names to match actual implementation)

Comment on lines +84 to +94
## Network Requirements

Ensure your PostgreSQL instance is accessible from:

- The OpenHands application pods/services
- The Keycloak service
- The LiteLLM proxy service
- The Runtime API service

If using network policies or firewalls, allow connections on the PostgreSQL port (default: 5432)
from the OpenHands deployment.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Add clarity about which services connect to which databases. Currently, it's unclear if:

  • Each service connects only to its designated database (e.g., Keycloak → bitnami_keycloak only)
  • All services share the same database user credentials
  • Network policies need to allow all pods to all databases or specific mappings exist

Consider adding a table:

| Service | Database(s) Used |
|---------|------------------|
| OpenHands Server | `openhands`, `automations` |
| Keycloak | `bitnami_keycloak` |
| LiteLLM Proxy | `litellm` |
| Runtime API | `runtime_api_db` |

Comment on lines +49 to +82
```sql
-- Create the databases
CREATE DATABASE openhands;
CREATE DATABASE bitnami_keycloak;
CREATE DATABASE litellm;
CREATE DATABASE runtime_api_db;
CREATE DATABASE automations;

-- Create user without CREATEDB
CREATE USER openhands_user WITH PASSWORD 'your-secure-password';

-- Grant privileges on each database
GRANT ALL PRIVILEGES ON DATABASE openhands TO openhands_user;
GRANT ALL PRIVILEGES ON DATABASE bitnami_keycloak TO openhands_user;
GRANT ALL PRIVILEGES ON DATABASE litellm TO openhands_user;
GRANT ALL PRIVILEGES ON DATABASE runtime_api_db TO openhands_user;
GRANT ALL PRIVILEGES ON DATABASE automations TO openhands_user;

-- Connect to each database and grant schema privileges
\c openhands
GRANT USAGE, CREATE ON SCHEMA public TO openhands_user;

\c bitnami_keycloak
GRANT USAGE, CREATE ON SCHEMA public TO openhands_user;

\c litellm
GRANT USAGE, CREATE ON SCHEMA public TO openhands_user;

\c runtime_api_db
GRANT USAGE, CREATE ON SCHEMA public TO openhands_user;

\c automations
GRANT USAGE, CREATE ON SCHEMA public TO openhands_user;
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Consider adding important PostgreSQL best practices for enterprise deployments:

  1. Database encoding: Should databases be created with UTF8 encoding?
  2. User security: Explicitly recommend NOT using a superuser
  3. Connection limits: Any per-database or per-user connection limits to consider?
  4. Verification step: How to test that the setup is correct before installation?

Example addition after line 82:

-- (Optional) Set connection limits if needed
ALTER USER openhands_user CONNECTION LIMIT 100;

-- Verify the setup
\l openhands  -- Should show all 5 databases with openhands_user as owner or grantee

Add documentation for customers using their own PostgreSQL instance instead
of the bundled database. Includes:

- PostgreSQL version requirements (16.4.0+)
- Required databases (openhands, bitnami_keycloak, litellm, runtime_api_db, automations)
- User privilege requirements (CREATEDB for auto-creation, or manual setup)
- Schema permissions needed (USAGE, CREATE on public)

Co-authored-by: openhands <openhands@all-hands.dev>
- Add optional external PostgreSQL to preflight checklist
- Add Database Configuration section in Configure OpenHands

Co-authored-by: openhands <openhands@all-hands.dev>
Comment thread enterprise/external-postgres.mdx Outdated
Comment thread enterprise/external-postgres.mdx Outdated
Copy link
Copy Markdown
Contributor

@jlav jlav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of comments for cleanup, but overall looks good.

- Clarify CREATEDB privilege explanation (user auto-has privileges on DBs it creates)
- Remove SSL Mode config option (replicated installer doesn't support disabling SSL)
- Remove PgBouncer recommendation (no operational experience with it)

Co-authored-by: openhands <openhands@all-hands.dev>
@jpshackelford jpshackelford merged commit 736c663 into main May 19, 2026
5 checks passed
@jpshackelford jpshackelford deleted the docs/external-postgres-requirements branch May 19, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants