Documentation Index
Fetch the complete documentation index at: https://docs.phala.com/llms.txt
Use this file to discover all available pages before exploring further.
Run a Workload on GCP
Deploy a Docker application as a dstack CVM on GCP with Intel TDX. This page covers the full workflow — from configuration to verification — including how to choose between managed and self-hosted KMS endpoints.Prerequisites
- A GCP project with Confidential VM quota enabled
- Intel TDX Confidential VMs are available in select zones (for example
us-central1-a)
- Intel TDX Confidential VMs are available in select zones (for example
gcloudCLI installed and authenticated- Linux host for deployment (recommended)
- Docker installed
gsutilavailable in PATHmtools(mcopy) anddosfstools(mkfs.fat) installeddstack-cloudCLI installed
Why Linux + mtools + dosfstools? dstack-cloud deploy builds a shared FAT image and needs these tools in local environment.
Step 1: Configure dstack-cloud
Edit global config:
dstack-cloud uses JSON config (~/.config/dstack-cloud/config.json). Example:
KMS Options
| Option | Description | When to Use |
|---|---|---|
| Phala Official KMS | Use managed KMS endpoints in services.kms_urls | Quick start, testing |
| Self-hosted KMS | Use your own KMS endpoint in services.kms_urls | Production, compliance, full control |
services.kms_urls to your deployed KMS URL (see Run a dstack-kms CVM on GCP for how to set one up).
If you run with key provider tpm/none (no external KMS), remove .env in project and remove env_file from app.json.
Step 2: Pull the OS Image
Fordstack-cloud-0.6.0, download both archives:
Ifdisk.rawis missing, VM may boot-loop with UEFIFailed to load image.
Step 3: Create a Project
Step 4: Configure Project (app.json)
Update key fields in app.json:
gcp_config.projectgcp_config.zonegcp_config.bucketgcp_config.instance_name
- External KMS mode (recommended):
"key_provider": "kms" - No external KMS mode:
"key_provider": "tpm"(ornone)
- If you use dstack gateway URL routing, keep
gateway_enabled: true - If you access service directly via VM public IP + opened port, set
gateway_enabled: false
Step 5: Define Your Application
Editdocker-compose.yaml:
Step 6: (Optional) Add Environment Variables
If your app needs secrets/config, create.env:
Step 7: Deploy
dstack-cloud will:
- Prepare shared config files
- Upload image artifacts to GCS
- Create a GCP TDX Confidential VM
- Start VM and run compose workload
Step 8: Open Firewall
Open app port(s):Step 9: Verify
Check status:- Direct VM mode (
gateway_enabled=false): - Gateway mode (
gateway_enabled=true): use URL printed indstack-cloud status.
Managing Your Deployment
Common Issues
| Issue | Solution |
|---|---|
Boot image 'dstack-cloud-0.6.0' not found locally | Ensure disk.raw exists under <image_search_paths>/dstack-cloud-0.6.0/ |
| VM RUNNING but serial log shows UEFI load failures | Wrong boot image source; use official -uki.tar.gz image containing disk.raw |
gsutil not found | Install Google Cloud SDK / ensure PATH |
mcopy not found | Install mtools |
mkfs.fat not found | Install dosfstools |
.env found but KMS is not enabled | Remove .env and remove env_file from app.json, or set key provider back to kms |
| App not reachable immediately | Wait for compose startup to complete; check dstack-cloud logs |

