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

# Deploy in Centralized Mode

> Connect your gateway to the Golf Gateway Control Plane for centralized management.

Connect your gateway to the Golf Gateway Control Plane to receive centralized configuration, security policies, and monitoring.

## Prerequisites

* Golf Gateway account (sign up at [app.golf.dev](https://app.golf.dev))
* Docker and Docker Compose installed on your deployment machine
* Network access to Control Plane URL

<Note>
  Golf Gateway **requires Redis** for session management, rate limiting, replay protection, and authentication caching. The Docker Compose examples below include Redis automatically.
</Note>

## Create a gateway in Control Plane

1. Log in to the Admin Portal
2. Navigate to **Gateway Manager** > **Add Gateway**
3. Enter a gateway name (e.g., `production-gateway-1`)
4. Click **Create**
5. **Copy the API key** - you won't see it again

<Warning>
  Save your gateway API key securely. It cannot be retrieved after creation.
</Warning>

## Deploy the gateway

<Tabs>
  <Tab title="Docker Compose (Recommended)">
    ```yaml theme={null}
    version: "3.8"
    services:
      redis:
        image: redis:7-alpine
        ports:
          - "6379:6379"
        healthcheck:
          test: ["CMD", "redis-cli", "ping"]
          interval: 10s
          timeout: 5s
          retries: 3

      golf-gateway:
        image: ghcr.io/golf-mcp/golf-gateway-backend:latest
        ports:
          - "8080:8080"
        environment:
          GOLF_GATEWAY_ID: <your-gateway-id>
          GOLF_GATEWAY_API_KEY: <your-api-key>
          GOLF_GATEWAY_CONTROL_PLANE_URL: https://api.golf.dev
          GOLF_CACHE_REDIS_URL: redis://redis:6379/0
        depends_on:
          redis:
            condition: service_healthy
    ```
  </Tab>

  <Tab title="Kubernetes">
    ```yaml theme={null}
    # Redis is required - use a Redis service or managed Redis
    # Example using a simple Redis deployment:
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: redis
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: redis
      template:
        metadata:
          labels:
            app: redis
        spec:
          containers:
          - name: redis
            image: redis:7-alpine
            ports:
            - containerPort: 6379
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: redis
    spec:
      selector:
        app: redis
      ports:
      - port: 6379
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: golf-gateway
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: golf-gateway
      template:
        metadata:
          labels:
            app: golf-gateway
        spec:
          containers:
          - name: golf-gateway
            image: ghcr.io/golf-mcp/golf-gateway-backend:latest
            ports:
            - containerPort: 8080
            env:
            - name: GOLF_GATEWAY_ID
              valueFrom:
                secretKeyRef:
                  name: golf-gateway-secrets
                  key: gateway-id
            - name: GOLF_GATEWAY_API_KEY
              valueFrom:
                secretKeyRef:
                  name: golf-gateway-secrets
                  key: api-key
            - name: GOLF_GATEWAY_CONTROL_PLANE_URL
              value: "https://api.golf.dev"
            - name: GOLF_CACHE_REDIS_URL
              value: "redis://redis:6379/0"
    ```

    <Tip>
      For production, use a managed Redis service (AWS ElastiCache, Azure Cache for Redis, or Redis Enterprise) for high availability.
    </Tip>
  </Tab>
</Tabs>

<Info>
  Golf Gateway offers additional Helm charts for different deployment scenarios. Contact the Golf team for more details on available charts and enterprise deployment options.
</Info>

## Verify the connection

1. Check gateway status:
   ```bash theme={null}
   curl http://localhost:8080/health
   ```
   Expected response: `{"status": "healthy", ...}`

2. In the Admin Portal, verify gateway status shows **Active**

## Configuration received from Control Plane

When connected, your gateway automatically receives:

* MCP server configurations
* Security policies (rate limiting, RBAC)
* Export destinations (Elasticsearch, OTEL, Sentinel)
* Encryption keys for credential storage

<Tip>
  Gateways send heartbeats every 30 seconds. Configuration changes in Control Plane are applied within one heartbeat interval.
</Tip>

## Related guides

* [Deploy in Distributed Mode](/gateway/guides/getting-started/deploy-hybrid-mode) - Local server definitions with central policies
