Skip to main content
You can deploy a CVM on Phala Cloud in under five minutes. This guide walks you through the full flow — sign up, write a compose file, deploy, and verify — using whichever tool you prefer. We’ll deploy an nginx web server as the example app. The same steps apply to any Docker image.

Prerequisites

Choose an Instance Type

Phala Cloud offers several instance sizes. For a simple web server, tdx.small is plenty.
Instance TypevCPURAMGood For
tdx.small24 GBLightweight services, testing
tdx.medium48 GBProduction APIs, small databases
tdx.large816 GBMulti-container apps, ML inference
See all options with phala instance-types.

Write Your Docker Compose File

Create a docker-compose.yml that defines your services. Here’s a minimal nginx example:
services:
  web:
    image: nginx:stable
    ports:
      - "80:80"
Every service in the compose file runs inside the same CVM, so containers can communicate over localhost.

Deploy

Pick the method that fits your workflow. All three produce the same result: a running CVM with a public HTTPS endpoint.

Option A — Dashboard UI

1

Open the Deploy page

Navigate to your workspace and click Deploy in the top-right corner of the CVMs page.
2

Configure the CVM

Enter a name (e.g. my-nginx), paste your docker-compose.yml into the editor, select Phala as the KMS provider, pick a region, and choose tdx.small as the instance type.
3

Click Deploy

You’ll be redirected to the CVMs page. The status changes from starting to running in about one to two minutes.

Option B — CLI

1

Install the CLI

npm install -g phala
2

Deploy

Run phala deploy from the directory containing your docker-compose.yml. The CLI auto-selects a region and instance type if you don’t specify them.
export PHALA_CLOUD_API_KEY="phak_your_key"

phala deploy -n my-nginx -t tdx.small --wait
The --wait flag blocks until the CVM is fully running.

Option C — SDK

import { createClient } from "@phala/cloud";

const client = createClient({ apiKey: process.env.PHALA_CLOUD_API_KEY });

const provision = await client.provisionCvm({
  name: "my-nginx",
  vcpu: 2,
  memory: 4096,
  diskSize: 20,
  composeFile: {
    dockerComposeFile: `
services:
  web:
    image: nginx:stable
    ports:
      - "80:80"
`,
  },
});

const cvm = await client.commitCvmProvision({
  appId: provision.appId,
  composeHash: provision.composeHash,
  transactionHash: provision.transactionHash,
});

console.log("CVM deployed:", cvm);

Verify Your Deployment

Once the status shows running, your CVM has a public endpoint. The URL follows this pattern:
https://<app-id>-<port>.dstack-pha-<node>.phala.network
You can find the exact URL in the dashboard under CVM > Home > INGRESS, or query it from the CLI:
phala cvms get my-nginx
Open the endpoint in your browser. You should see the nginx welcome page.
Endpoints may take 30 to 60 seconds to become reachable after the CVM enters the running state.

Verify TEE Attestation

Every CVM generates a Remote Attestation report proving it runs inside a genuine TEE. Navigate to Attestations in the CVM sidebar and click Check Attestation to verify it in the TEE Attestation Explorer. For details, see Get Attestation and Verify.

Next Steps