Skip to main content

Deploy on a Remote Server

This guide explains how to deploy Agenta on a remote server, such as a cloud instance or dedicated machine.

Prerequisites

  • A remote server with:
    • Docker installed
    • Docker Compose installed
    • Root access or sudo privileges
    • Open ports for HTTP traffic (default: 80)
  • Git installed

Step 1: Configure Environment Variables

Set up three essential environment variables:

# Replace 'your-domain.com' with your server's domain or IP address
export DOMAIN_NAME="http://your-domain.com" # Full URL including protocol
export BARE_DOMAIN_NAME="your-domain.com" # Domain/IP without protocol
export AGENTA_PORT="80" # Port for the Agenta service

Note: If using an IP address instead of a domain, use the same format:

export DOMAIN_NAME="http://192.168.1.100"
export BARE_DOMAIN_NAME="192.168.1.100"

Step 2: Clone Agenta Repository

Clone the Agenta repository and navigate to its directory:

git clone https://github.com/agenta-ai/agenta
cd agenta

Step 3: Build and Deploy

Deploy Agenta in two steps:

  1. Build only the web interface with your environment configuration:
docker compose -f docker-compose.gh.yml build --no-cache agenta-web
info

Note: We only need to rebuild the web image because the domain name is hardcoded at build time in Next.js. Other services can use the pre-built images from Docker Hub.

  1. Start all services:
docker compose -f docker-compose.gh.yml up -d

Verify Your Deployment

After deployment, verify that Agenta is running:

  1. Check container status:
docker compose ps
  1. Access the web interface by opening your domain/IP in a browser:
http://your-domain.com

Troubleshooting

If you encounter issues:

  1. Check container logs:
  2. Verify environment variables are set correctly:
  3. Ensure ports are open and accessible:

Important Notes

  • Use HTTP instead of HTTPS for initial setup
  • Ensure your firewall allows traffic on the specified port
  • For production deployments, consider setting up HTTPS with SSL/TLS certificates (docker-compose files with tutorials are planned. Write us in the Slack channel if you are working on this and we might be able to help)

Need help? Either: