Skip to main content

Deploy TEN agent service

After customizing your agent through the playground or by editing property.json directly, you can deploy it as a production service. This guide walks you through creating a release Docker image and running your agent service.

Prerequisites

Before deploying, ensure you have:

  • Completed agent configuration
  • Docker installed on your deployment machine
  • Access to your .env file with required API keys

Build the Docker image

Create a production-ready Docker image of your agent service using the provided Dockerfile in the project root.

Standard build

Build the default agent configuration:


_1
docker build -t ten-agent-server .

For Apple Silicon machines, specify the platform:


_1
docker build -t ten-agent-server . --platform linux/amd64

Custom agent builds

To build specific agent configurations like demo or experimental versions, use the optional USE_AGENT build argument:


_1
docker build --build-arg USE_AGENT=agents/examples/demo -t ten-agent-server .


_1
docker build --build-arg USE_AGENT=agents/examples/experimental -t ten-agent-server .

Run the service

Launch your agent service container with the necessary configuration:


_1
docker run -itd -p 8083:8080 --env-file .env --name ten-agent-server ten-agent-server

Your agent service is accessible on port 8083.

Test the deployment

Verify your deployment is working correctly using the following methods.

API testing

The service exposes REST APIs for agent interaction. Find the complete API reference at TEN Agent Server Documentation.

Playground testing

Test your deployed service using the playground client:


_1
NEXT_PUBLIC_EDIT_GRAPH_MODE=false AGENT_SERVER_URL=http://localhost:8083 pnpm dev

info
  • Set AGENT_SERVER_URL to your service location. Replace localhost with your server IP for remote deployments.
  • Set NEXT_PUBLIC_EDIT_GRAPH_MODE to false since the production image doesn't include the development server.

Deploy with playground UI

For a complete deployment including the playground interface, follow these additional steps.

Build playground image

Navigate to the playground directory and build the UI image:


_2
cd playground
_2
docker build --build-arg EDIT_GRAPH_MODE=false -t ten-agent-playground .

Run playground container

Launch the playground container configured to connect to your agent service:


_1
docker run -itd -p 4000:3000 -e AGENT_SERVER_URL=http://host.docker.internal:8083 --name ten-agent-playground ten-agent-playground

info
  • Use host.docker.internal when the agent service runs in another Docker container on the same machine.
  • For remote deployments, replace with your server's IP address.
  • Always set EDIT_GRAPH_MODE to false for production deployments.