Skip to main content
The Phala Cloud CLI (phala) is a command-line tool for deploying and managing Confidential Virtual Machines (CVMs) on Phala Cloud. It provides commands for authentication, deployment, remote access, and CVM lifecycle management.

Installation

npm install -g phala
Verify installation:
phala --version

Update

npm update -g phala

Quick Start

# 1. Authenticate with your API key
phala login

# 2. Deploy your application
phala deploy

# 3. Check your CVM
phala cvms get

Command Overview

Authentication

CommandDescription
loginAuthenticate with Phala Cloud
logoutRemove stored credentials
statusCheck authentication and account status

Deployment

CommandDescription
deployCreate or update a CVM with Docker Compose

CVM Management

CommandDescription
cvmsList, inspect, start, stop, restart, and delete CVMs

Remote Access

CommandDescription
sshConnect to a CVM via SSH
cpCopy files to/from a CVM via SCP
SSH and SCP access require deploying with the --dev-os flag. See Enable SSH Access for details.

Docker Integration

CommandDescription
dockerBuild, push images and generate Docker Compose files

Local Development

CommandDescription
simulatorRun a local TEE simulator for development

Configuration

CommandDescription
configManage local CLI configuration
nodesList available TEE worker nodes

Global Options

These options are available for all commands:
OptionDescription
-h, --helpShow help for the current command
-v, --versionShow CLI version

Configuration File

The CLI reads configuration from phala.toml in your project directory. This file stores deployment settings:
# phala.toml
name = "my-app"
cvm_id = "app_abc123def456"
gateway_domain = "dstack-prod5.phala.network"
gateway_port = 443
When phala.toml exists, commands like deploy, ssh, and cp use these values as defaults.

Shell Completion

Generate shell completion scripts for your shell:
# Bash
phala completion --shell bash >> ~/.bashrc

# Zsh
phala completion --shell zsh >> ~/.zshrc

# Fish
phala completion --shell fish > ~/.config/fish/completions/phala.fish

Environment Variables

VariableDescription
PHALA_API_TOKENAPI token for authentication (alternative to phala login)

Common Workflows

Deploy a new application

# Create docker-compose.yml in your project
phala deploy --name my-app --region us-west

Update an existing deployment

# Re-run deploy to update (uses phala.toml settings)
phala deploy

Debug a running CVM

# Connect via SSH
phala ssh my-app

# View container logs
phala cvms logs my-app

# View VM serial logs
phala cvms serial-logs my-app

Copy files to/from CVM

# Upload a file
phala cp ./config.json my-app:/app/config.json

# Download a file
phala cp my-app:/app/data.json ./data.json

See Also