Deployment
Deploy your agent to Aleph Cloud using the LibertAI CLI. The CLI handles wallet setup, credit purchase, instance creation, and code deployment — all in one command.
Prerequisites
- Python 3.10+
- An agent project with a
docker-compose.ymlat the root - An SSH key pair (auto-detected from
~/.ssh/or pass--ssh-key)
Install the CLI
pip install libertai-clientPrepare your agent
Your agent directory must contain a docker-compose.yml (or docker-compose.yaml). The CLI uploads your code and runs docker compose up -d --build on the remote instance.
A minimal setup:
my-agent/
├── src/
│ ├── index.ts
│ └── agent.ts
├── package.json
├── Dockerfile
├── docker-compose.yml
├── .env.example
└── .env.prod # created by the CLI on first deployDockerfile
FROM node:24
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
COPY . .
CMD ["npx", "tsx", "src/index.ts"]docker-compose.yml
services:
agent:
build: .
restart: unless-stopped
env_file:
- path: .env.prod
required: false
- path: .env
required: falseTIP
restart: unless-stopped ensures your agent survives reboots — no systemd needed.
Deploy
From your agent directory:
libertai agentkit deployOr specify a path:
libertai agentkit deploy ./my-agentWhat happens
- Wallet — generates a new Base wallet (or reuses one from
.env.prod) - Funding — prompts you to send USDC to the wallet if the balance is low
- Credits — buys Aleph Cloud credits with USDC via x402
- Instance — creates an Aleph Cloud VM and waits for it to boot
- Deploy — uploads your code, installs Docker, and runs
docker compose up -d --build - Verify — confirms that the container is running
Options
| Flag | Description |
|---|---|
--ssh-key PATH | Path to SSH public key (default: auto-detect from ~/.ssh/) |
--credits FLOAT | Amount in USD to spend on Aleph credits at creation (default: 1.0) |
--register-only | Only create the Aleph instance, skip code deployment |
Stop
Tear down the Aleph instance and clean up resources:
libertai agentkit stopThis deletes the VM — your agent code remains on your local machine.
Environment variables
The CLI creates .env.prod in your agent directory with the generated WALLET_PRIVATE_KEY. Your docker-compose.yml should reference it via env_file so the container picks it up.
Any variables in .env are also included. Use .env for local overrides and .env.prod for production secrets.
Examples
Full working examples with Docker setup:

