Skip to content

Program Deployment

The program command group allows you to deploy and manage serverless functions (micro-VMs) on the Aleph Cloud network.

Overall Usage

bash
aleph program [OPTIONS] COMMAND [ARGS]...

Options

OptionDescription
--helpShow the help prompt and exit

Key Commands

CommandDescription
createDeploy a new serverless program
updateUpdate the code of an existing program
deleteForget a program (and its code STORE unless --keep-code)
listList programs owned by an address
showShow full information about a single program

Creating a Program

Deploy a new serverless program. The CLI auto-uploads PATH as a STORE message, then publishes the PROGRAM message referencing it.

Usage

bash
aleph program create [OPTIONS] <PATH> <ENTRYPOINT>

Arguments

ArgumentDescription
PATHSource code path: directory, .zip, or .squashfs
ENTRYPOINTProgram entrypoint, e.g. main:app for Python or run.sh for a shell script

Options

OptionDescription
--name <NAME>Friendly name (stored in metadata.name)
--runtime <RUNTIME>Runtime: preset slug (e.g. python3.12) or a 64-char item hash. Defaults to defaults.runtime
--size <SIZE>Resource preset slug (e.g. 1vcpu-2gb). Mutually exclusive with --vcpus / --memory
--vcpus <N>Number of virtual CPUs
--memory <SIZE>Memory size (e.g. 2GB, 512MiB)
--timeout-seconds <N>Idle timeout before shutdown (seconds) [default: 30]
--internetAllow internet access from the program
--persistentMake the program persistent (always running) instead of ephemeral
--updatableAllow future updates with aleph program update
--env-vars <VARS>Environment variables (comma-separated KEY=value pairs)
--persistent-volumename=N,mount=PATH,size=SIZE[,persistence=host|store]; can be repeated
--ephemeral-volumemount=PATH,size=SIZE; can be repeated
--immutable-volumeref=HASH,mount=PATH[,use_latest=BOOL]; can be repeated
--storage-engine <ENGINE>Storage engine for the code STORE: storage (default) or ipfs
--payment-type <TYPE>hold (default) or credit
--channel <CHANNEL>Channel name
--on-behalf-of <ADDR>Sign on behalf of another address (requires authorization)
--account <ACCOUNT>Named account (defaults to the active account)
--private-key <KEY>Hex-encoded private key (or set ALEPH_PRIVATE_KEY)
--chain <CHAIN>Signing chain (required with --private-key)
--dry-runBuild and sign the message but don't submit it
--helpShow this message and exit
bash
# Deploy a Python function
aleph program create ./updated_prog.zip main:app

# Deploy a persistent program with a specific runtime and resources
aleph program create ./updated_prog.zip main:app \
  --name test \
  --persistent \
  --runtime python3.12 \
  --size 1vcpu-2gb \
  --timeout-seconds 60

Showing Program Details

Show full information about a single program: creation time, ownership, per-ref freshness for code, runtime, data, and volumes.

Usage

bash
aleph program show [OPTIONS] <ITEM_HASH>
bash
# Show details of a program
aleph program show ITEM_HASH

# Show as JSON
aleph program show ITEM_HASH --json

Deleting a Program

Usage

bash
aleph program delete [OPTIONS] <ITEM_HASH>

Options

OptionDescription
--reason <REASON>Reason for deletion (recorded on the FORGET message) [default: "User deletion"]
-y, --yesSkip the confirmation prompt
--keep-codeKeep the source code STORE instead of deleting it
--account <NAME>Named account (defaults to the active account)
--private-key <K>Hex-encoded private key
--dry-runBuild and sign the message but don't submit it
--helpShow this message and exit
bash
# Delete a program
aleph program delete ITEM_HASH

Listing Programs

List all programs associated with an account.

Usage

bash
aleph program list [OPTIONS]

Options

OptionDescription
--address <ADDR>Owner address of the programs
--jsonOutput results as JSON
--helpShow this message and exit
bash
# List all your programs
aleph program list

# List programs for a specific address as JSON
aleph program list --address ADDRESS --json

Supported Runtimes

Aleph Cloud supports multiple programming languages. Use a preset slug (e.g. python3.12) or provide a 64-char item hash for a custom runtime. Omit --runtime to use the network's default runtime.

Troubleshooting

Common issues and solutions:

  • Deployment failures: Check your code for errors and ensure all dependencies are specified
  • Resource limitations: Increase memory or CPU if your function is resource-intensive
  • Timeout issues: Optimize your code or increase the function timeout setting