> ## Documentation Index
> Fetch the complete documentation index at: https://manifest.build/llm-gateway/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy the LLM Gateway on Google Cloud

> Deploy the Manifest LLM Gateway with Cloud Run, Cloud SQL for PostgreSQL, Secret Manager, and Cloud Shell.

<Card title="Open GCP Cloud Shell" icon="external-link" href="https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fmnfst%2Fmanifest&cloudshell_workspace=deploy%2Fgcp&cloudshell_tutorial=TUTORIAL.md&cloudshell_image=gcr.io%2Fds-artifacts-cloudshell%2Fdeploystack_custom_image&shellonly=true">
  Cloud Shell guided deploy for Cloud Run, Cloud SQL PostgreSQL, and Secret
  Manager.
</Card>

## Overview

The Google Cloud deploy path uses Cloud Shell and DeployStack to run Terraform. It provisions Cloud Run for the gateway container, Cloud SQL for PostgreSQL, and Secret Manager for runtime secrets.

## Prerequisites

* A Google Cloud project.
* Billing enabled on the selected project.
* Permission to enable APIs and create Cloud Run, Cloud SQL, IAM, and Secret Manager resources.

This stack creates paid resources, including Cloud SQL.

## Deploy

Open the [GCP Cloud Shell guided deploy](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fmnfst%2Fmanifest\&cloudshell_workspace=deploy%2Fgcp\&cloudshell_tutorial=TUTORIAL.md\&cloudshell_image=gcr.io%2Fds-artifacts-cloudshell%2Fdeploystack_custom_image\&shellonly=true).

The walkthrough prompts for:

* Google Cloud project.
* Region.
* Cloud Run service name.
* Gateway image URL.
* Cloud SQL machine tier.
* Maximum Cloud Run instances.
* Cloud SQL deletion protection.

Enable the required APIs:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
gcloud services enable \
  iam.googleapis.com \
  run.googleapis.com \
  sqladmin.googleapis.com \
  secretmanager.googleapis.com
```

Run the installer:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
deploystack install
```

The first deploy usually takes 10-15 minutes because Cloud SQL needs time to provision. The Terraform config patches `BETTER_AUTH_URL` to the final Cloud Run URL after the service is created.

## Open the gateway

Print the service URL:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
terraform output service_url
```

Open the URL and create the first account. Fresh installs redirect to `/setup`; the first account you create becomes the admin.

Verify the deployment:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -fsS "$(terraform output -raw health_check_url)"
```

## Request logs

The stack provisions a private Cloud Storage bucket for [request logs](/llm-gateway/docs/llm-gateway/docs/request-logs). The deploy prints its name as the `recording_bucket` output.

## Production notes

* Cloud SQL deletion protection is enabled by default.
* Configure a custom domain before using OAuth callbacks in production.
* Keep Secret Manager access limited to the Cloud Run service account.
* The request logs bucket keeps its objects on teardown. Export or delete its contents before `deploystack uninstall`.

Relevant Google Cloud docs:

* [Cloud Run](https://cloud.google.com/run/docs)
* [Cloud SQL for PostgreSQL](https://cloud.google.com/sql/docs/postgres)
* [Secret Manager](https://cloud.google.com/secret-manager/docs)
