Skip to main content
Creates a new CVM by default. If --cvm-id is provided or phala.toml contains a CVM ID, updates the existing CVM instead.

Usage

phala deploy [options]

Basic Options

FlagDefaultDescription
-n, --name <name>directory nameCVM name
-c, --compose <path>docker-compose.ymlDocker Compose file path
-t, --instance-type <type>auto-selectedInstance type (e.g., tdx.small, tdx.medium)
-r, --region <region>auto-selectedPreferred region (e.g., us-west, eu-central)
-e, --env <value>Environment variable (KEY=VALUE) or path to .env file. Repeatable
--kms <type>phalaKMS type: phala, ethereum/eth, or base
--waitfalseWait for deployment/update to complete
--ssh-pubkey <path>~/.ssh/id_rsa.pubSSH public key path for access
--dev-osfalseUse development OS image (requires SSH key)
--public-logstrueMake CVM logs publicly accessible
--no-public-logsDisable public log access
--public-sysinfotrueMake CVM system info publicly accessible
--no-public-sysinfoDisable public system info access
--listedfalseList CVM on Phala Trust Center
--no-listedDon’t list CVM on Trust Center

Advanced Options

FlagDefaultDescription
--cvm-id <id>CVM ID for updating existing deployment
--disk-size <size>20GDisk size with unit (e.g., 50G, 100G)
--image <image>latestOS image version
--node-id <id>Deploy to specific node ID
--custom-app-id <id>Use custom App ID (requires —nonce for PHALA KMS)
--nonce <nonce>Nonce for deterministic app_id generation
--pre-launch-script <path>Path to pre-launch script
--private-key <key>Private key for on-chain KMS (ethereum/base)
--rpc-url <url>RPC URL for blockchain interaction
--debugfalseEnable debug logging

Deprecated Options

The following options are deprecated and will be removed in future versions:
  • --vcpu <count> - Use --instance-type instead
  • --memory <size> - Use --instance-type instead
  • --env-file <path> - Use -e <path> instead
  • --kms-id <id> - Use --custom-app-id instead
  • --uuid <uuid> - Use --custom-app-id instead

Examples

Simplest deployment (auto-select everything)

$ phala deploy
Analyzing docker-compose.yml...
Selected instance type: tdx.small
Selected region: us-west
Deploying CVM...
 CVM deployed successfully
App ID: app_abc123
URL: https://app_abc123.phala.cloud

Specify instance type and region

$ phala deploy -t tdx.medium -r us-west

Deploy with environment variables

$ phala deploy -e DATABASE_URL=postgres://... -e API_KEY=secret

Deploy with .env file

$ phala deploy -e .env

Deploy and wait for completion

$ phala deploy --wait
Deploying CVM...
Waiting for CVM to start...
 CVM is running
 All containers are healthy

Update existing CVM

$ phala deploy --cvm-id app_abc123 --wait
Updating CVM app_abc123...
 CVM updated successfully

Deploy with custom name

$ phala deploy -n my-production-app

Deploy with larger disk

$ phala deploy --disk-size 100G

Deploy with dev OS image and SSH access

$ phala deploy --dev-os --ssh-pubkey ~/.ssh/id_ed25519.pub

Deploy with Ethereum KMS

$ phala deploy --kms ethereum \
  --private-key 0x1234... \
  --rpc-url https://eth-mainnet.g.alchemy.com/v2/...

Deploy with Base KMS

$ phala deploy --kms base \
  --private-key 0x1234... \
  --rpc-url https://base-mainnet.g.alchemy.com/v2/...

Deploy with custom App ID

$ phala deploy --custom-app-id app_custom123 --nonce 42

Deploy to specific node

$ phala deploy --node-id node_xyz789

Deploy with pre-launch script

$ phala deploy --pre-launch-script ./setup.sh

Deploy unlisted CVM (private)

$ phala deploy --no-listed --no-public-logs --no-public-sysinfo

Error Codes

Common deployment errors:
CodeDescriptionSolution
ERR-1001Instance type not foundCheck available types with phala instance-types
ERR-1002No available resources match requirementsTry different instance type or region
ERR-1003Insufficient CPU capacityReduce CPU requirements or try different region
ERR-1004Insufficient memoryReduce memory requirements or try different region
ERR-2003OS image not availableUse --image to specify valid image version
ERR-2005Node not accessibleNode may be offline, try different node or omit --node-id

Instance Types

Common instance types:
  • tdx.small - 2 vCPU, 4GB RAM
  • tdx.medium - 4 vCPU, 8GB RAM
  • tdx.large - 8 vCPU, 16GB RAM
  • tdx.xlarge - 16 vCPU, 32GB RAM
See all types: phala instance-types

KMS Types

Phala KMS (Default)

Managed by Phala Cloud:
$ phala deploy --kms phala

Ethereum KMS

Use Ethereum wallet for key management:
$ phala deploy --kms ethereum \
  --private-key 0x... \
  --rpc-url https://eth-mainnet.g.alchemy.com/v2/...

Base KMS

Use Base network wallet:
$ phala deploy --kms base \
  --private-key 0x... \
  --rpc-url https://base-mainnet.g.alchemy.com/v2/...