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

# Deploying Prisme.ai on Google Cloud (GCP)

> Step-by-step guide and recommendations for deploying Prisme.ai in a self-hosted environment on Google Cloud Platform (GCP).

Google Cloud Platform provides powerful managed services ideal for deploying Prisme.ai. This guide covers recommended infrastructure, deployment steps, and best practices for self-hosting Prisme.ai on GCP.

***

## GCP Prerequisites

Before starting, ensure you have:

* A **GCP account** with adequate permissions.
* **Google Cloud SDK (gcloud CLI)** installed and authenticated.
* Basic knowledge of Kubernetes and essential GCP services (GKE, Cloud SQL, Memorystore, Cloud Storage).

***

## Recommended GCP Infrastructure

Deploy Prisme.ai leveraging these recommended GCP-managed services:

<AccordionGroup>
  <Accordion title="Kubernetes (GKE)">
    * **Service**: Google Kubernetes Engine (GKE)
    * **Recommended Configuration**:
      * Node pool with 3-5 nodes (`e2-standard-4` or similar, 4 vCPU / 16GB RAM)
      * Enable Autoscaling and Auto-upgrade
    * **Best Practices**:
      * Multi-zone clusters for high availability
      * Enable Workload Identity for secure access to GCP resources
    * **Deployment Command**:

      ```bash theme={null}
      gcloud container clusters create prisme-ai-cluster \
        --zone europe-west1-b --num-nodes 3 \
        --machine-type e2-standard-4 --enable-autoscaling \
        --min-nodes 3 --max-nodes 5
      ```
  </Accordion>

  <Accordion title="Database (MongoDB or PostgreSQL)">
    * **Service**:
      * Self-managed MongoDB on GKE or MongoDB Atlas integrated via VPC peering
      * Or Cloud SQL for Postgre
    * **Recommended Configuration**:
      * 3-node replica set
    * **Best Practices**:
      * Automated backups and maintenance
      * Use Cloud SQL Proxy or VPC peering for security and isolation
  </Accordion>

  <Accordion title="Search Engine (Elasticsearch)">
    * **Service**: Elasticsearch on Elastic Cloud or deployed via GKE-managed containers
    * **Recommended Configuration**:
      * Elasticsearch cluster with at least 3 nodes (8GB RAM per node)
    * **Best Practices**:
      * Snapshot regularly to Cloud Storage
      * Secure using private networking and access controls
  </Accordion>

  <Accordion title="Redis Cache (Memorystore)">
    * **Service**: Google Cloud Memorystore for Redis
    * **Recommended Configuration**:
      * Standard tier, 3-node configuration
      * High availability and auto-failover enabled
    * **Best Practices**:
      * Regular monitoring and alerting
      * Set maintenance windows for updates
  </Accordion>

  <Accordion title="Object Storage (Cloud Storage)">
    * **Service**: Google Cloud Storage
    * **Recommended Configuration**:
      * Buckets configured for private uploads, public assets, and model storage
    * **Best Practices**:
      * Lifecycle management rules
      * CDN integration with Cloud CDN for public assets
  </Accordion>

  <Accordion title="File Storage (Filestore)">
    * **Service**: Google Cloud Filestore
    * **Recommended Configuration**:
      * Standard or Premium tier based on performance needs
    * **Best Practices**:
      * Mount Filestore as a Persistent Volume Claim (PVC) in Kubernetes
      * Regularly snapshot via scheduled tasks
  </Accordion>
</AccordionGroup>

***

## GCP Deployment Steps

<Steps>
  <Step title="Create Project & Enable APIs">
    Create a GCP project and enable required APIs:

    ```bash theme={null}
    gcloud projects create prisme-ai
    gcloud services enable container.googleapis.com \
      sqladmin.googleapis.com redis.googleapis.com file.googleapis.com storage.googleapis.com
    ```
  </Step>

  <Step title="Deploy GKE Cluster">
    Provision a Kubernetes cluster with GKE:

    ```bash theme={null}
    gcloud container clusters create prisme-ai-cluster --zone europe-west1-b
    ```
  </Step>

  <Step title="Provision Databases & Storage">
    * Deploy MongoDB via MongoDB Atlas or self-host on GKE or Cloud SQL for Postgre.
    * Set up Redis via Memorystore.
    * Provision Elasticsearch via Elastic Cloud or Kubernetes.
    * Create Cloud Storage buckets and Filestore instances.
  </Step>

  <Step title="Configure DNS & Networking">
    Set up Google Cloud DNS or external DNS:

    * `api.yourdomain.com`
    * `studio.yourdomain.com`
    * `*.pages.yourdomain.com`
  </Step>

  <Step title="Deploy Prisme.ai via Helm">
    Deploy Prisme.ai using Helm to your GKE cluster:

    ```bash theme={null}
    helm repo add prismeai https://helm.prisme.ai/charts
    helm install prisme-core prismeai/prismeai-core --namespace prisme -f values.yaml
    ```
  </Step>

  <Step title="Ingress & SSL Setup">
    Configure Kubernetes Ingress via GKE’s built-in Ingress Controller:

    ```bash theme={null}
    kubectl apply -f ingress.yaml
    ```

    Use Google-managed SSL certificates for secure HTTPS access.
  </Step>
</Steps>

***

## Security Best Practices

<CardGroup cols={2}>
  <Card title="Workload Identity" icon="shield-halved">
    * Use GKE Workload Identity for secure and granular permissions between Kubernetes and Google Cloud services.
  </Card>

  <Card title="Private VPC" icon="network-wired">
    * Configure a private VPC for your cluster.
    * Use Cloud NAT for controlled egress internet access.
  </Card>

  <Card title="Secrets & Configuration" icon="key">
    * Store sensitive configurations securely in Google Secret Manager.
    * Implement regular key rotation policies.
  </Card>

  <Card title="Monitoring & Logging" icon="eye">
    * Integrate with Google Cloud Operations Suite (Cloud Monitoring and Cloud Logging).
    * Set alerts for abnormal resource usage.
  </Card>
</CardGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Helm Deployment" icon="ship" href="/self-hosting/kubernetes/helm">
    Deploy Prisme.ai using Helm on Kubernetes
  </Card>

  <Card title="Products Configuration" icon="store" href="/self-hosting/configuration/products-installation">
    Configure your Prisme.ai AI products
  </Card>

  <Card title="Install from scratch (v27)" icon="rocket" href="/self-hosting/operations/install-v27">
    Fresh-install walkthrough.
  </Card>

  <Card title="Migration v27" icon="arrow-right-arrow-left" href="/self-hosting/operations/migration-v27">
    Migrate an existing instance to v27.
  </Card>

  <Card title="Operations Management" icon="scale-unbalanced" href="/self-hosting/operations/scaling">
    Learn about scaling operations efficiently
  </Card>
</CardGroup>
