← Back to Agent

Agent Deployment

Configure where and how this agent runs — cloud providers, Docker, VPS, local process management, knowledge bases, and lifecycle controls.

Contents

Overview

For Everyone

The Deployment tab is mission control for your agent's infrastructure. It answers three questions: Where does the agent run? Is it healthy? How do I control it? You can deploy agents to cloud platforms (Fly.io, AWS, GCP, Azure, Railway), run them in Docker containers, on your own servers, or locally on this machine. Once deployed, you can start, stop, restart, and monitor the agent from here.

For Developers

Deployment configuration is stored in engineAgent.config.deployment. The save mechanism is state-aware:

Lifecycle actions:

Knowledge bases: GET /knowledge-bases?agentId=…. Process manager detection: GET /system/process-managers. PM2 installation: POST /system/install-pm2.

How It Works

  1. Configure — Click "Edit" on the Deployment Status card. Select a target platform and fill in the required credentials and settings.
  2. Save — Save the deployment configuration. This doesn't deploy — it just stores the config.
  3. Deploy — Click "Deploy" to initiate the deployment process. The agent starts on the configured target.
  4. Monitor — The status card shows state (running, stopped, error), health, uptime, endpoint URL, and deployment details.
  5. Control — Use Stop, Restart, or Deploy buttons to manage the agent's lifecycle.

Key Concepts

Deployment Targets

Eight deployment targets are supported, each with platform-specific configuration:

TargetBest ForDifficulty
Fly.ioQuick cloud deployment, auto-scalingEasy
RailwaySimple PaaS deploymentEasy
DockerContainerized environmentsMedium
LocalDevelopment and testingEasy
AWS EC2Enterprise cloud, full controlAdvanced
Google CloudGCP ecosystem integrationAdvanced
AzureMicrosoft ecosystem integrationAdvanced
VPSCustom servers, bare metalMedium

Fly.io

Recommended for quick deployments. Configure:

AWS EC2

Full cloud deployment on Amazon Web Services:

Google Cloud GCE

Microsoft Azure

Railway

Docker

VPS / Bare Metal

Local (In-Process)

For development and single-server deployments:

Port Validation

When you enter a port number, the system automatically checks whether it's available before allowing you to save:

IndicatorMeaning
Green border + checkmarkPort is available — you can save and deploy.
Red border + errorPort is already in use — save is blocked. The error shows which process is using it (e.g., "Port 3100 is in use by node (PID 12345)").

API Reference

POST /system/check-port
Body: { "port": 4100 }
Response (available): { "available": true, "port": 3102 }
Response (in use):    { "available": false, "port": 3102, "process": "node (PID 12345)" }
Tip: PM2 availability is auto-detected. If PM2 isn't installed, the dashboard offers a one-click "Install PM2" button.

Deployment Status

The status card shows:

Lifecycle Controls

Knowledge Bases

The Knowledge Bases card shows shared knowledge sources assigned to this agent. These provide the agent with organizational context and reference materials via RAG (Retrieval-Augmented Generation).

Auto-Assignment on Creation

When a new agent is created, knowledge bases are automatically assigned based on the agent's organization:

Sync Knowledge Button

If new knowledge bases are added after the agent was created, click the "Sync Knowledge" button in the card header to pick them up. This triggers the same auto-assignment logic:

API Reference

POST /knowledge-bases/auto-assign/:agentId
Body: { "clientOrgId": "org-uuid" }  // optional, auto-detected from agent
Response: { "agentId": "...", "assigned": ["kb-1", "kb-2"], "count": 2 }
For non-technical users: When you create a new knowledge base and want existing agents to access it, just go to the agent's Deployment tab and click "Sync Knowledge." The agent will immediately be able to search the new documents — no restart needed.

Agent Deletion

A 5-step confirmation flow prevents accidental deletion:

  1. Click "Delete Agent"
  2. Three confirmation steps with increasingly clear warnings
  3. Type the agent's name to confirm
  4. Final deletion via DELETE /bridge/agents/:id
Danger: Agent deletion is permanent. All configuration, history, and data associated with the agent will be lost. This cannot be undone.

Best Practices

Troubleshooting

Deploy fails with authentication error

Verify your API token/credentials for the target platform. Tokens may have expired or been revoked. For AWS, ensure the IAM user has EC2 permissions.

Agent shows "Deploying" indefinitely

The deployment process may have stalled. Check the target platform's dashboard (Fly.io, AWS Console, etc.) for deployment logs. Try stopping and redeploying.

Local deployment can't find PM2

PM2 may not be installed or not in PATH. Use the "Install PM2" button in the deployment editor. If installation fails, install manually: npm install -g pm2.

Health status shows "Unhealthy"

The agent process may have crashed. Check logs on the deployment platform. Common causes: missing environment variables, incorrect model configuration, or insufficient memory.

Port is in use — can't save

The port validation detected another process using the port. Either change the port number or stop the conflicting process. The error message shows the process name and PID — you can stop it with kill <PID> or choose a different port. Common conflicts: another agent already running on that port, or a development server.

Delete confirmation name doesn't match

The typed name must match exactly (case-insensitive) with the agent's display name. Check the agent name shown in the header.

AgenticMail Enterprise Documentation Report an issue