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 dstack-kms CVM on GCP
Run your own dstack-kms instance on GCP so you have full control over key policy. This page covers the production deployment workflow: bootstrap the KMS, register its attestation on-chain, and verify it’s serving keys correctly.Reference: This guide is based on the official deployment guide.
Platform Requirement:dstack-cloud deploymust be run on Linux. macOS is not supported because the FAT32 shared disk image created by macOSdosfstoolsfails GCP image validation.
Prerequisites
- A GCP project with Confidential VM (TDX) quota
gcloudCLI installed and authenticated (gcloud auth login)gsutilavailable in PATH (required bydstack-cloud deployfor GCS upload)docker/docker composenode+npm(for smart contract deployment)jqmtools(providesmcopy)dosfstools(providesmkfs.fat)dstack-cloudCLI installed:- For on-chain governance mode:
- A blockchain RPC endpoint (e.g.,
https://sepolia.base.org) - A wallet with sufficient balance
- Deployed smart contracts (DstackKms, DstackApp) — see Deploy On-chain KMS Smart Contracts
- You’ll need
KMS_CONTRACT_ADDRandAPP_CONTRACT_ADDRbefore KMS bootstrap/finish
- A blockchain RPC endpoint (e.g.,
Note: This guide uses pre-built KMS Docker images. If you need to build KMS from source or customize configuration, see the official KMS build guide.
Step 1: Configure dstack-cloud
Follow the same steps as Run a Workload on GCP to set up your global config and GCS bucket.Step 2: Pull the OS Images
Follow the same steps as Run a Workload on GCP to download thedstack-cloud-0.6.0 images.
Ifdisk.rawis missing, deployment may create a VM that cannot boot (UEFI loop:Failed to load image).
Step 3: Create a KMS Project
app.jsondocker-compose.yamlprelaunch.sh
Step 4: Build or Select KMS Docker Image
Use pre-built image or build your own:Step 5: Configure KMS Runtime
Replace generated compose/prelaunch with KMS config.The compose templates below come from:
Phala-Network/dstack-cloud-deployment-guide
Clone that repo first if you only cloned this docs repo.
Option A: Direct RPC
prelaunch.sh:
Option B: Light Client (Helios)
prelaunch.sh can stay the same unless your template requires different vars.
Step 6: Deploy KMS CVM
Step 7: Open Firewall
12001/tcp: KMS API (required)18000/tcp: auth-api debug endpoint (optional)18545/tcp: helios RPC (light mode only)
Step 8: Bootstrap (First-time)
8.1 Check KMS endpoint
8.2 Get attestation info
device_idmr_aggregatedos_image_hash
8.3 Register measurements on-chain (required for on-chain mode)
device_idmust come fromOnboard.GetAttestationInfo(not dummy serial-console value).
8.4 Run bootstrap
8.5 Finish
Step 9: Verify
Common Issues
| Issue | Solution |
|---|---|
| macOS image/shared-disk errors | Use Linux host for deploy |
Boot image ... not found | Ensure image search path is correct and disk.raw exists under <path>/dstack-cloud-0.6.0/ |
VM RUNNING but 12001/18000 unreachable + serial shows UEFI: Failed to load image | Wrong boot image format/content. Ensure disk.raw comes from dstack-cloud-0.6.0-uki.tar.gz (do not rename rootfs.img.parted.verity as disk.raw) |
gsutil missing | Install Google Cloud SDK/gsutil and ensure in PATH |
mcopy missing | Install mtools |
mkfs.fat missing | Install dosfstools |
missing field 'status' from KMS flow | Usually indicates auth-eth / on-chain config mismatch (RPC/contract addresses/registrations). Verify ETH_RPC_URL, KMS_CONTRACT_ADDR, APP_CONTRACT_ADDR, and on-chain image/MR/device registration |
| KMS port responds but APIs return 404 | Shared disk config stale/wrong; dstack-cloud deploy --delete |

