phala) is a command-line tool for deploying and managing Confidential Virtual Machines (CVMs) on Phala Cloud. It is also available as the pha alias.
Install
npx phala / bunx phala
Get Started
Follow the Deploy Your First CVM tutorial to deploy a Jupyter notebook and test TEE functions in under 10 minutes.API Versioning
The CLI communicates with the Phala Cloud API using header-based versioning. The current default API version is2026-01-21.
The CLI sends an X-Phala-Version header with every request. This determines the response format returned by the server. See the JS SDK API Versioning page for details on version differences.
| Version | Status |
|---|---|
2026-01-21 | Default (current) |
2025-10-28 | Legacy |
--api-version global flag (added in v1.1.12):
Authentication
Deployment
| Command | Description |
|---|---|
deploy | Deploy new CVM or update existing one |
instance-types | List available instance types |
App Management
CVM Operations
| Command | Description |
|---|---|
logs | Fetch logs from a CVM (container, serial, stdout/stderr) |
ps | List containers of a CVM |
ssh | Connect to a CVM via SSH |
cp | Copy files to/from a CVM via SCP |
runtime-config | Show CVM runtime configuration |
Advanced
| Command | Description |
|---|---|
api | Make authenticated API requests |
self | CLI self-management (update) |
simulator | Local TEE simulator for development |
completion | Generate shell completion scripts |
Deprecated
These commands are deprecated and will be removed in a future release.| Command | Use instead |
|---|---|
auth | login, logout, status |
config | Profile-based credentials (~/.phala-cloud/credentials.json) |
docker | Standard docker CLI for build/push |
cvms create | deploy |
cvms upgrade | deploy --cvm-id <id> |
cvms logs | logs |
cvms serial-logs | logs --serial |
deploy options:
| Option | Use instead |
|---|---|
--vcpu, --memory | --instance-type |
--env-file | -e |
--kms-id, --uuid | --custom-app-id |
Profiles & Credentials
The CLI supports multiple authentication profiles stored in~/.phala-cloud/credentials.json.
Each profile stores:
| Field | Description |
|---|---|
token | API key |
api_prefix | API base URL |
workspace | Linked workspace (name + slug) |
user | Linked user (username + email) |
updated_at | Last update timestamp |
profiles to list profiles and switch to change the active profile.
Environment Variables
| Variable | Description |
|---|---|
PHALA_CLOUD_API_KEY | Override the stored API key |
PHALA_CLOUD_API_PREFIX | Override the API base URL |
PHALA_CLOUD_DIR | Override the credentials directory (default: ~/.phala-cloud) |
PHALA_UPDATE_CHANNEL | Release channel for self update (e.g., latest, beta) |
Configuration
Credentials are stored in~/.phala-cloud/credentials.json (schema version 1, supports multiple profiles).
Project-level configuration is in phala.toml in the working directory. Supported fields:
| Field | Type | Description |
|---|---|---|
id / uuid / app_id / instance_id / name | string | CVM identifier (any format) |
profile | string | Auth profile to use for this project |
gateway_domain | string | Custom gateway domain |
gateway_port | number | Custom gateway port |
compose_file | string | Path to Docker Compose file |
env_file | string | Path to .env file |
public_logs | boolean | Make container logs public |
public_sysinfo | boolean | Make system info public |
listed | boolean | List CVM in the public directory |
phala.toml:
Global Flags
| Flag | Description |
|---|---|
--json | Output in JSON format for programmatic use |
--api-token <token> | Override the stored API key for this command |
--api-version <version> | Override the API version (e.g., 2025-10-28, 2026-01-21). Added in v1.1.12 |
Related
- Cloud JS SDK — programmatic access via JavaScript/TypeScript
- Cloud API Reference — full REST API docs
- Local Development — local TEE simulator
- CI/CD Pipeline — GitHub Actions automation

