Prerequisites
- Docker installed and running (or use GitHub Actions via template)
- Agent wrapped with Agent Stack SDK (Wrap Existing Agents or Build New Agent)
- Agent Stack installed (Quickstart)
Containerize Your Agent
Option 1: Use the Starter Template (Recommended)
The agentstack-starter template includes everything you need:- Production-ready Dockerfile
- GitHub Actions for automated builds
- Agent Stack deployment configuration
You can push your repository to GitHub and tag it to leverage the automated GitHub workflow to build the image directly in GitHub, without running Docker locally.
Option 2: Create Your Own Dockerfile
If you’re starting from scratch, create aDockerfile:
Port Configuration: The SDK defaults to port 10000. Make sure your Dockerfile
EXPOSE and ENV PORT match, and that your server.run() call uses the same port via environment variable.Deploy to Agent Stack
One-Command Deployment
From your agent directory, run:- ✓ Builds your Docker image locally
- ✓ Copies the image into Agent Stack’s VM
- ✓ Registers it as an available agent
Why “copy into VM”? Agent Stack runs in an isolated VM (Lima on Mac/Linux, WSL on Windows). Even though Docker Desktop builds your image, Agent Stack needs it copied into its VM to run it. The
add command handles this automatically.Verify Deployment
Check that your agent is registered:Test Your Agent
Test via CLI:http://127.0.0.1:8333
Advanced Options
Two-step build process
Two-step build process
If you need more control over the build:The
--import flag (enabled by default) copies your Docker image from Docker Desktop into Agent Stack’s VM.Build without importing
Build without importing
Test your Dockerfile builds without deploying:This creates the image in Docker Desktop but doesn’t copy it to Agent Stack. Useful for testing or if you plan to push to a registry instead.
Custom build options
Custom build options
Next Steps
Now that your agent is deployed, enhance it with extensions:LLM Service
Change your agent’s LLM at runtime and manage model connections dynamically
Agent Trajectory Visualization
Visualize your agent’s decision-making and interactions over time in the UI
Citations & Source Linking
Display references and link sources for transparency, directly in the UI
Structured Inputs (Forms)
Guide your users to provide consistent information with the form extension