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
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.Deploying from a GitHub Repository
Deploying from a GitHub Repository
You can also deploy an agent directly from a GitHub repository. The This command tells Agent Stack to:Example with
agentstack add command supports various URL formats to specify the repository, version, and location of your agent’s code.The supported formats include:- Basic URL:
https://github.com/myorg/myrepo - Git Protocol URL:
git+https://github.com/myorg/myrepo - URL with .git suffix:
https://github.com/myorg/myrepo.git - URL with Version Tag:
https://github.com/myorg/myrepo@v1.0.0 - URL with Branch Name:
https://github.com/myorg/myrepo@my-branch - URL with Subfolder Path:
https://github.com/myorg/myrepo#path=/path/to/agent - Combined Formats:
https://github.com/myorg/myrepo.git@v1.0.0#path=/path/to/agent - Enterprise GitHub:
https://github.mycompany.com/myorg/myrepo
Example
To deploy an agent from a specific branch and subfolder, you would run:- Fetch the
mainbranch of themy-awesome-agentsrepository. - Look for the agent’s
Dockerfileand source code in the/my-agentdirectory. - Build the Docker image and register it with the platform.
Example with --dockerfile
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