Skip to main content
Your self-hosted deployment stores your cost data. Use your hosted CostGraph account to manage the deployment API key, license, and billing.

Prerequisites

Set up your account, cluster, data stores, and network access before installing.

Account and cluster

Prepare the account and infrastructure for the deployment.
  • A CostGraph account with an active self-hosted license.
  • A deployment API key from Settings > API keys.
  • A Kubernetes cluster, kubectl, and Helm 3 or later.
  • A dashboard hostname, an ingress controller, and a TLS certificate.
The examples use NGINX and a TLS Secret named costgraph-tls in the costgraph namespace.

Data stores

Use the following services for production. For an evaluation, the chart can run them inside the cluster.
Bundled stores have a single replica and no backups. Use external stores for production and enable PostgreSQL’s pg_partman and pg_cron extensions. Without them, partition maintenance does not run, large tables degrade, and inserts can eventually fail.

Network access

Allow outbound HTTPS on port 443 to the hosts your deployment uses.
Mirror the public images to avoid the Docker Hub hosts. External inbound access is only required for Slack webhook mode.

Install CostGraph

Use Helm to preserve the deployment’s generated credentials across upgrades.
Argo CD renders with helm template, which can regenerate encryption keys and make saved credentials unreadable. Follow the install-path requirements before using Argo CD.

Add the Helm repository

Add the repository and refresh its chart index.

Configure the deployment

Save one of these configurations as my-values.yaml. Replace the example key, endpoints, hostname, and TLS Secret with your own values.
Use the PostgreSQL, Redis-compatible, and VictoriaMetrics services you operate.Create the namespace if it does not exist.
Store the full database connection URL in a Secret. URL-encode reserved characters in the password before adding it to the URL.
Reference the Secret in my-values.yaml.
The first ingress host determines the dashboard URL. Set global.appBaseURL explicitly if TLS terminates before the ingress or you expose the services yourself. Its hostname must match the ingress when enabled.

Store production credentials

Reference Secrets you manage to keep production credentials out of Helm release history.
Create these Secrets in the release namespace and reference them through the corresponding setting.
  • global.controlPlane.existingSecret references a Secret containing control-plane-api-key and pricing-api-key.
  • global.postgres.existingSecret references a Secret containing postgres-url, including the password.
  • global.redis.existingSecret references a Secret containing redis-url.
Use the deployment API key for both control-plane and pricing keys unless you have a separate pricing key. A Redis URL containing credentials also belongs in a Secret.When you set global.controlPlane.existingSecret, create a registry pull Secret with the same deployment API key. Reference it through global.imagePullSecrets and each component’s deployment.imagePullSecrets. Follow Using your own registry credentials for the command and component configuration.

Deploy the chart

Install the release in the costgraph namespace.

Verify the installation

Wait for the backend rollout, then check database health. The doctor checks the database without making an outbound request.
Review the reported checks and resolve failures before connecting data sources. Use the troubleshooting steps if the deployment does not start.

Create the first account

Open your dashboard URL, such as https://costgraph.internal.example.com, and select Create an account. Creating the first account also creates the organization and assigns you the owner role. Invite other members from Settings. You do not need to configure sign-in. Accounts belong to this deployment, so you can reuse an email from another CostGraph account.

Connect your data

Choose the sources you want CostGraph to report on.

Provider integrations

Connect cloud, database, AI, and developer-tool accounts.

Kubernetes clusters

Collect cluster costs and usage with the CostGraph Operator.

Virtual machines

Monitor virtual machines and bare metal with the CostGraph Agent.

Custom cost data

Push FOCUS data from other sources to your API.

Configure collector endpoints

Use your deployment’s hostname for collectors and API clients. Follow the URL format for each collector.
Collectors default to hosted CostGraph. Set both the backend and remote write addresses to keep your data flowing to your self-hosted deployment.
Install the operator in each cluster you want to monitor. Both URLs use the base address without /api/v1.
For the cluster running CostGraph, you can instead enable the bundled operator. It uses the deployment’s internal service addresses.

Connect with OAuth

Register your own OAuth app for DigitalOcean, Akamai Cloud, Convex, or PlanetScale. Providers without configured OAuth credentials use the token form.
  1. Create the app in the provider’s developer settings.
  2. Set its redirect URL to https://costgraph.internal.example.com/integrations/oauth/callback, using your dashboard hostname.
  3. Set OAUTH_<SLUG>_CLIENT_ID and OAUTH_<SLUG>_CLIENT_SECRET on the backend. Use DIGITALOCEAN, LINODE, CONVEX, or PLANETSCALE as the slug.
  4. Set OAUTH_STATE_SECRET to a base64 value that decodes to at least 32 bytes.
For DigitalOcean, create a Secret in the release namespace.
Add the Secret references to my-values.yaml and upgrade the release.
Repeat the client ID and secret entries for each provider. For PlanetScale, grant read_organizations, read_invoices, read_databases, read_branches, and read_metrics_endpoints. Reconnect existing PlanetScale connections after changing scopes.

Connect GitHub for AutoPilot for CI

AutoPilot for CI needs a GitHub App that belongs to your deployment. GitHub sends workflow events to the webhook URL of the app itself, so the hosted CostGraph GitHub App cannot reach your deployment.
  1. In your GitHub organization settings, create a GitHub App.
  2. Set its callback URL to https://costgraph.internal.example.com/api/v1/automation/github/callback and its webhook URL to https://costgraph.internal.example.com/api/v1/webhooks/github, using your dashboard hostname. Set a webhook secret.
  3. Grant the repository permissions Actions (read and write), Administration (read), Pull requests (read), and Metadata (read). Grant the organization permission Administration (read). Grant Self-hosted runners (read and write) too when AutoPilot runs jobs on your cluster.
  4. Subscribe the app to the Workflow job event.
  5. Generate a private key and a client secret, and store the app’s settings in a Secret in the release namespace.
  1. Name the Secret in my-values.yaml and upgrade the release.
  1. Connect the organization on Settings > Integrations > GitHub.
  2. Set api-url to your dashboard address in each workflow that uses the CostGraph action, as described in AutoPilot for CI.

Price hardware you own

Register a rate and assign its pricing ID to hardware you own. Without a rate, CostGraph measures usage but cannot calculate its cost. Cloud resources use published provider rates. Follow Pricing IDs for rate registration, operator labels, agent configuration, and inheritance rules.

Maintain the deployment

Keep the database and encryption keys backed up before making release changes.

Back up the database and keys

Include the generated Secret in your database backups. Restore them as a pair so CostGraph can decrypt stored credentials.
Losing costgraph-selfhosted-generated invalidates issued API keys and prevents CostGraph from decrypting integration credentials. Helm preserves this Secret across upgrades and uninstalls, but it cannot recreate the lost keys.
Export the Secret to your secure backup location.

Upgrade CostGraph

Back up the database and generated Secret before upgrading. Migrations are not reversible, and helm rollback does not restore the previous schema. Refresh the chart index and upgrade the existing release in the same namespace.
The release applies pending migrations. For recovery instructions, read the chart’s README.

Troubleshoot startup

Check licensing if the deployment cannot initialize or users cannot sign in. Collect diagnostics if the issue persists.

License and sign-in errors

Check the hosted organization’s active plan if the backend reports no active license for this organization. Use the organization that issued the deployment API key. Auth UserPool not configured can mean the backend has not retrieved its signed configuration. Check the license and connection to the control plane. You do not need to supply Cognito settings.

Collect diagnostics

Run the doctor to collect version, schema, health, and redacted configuration details. The bundle excludes secrets and cost data.
Send the output to if the issue persists.

Next steps

Configure the components you need for your deployment.

Values reference

Configure credentials, images, storage, and component resources.

Graph AI

Connect a model provider for your self-hosted assistant.

Workflows

Set up automation and execution environments.

Slack

Connect your deployment to your team’s workspace.