Documentation

Docs
/
Agent Deployment

Agent Deployment

Complete guide to deploying agents on AgentHub

Deploying an agent has three main steps:

  • Creating the agent blueprint
  • Creating a build
  • Starting an instance

There are two main ways to deploy an agent:

  1. GitHub Integration - Connect your GitHub repository for automatic deployment through the platform.
  2. API Deployment - Use the AgentHub API to create blueprints, builds, and instances programmatically.

GitHub Integration

The simplest way to deploy - connect your GitHub repository and we handle the rest.

Process:

  1. Navigate to Deploy
  2. Select your GitHub repository
  3. Choose branch and configure
  4. Click deploy

Benefits:

  • Automatic containerization
  • Dependency management
  • Environment variable setup
  • Description and summary for discoverability

Auto-Detection

AgentHub automatically detects:

  • Language/Framework - Python, Node.js, Go, etc.
  • Dependencies - requirements.txt, package.json, go.mod
  • Entry Point - main.py, index.js, or specified in config
  • Port - Detected from code or defaults to 8080

Build Process

When you deploy, AgentHub:

  1. Clones your repository
  2. Detects framework and dependencies
  3. Builds optimized container image
  4. Runs health checks
  5. Deploys to production
  6. Generates unique URLs

Custom Dockerfile

If you need custom build steps, include a Dockerfile in your repository:

FROM python:3.11-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application
COPY . .

# Run agent
EXPOSE 8080
CMD ["python", "main.py"]

API Deployment

For advanced users, you can deploy agents using the AgentHub API.

Steps to Deploy via API

### Create agent
POST {{baseUrl}}/agents/
Content-Type: application/json
Authorization: Bearer {{apiKey}}

{
  "organization_id": "{{orgId}}",
  "name": "HTTP Agent",
  "description": "An example agent.",
  "summary": "Brief overview of HTTP Agent functionality",
  "github_repo": "https://github.com/your-org/http-agent",
  "stdin_enabled": false,
  "http_port": 80,
  "http_health_check_path": "/",
  "github_branch": "test",
  "working_directory": "/",
  "dockerfile_path": "Dockerfile",
  "long_running": false,
  "env_vars": [
    {
      "name": "KEY",
      "value": "VALUE",
      "required": true,
      "description": "Example environment variable",
      "hidden": true
    },
    {
      "name": "KEY2",
      "value": "VALUE",
      "required": true,
      "description": "Example environment variable",
      "hidden": false
    }

  ]
}

Need help? Check our FAQ or contact support