Skip to main content
This command is marked as unstable and may change in future releases.

Command: phala cp

Syntax

phala cp [options] <source> <destination>

Description

Copy files to/from a CVM via SCP

Arguments

ArgumentDescription
<source>Source path (local or cvm-name:path, use :path for phala.toml cvm_id)
<destination>Destination path (local or cvm-name:path, use :path for phala.toml cvm_id)

Options

OptionDescription
-i, --identity <value>SSH identity file (private key)
-p, --port <value>SSH port (priority: CLI > phala.toml > 443)
-g, --gateway <value>Gateway domain (priority: CLI > phala.toml > API)
-r, --recursiveRecursively copy directories
-v, --verboseShow verbose SCP details
--dry-runPrint SCP command without executing

Global Options

OptionDescription
-h, --helpShow help information for the current command
--versionShow CLI version
--api-token TOKEN, --api-key TOKENAPI token used for authentication
-j, --json, --no-jsonOutput in JSON format
--api-version <value>API version to use (e.g. 2025-10-28, 2026-01-21)

Examples

  • Upload from phala.toml
phala cp ./local.txt :/root/remote.txt
  • Upload to CVM
phala cp ./local.txt app_123:/root/remote.txt
  • Download from CVM
phala cp app_123:/root/remote.txt ./local.txt
  • Offline mode
phala cp -g dstack-pha-prod7.phala.network -p 16185 ./file.txt app_123:/root/
  • Upload directory recursively
phala cp -r ./local_dir app_123:/root/remote_dir
  • Copy with custom SSH key
phala cp -i ~/.ssh/custom_key app_123:/root/file.txt ./file.txt
  • Print the SCP command without executing
phala cp ./local.txt app_123:/root/remote.txt --dry-run