Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@
"enterprise/enterprise-vs-oss",
"enterprise/quick-start",
"enterprise/analytics",
"enterprise/external-postgres",
{
"group": "K8s Install",
"pages": [
Expand Down
109 changes: 109 additions & 0 deletions enterprise/external-postgres.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: External PostgreSQL
description: Configure OpenHands Enterprise to use your own PostgreSQL database
icon: database
---

OpenHands Enterprise can connect to an external PostgreSQL instance instead of using
the bundled database. This is useful when you have existing database infrastructure,
need specific backup/recovery procedures, or require high availability configurations.

## 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.


## Required Databases

OpenHands Enterprise uses the following databases:

| Database | Purpose |
|----------|---------|
| `openhands` | Core application data |
| `bitnami_keycloak` | Identity and access management |
| `litellm` | LLM proxy configuration and usage tracking |
| `runtime_api_db` | Runtime/sandbox management |
| `automations` | Scheduled tasks and automation workflows |

## Database User Requirements

The PostgreSQL user provided to OpenHands Enterprise needs specific privileges depending
on your preferred setup approach.

### Option 1: Automatic Database Creation (Recommended)

If you provide a database user with the `CREATEDB` privilege, OpenHands Enterprise will
automatically create all required databases during installation.

```sql
-- Create user with CREATEDB privilege
CREATE USER openhands_user WITH PASSWORD 'your-secure-password' CREATEDB;
```

When the user creates its own databases, it will automatically have all necessary privileges
on them including the ability to manage the `public` schema.

### Option 2: Manual Database Creation

If your security policies prevent granting `CREATEDB`, you must manually create all
databases before installation:

```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;
```
Comment on lines +50 to +83
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


## Network Requirements

Ensure your PostgreSQL instance is accessible from:

- The OpenHands application pods/services
- The Keycloak service

Check warning on line 90 in enterprise/external-postgres.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/external-postgres.mdx#L90

Did you really mean 'Keycloak'?
- 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.
Comment on lines +85 to +95
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` |


## Configuration

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

- **Host**: Your PostgreSQL server hostname or IP

Check warning on line 102 in enterprise/external-postgres.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/external-postgres.mdx#L102

Did you really mean 'hostname'?
- **Port**: PostgreSQL port (default: 5432)
- **Username**: The database user created above
- **Password**: The user's password

<Note>
For production deployments, we recommend enabling SSL/TLS for database connections.
</Note>
4 changes: 4 additions & 0 deletions enterprise/k8s-install/index.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Kubernetes Installation
description: Deploy OpenHands Enterprise into your own Kubernetes cluster using Helm
icon: dharmachakra

Check warning on line 4 in enterprise/k8s-install/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/k8s-install/index.mdx#L4

Did you really mean 'dharmachakra'?
---

OpenHands Enterprise can be deployed into an existing Kubernetes cluster using Helm.
Expand Down Expand Up @@ -35,8 +35,8 @@
|-----------|-------------|
| **OpenHands Server** | Main application server handling UI, API, and agent orchestration |
| **Runtime API** | Manages sandbox lifecycle—provisioning, scaling, and cleanup |
| **Runtimes (Sandboxes)** | Isolated containers where agents execute code |

Check warning on line 38 in enterprise/k8s-install/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/k8s-install/index.mdx#L38

Did you really mean 'Runtimes'?
| **Keycloak** | Identity and access management |

Check warning on line 39 in enterprise/k8s-install/index.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/k8s-install/index.mdx#L39

Did you really mean 'Keycloak'?
| **LiteLLM Proxy** | Routes requests to your LLM provider(s) |
| **PostgreSQL** | Persistent storage for application data |
| **Redis** | Caching and session management |
Expand All @@ -50,6 +50,10 @@

## Guides

<Card title="External PostgreSQL" icon="database" href="/enterprise/external-postgres">
Configure OpenHands to use your own PostgreSQL database instead of the bundled instance.
</Card>

<Card title="Resource Limits" icon="gauge-high" href="/enterprise/k8s-install/resource-limits">
Configure memory, CPU, and storage for optimal performance.
</Card>
Expand Down
8 changes: 8 additions & 0 deletions enterprise/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
- Inbound ports are open: `80`, `443`, and `30000`
- Outbound domains are reachable from the VM
- GitHub App prerequisites are prepared
- (Optional) [External PostgreSQL](/enterprise/external-postgres) instance provisioned if using your own database

<Warning>
Do not run the installer until preflight checks pass.
Expand Down Expand Up @@ -175,9 +176,9 @@
done
```

Expected: each hostname above resolves to your VM's public IP address.

Check warning on line 179 in enterprise/quick-start.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/quick-start.mdx#L179

Did you really mean 'hostname'?

Check warning on line 179 in enterprise/quick-start.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/quick-start.mdx#L179

Did you really mean 'VM's'?

Test that a runtime wildcard hostname resolves:

Check warning on line 181 in enterprise/quick-start.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/quick-start.mdx#L181

Did you really mean 'hostname'?

```bash
getent hosts "test.runtime.${BASE_DOMAIN}" || nslookup "test.runtime.${BASE_DOMAIN}"
Expand Down Expand Up @@ -212,7 +213,7 @@
done
```

Any HTTP response code other than `000` is acceptable for reachability checks

Check warning on line 216 in enterprise/quick-start.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/quick-start.mdx#L216

Did you really mean 'reachability'?
(for example `200`, `301`, `302`, `401`, `403`, `405`).

If any check fails, stop and resolve before continuing:
Expand All @@ -223,10 +224,10 @@

| Requirement | Why It Exists |
|------------|----------------|
| `443/TCP` inbound | Primary HTTPS entrypoint for users and service hostnames |

Check warning on line 227 in enterprise/quick-start.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/quick-start.mdx#L227

Did you really mean 'hostnames'?
| `30000/TCP` inbound | Replicated/KOTS Admin Console for install and configuration |
| `80/TCP` inbound | HTTP entrypoint used for ingress/redirect behavior |
| `*.runtime.<domain>` DNS + cert SAN | Runtime sandboxes are addressed by dynamic runtime-specific hostnames |

Check warning on line 230 in enterprise/quick-start.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/quick-start.mdx#L230

Did you really mean 'hostnames'?
| `replicated.app`, `proxy.replicated.com` | Replicated control-plane/license/install paths |
| `images.r9...`, `charts.r9...`, `updates.r9...`, `install.r9...` | Vendor distribution image/chart/update/install endpoints |
| `traefik.github.io` | Embedded cluster ingress chart repository |
Expand Down Expand Up @@ -292,7 +293,7 @@
### 5. Upload TLS certificate (if not provided with the install command)

If you did not provide certificates with the `install` command, select **"Upload your own"**,
enter your base domain under **Hostname**, upload your private key and SSL certificate, then click **Continue**.

Check warning on line 296 in enterprise/quick-start.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/quick-start.mdx#L296

Did you really mean 'Hostname'?

![Upload TLS certificate](./images/upload-tls-certificate.png)

Expand All @@ -317,7 +318,7 @@

### Domain Configuration

- Select **"Derive hostnames from domain (recommended)"**

Check warning on line 321 in enterprise/quick-start.mdx

View check run for this annotation

Mintlify / Mintlify Validation (allhandsai) - vale-spellcheck

enterprise/quick-start.mdx#L321

Did you really mean 'hostnames'?
- Enter your base domain (e.g., `openhands.example.com`)

### Certificate Configuration
Expand All @@ -330,6 +331,13 @@

Enter your Anthropic API key from the [Anthropic Console](https://console.anthropic.com/).

### Database Configuration

By default, OpenHands Enterprise uses a bundled PostgreSQL database. If you need to use your
own PostgreSQL instance (for example, to integrate with existing database infrastructure or
meet specific backup/HA requirements), see [External PostgreSQL](/enterprise/external-postgres)
for setup instructions.

### GitHub Authentication

Enable GitHub Authentication in the Admin Console, then follow these steps to create and
Expand Down
Loading