|
| 1 | +--- |
| 2 | +title: Cloud UI configuration |
| 3 | +sidebar_label: Configuration |
| 4 | +description: |
| 5 | + Configure environment variables, OIDC authentication, and deployment options |
| 6 | + for the Cloud UI |
| 7 | +--- |
| 8 | + |
| 9 | +This guide covers the environment variables and configuration options for |
| 10 | +running the Cloud UI in different environments. |
| 11 | + |
| 12 | +## Environment variables |
| 13 | + |
| 14 | +The Cloud UI is configured entirely through environment variables. The table |
| 15 | +below lists the required and optional variables. |
| 16 | + |
| 17 | +### Required variables |
| 18 | + |
| 19 | +| Variable | Description | |
| 20 | +| -------------------- | --------------------------------------------------------------------------------------- | |
| 21 | +| `OIDC_ISSUER_URL` | Issuer URL of your OIDC provider (for example, `https://your-org.okta.com`) | |
| 22 | +| `OIDC_CLIENT_ID` | OAuth2 client ID registered with your OIDC provider | |
| 23 | +| `OIDC_CLIENT_SECRET` | OAuth2 client secret for the registered client | |
| 24 | +| `BETTER_AUTH_SECRET` | Secret used to encrypt session tokens. Generate one with `openssl rand -base64 32` | |
| 25 | +| `BETTER_AUTH_URL` | Base URL where the Cloud UI is accessible (for example, `https://cloud-ui.example.com`) | |
| 26 | +| `API_BASE_URL` | URL of the Registry Server API (for example, `https://registry.example.com`) | |
| 27 | + |
| 28 | +### Optional variables |
| 29 | + |
| 30 | +| Variable | Description | |
| 31 | +| ----------------- | ---------------------------------------------------------------------------------------------------------------- | |
| 32 | +| `DATABASE_URL` | PostgreSQL connection string for the auth database. When omitted, the Cloud UI uses an in-memory SQLite database | |
| 33 | +| `TRUSTED_ORIGINS` | Comma-separated list of allowed CORS origins | |
| 34 | + |
| 35 | +## Configure OIDC authentication |
| 36 | + |
| 37 | +The Cloud UI delegates authentication to an external OIDC provider using |
| 38 | +[Better Auth](https://www.better-auth.com/). It works with any |
| 39 | +standards-compliant provider, including Okta, Microsoft Entra ID, and Auth0. |
| 40 | + |
| 41 | +To configure your provider: |
| 42 | + |
| 43 | +1. Register a new OAuth2/OIDC application in your identity provider. |
| 44 | +2. Set the redirect URI to `<BETTER_AUTH_URL>/api/auth/callback/oidc` (for |
| 45 | + example, `https://cloud-ui.example.com/api/auth/callback/oidc`). |
| 46 | +3. Copy the issuer URL, client ID, and client secret into the corresponding |
| 47 | + environment variables. |
| 48 | + |
| 49 | +:::tip |
| 50 | + |
| 51 | +For local development or testing, use the built-in mock OIDC provider by |
| 52 | +starting the Docker Compose stack with the `mock` profile. See the |
| 53 | +[quickstart](./quickstart.mdx) for details. |
| 54 | + |
| 55 | +::: |
| 56 | + |
| 57 | +## Deployment options |
| 58 | + |
| 59 | +### Docker |
| 60 | + |
| 61 | +Build and run the Cloud UI as a standalone container: |
| 62 | + |
| 63 | +```bash title="Build the image" |
| 64 | +docker build -t toolhive-cloud-ui:latest . |
| 65 | +``` |
| 66 | + |
| 67 | +```bash title="Run the container" |
| 68 | +docker run -p 3000:3000 \ |
| 69 | + -e OIDC_ISSUER_URL=https://your-org.okta.com \ |
| 70 | + -e OIDC_CLIENT_ID=your-client-id \ |
| 71 | + -e OIDC_CLIENT_SECRET=your-client-secret \ |
| 72 | + -e BETTER_AUTH_SECRET=$(openssl rand -base64 32) \ |
| 73 | + -e BETTER_AUTH_URL=http://localhost:3000 \ |
| 74 | + -e API_BASE_URL=http://your-registry-server:8080 \ |
| 75 | + toolhive-cloud-ui:latest |
| 76 | +``` |
| 77 | + |
| 78 | +The application listens on port 3000. |
| 79 | + |
| 80 | +### Docker Compose |
| 81 | + |
| 82 | +The repository includes a Docker Compose file that starts the full stack (Cloud |
| 83 | +UI, Registry Server, and databases). See the [quickstart](./quickstart.mdx) for |
| 84 | +a walkthrough. |
| 85 | + |
| 86 | +For production use with a real OIDC provider, create a `.env` file with your |
| 87 | +credentials and start without the `mock` profile: |
| 88 | + |
| 89 | +```bash title=".env" |
| 90 | +OIDC_ISSUER_URL=https://your-org.okta.com |
| 91 | +OIDC_CLIENT_ID=your-client-id |
| 92 | +OIDC_CLIENT_SECRET=your-client-secret |
| 93 | +BETTER_AUTH_SECRET=your-generated-secret |
| 94 | +``` |
| 95 | + |
| 96 | +```bash |
| 97 | +make compose-up |
| 98 | +``` |
| 99 | + |
| 100 | +### Kubernetes (Helm) |
| 101 | + |
| 102 | +The Cloud UI repository includes a Helm chart in the `helm/` directory. To |
| 103 | +deploy on Kubernetes: |
| 104 | + |
| 105 | +```bash |
| 106 | +helm install cloud-ui ./helm \ |
| 107 | + --set env.OIDC_ISSUER_URL=https://your-org.okta.com \ |
| 108 | + --set env.OIDC_CLIENT_ID=your-client-id \ |
| 109 | + --set env.OIDC_CLIENT_SECRET=your-client-secret \ |
| 110 | + --set env.BETTER_AUTH_SECRET=your-generated-secret \ |
| 111 | + --set env.BETTER_AUTH_URL=https://cloud-ui.example.com \ |
| 112 | + --set env.API_BASE_URL=http://registry-server:8080 |
| 113 | +``` |
| 114 | + |
| 115 | +:::info |
| 116 | + |
| 117 | +For production Kubernetes deployments, store sensitive values like |
| 118 | +`OIDC_CLIENT_SECRET` and `BETTER_AUTH_SECRET` in a Kubernetes Secret rather than |
| 119 | +passing them as Helm values. |
| 120 | + |
| 121 | +::: |
| 122 | + |
| 123 | +The Helm chart supports: |
| 124 | + |
| 125 | +- Replica count and horizontal pod autoscaling (HPA) |
| 126 | +- Resource requests and limits |
| 127 | +- Liveness and readiness probes |
| 128 | +- Ingress configuration |
| 129 | +- Custom service types (ClusterIP, NodePort, LoadBalancer) |
| 130 | + |
| 131 | +Refer to the chart's `values.yaml` for the full set of configurable parameters. |
| 132 | + |
| 133 | +## Next steps |
| 134 | + |
| 135 | +- [Publish servers](../guides-registry/publish-servers.mdx) to populate your |
| 136 | + catalog with MCP server entries. |
| 137 | +- Set up [Registry Server authentication](../guides-registry/authentication.mdx) |
| 138 | + to control access to the catalog API. |
| 139 | +- Learn about the [Registry Server architecture](../guides-registry/intro.mdx) |
| 140 | + to understand how the backend works. |
0 commit comments