docs/self-hosting/reference-architectures/google-cloud-run.mdx
This guide outlines a reference architecture for deploying Infisical in a self-hosted configuration using Google Cloud Run. It is intended to provide a scalable, secure, and production-ready baseline for organizations choosing Google Cloud Platform (GCP) as their infrastructure provider.
Cloud Run: Infisical service is containerized and deployed as fully managed Cloud Run services.
Cloud SQL: Infisical uses Postgres as its persistence layer. As such, Cloud SQL for PostgreSQL is used.
MemoryStore for Redis: To schedule jobs, process audit logs and cache performance, Infisical requires Redis.
This architecture leverages Google Cloud's managed services to achieve high availability and scalability out of the box:
Cloud Run:
Cloud SQL:
MemoryStore:
Cloud Load Balancer:
MemoryStore (Redis):

Remember to replace `<version>` with the docker image tag of your choice.
```bash
ENCRYPTION_KEY=<your_encryption_key>
AUTH_SECRET=<your_auth_secret>
DB_CONNECTION_URI="<your_db_connection_uri>"
SITE_URL="<your_site_url>"
REDIS_URL="<your_redis_url>"
```
View all available configurations.
You will want to setup Postgres and Redis within Google Cloud Platform to connect to Infisical.
Once you have added the required environment variables to the `Environment Variables` section within Cloud Run,
create the container to get Infisical up and running.

<Warning>
The above environment variable values are only to be used as an example and should not be used in production
</Warning>
Enable Connect to a VPC for outbound traffic: This enables the service to talk to private resources (e.g., a Cloud SQL database, Redis instance on a private IP) inside your Google Cloud VPC network.
Select Send traffic directly to a VPC: It gives lower latency and better performance, but uses more IPs from the subnet.
Once the container is running, verify the installation by opening your web browser and navigating to the Site URL.
</Step> </Steps>