Quick Start: Self-Hosting Agenta
This guide explains how to set up Agenta on your local machine using Docker Compose, either using the default port 80 or a custom port.
Looking to deploy on Kubernetes instead? See the Deploy on Kubernetes guide for Helm chart installation.
Prerequisites
-
Docker installed on your machine (Download Docker)
-
Permission to reach the Docker daemon socket,
/var/run/docker.sock. It is owned byrootand thedockergroup. Run the commands below asroot, prefix them withsudo, or add your user to thedockergroup:sudo usermod -aG docker $USERThen open a new login shell so the group applies. A member of the
dockergroup can start a container that mounts the host filesystem, which makes the group equivalent to root on that machine.
Quick Setup (Port 80)
- Clone Agenta:
git clone --depth 1 --filter=blob:none --sparse https://github.com/Agenta-AI/agenta
cd agenta
git sparse-checkout set hosting/docker-compose api/oss/databases/postgres api/ee/databases/postgres
- Copy configuration and, optionally, edit it:
cp hosting/docker-compose/oss/env.oss.gh.example hosting/docker-compose/oss/.env.oss.gh
- Start Agenta:
docker compose -f hosting/docker-compose/oss/docker-compose.gh.yml --env-file hosting/docker-compose/oss/.env.oss.gh --profile with-web --profile with-traefik up -d
- Access Agenta at
http://localhost.
Anyone who can reach your instance can sign up and gets their own organization. If people you do not fully trust can reach it, see Restrict Sign-ups and Organization Creation.
Using a Custom Port
To use a different port (e.g., 90):
Change the following variables in the environment file /hosting/docker-compose/oss/.env.oss.gh then restart the services:
TRAEFIK_PORT=90
AGENTA_SERVICES_URL=http://localhost:90/services
AGENTA_API_URL=http://localhost:90/api
AGENTA_WEB_URL=http://localhost:90
Upgrading to the Latest Version of Agenta
Updating your local Agenta installation to the latest version, requires pulling the latest version with --pull always and running migrations if any.
- Pull the latest version:
docker compose -f hosting/docker-compose/oss/docker-compose.gh.yml --env-file hosting/docker-compose/oss/.env.oss.gh --profile with-web --profile with-traefik up -d --pull always
- Run migrations if needed:
docker exec -e PYTHONPATH=/app -w /app/oss/databases/postgres/migrations/core agenta-oss-gh-api-1 alembic -c alembic.ini upgrade head
Consult the upgrading guide for more details.
Troubleshooting
If Agenta doesn't start properly, check these common issues:
- Port conflicts: Verify if another application is using your chosen port.
- Container status: Run
docker psto check if all Agenta containers are running - Logs: Examine container logs with:
docker logs agenta-oss-gh-webdocker logs agenta-oss-gh-api
- SDK connectivity issues: If you're using the Agenta SDK from outside Docker to connect to your localhost Agenta instance and experiencing connection failures, ensure the
DOCKER_NETWORK_MODEenvironment variable is unset (this is the default behavior). - Docker network layout: The Docker networks are defined in the compose files. See
hosting/docker-compose/oss/docker-compose.gh.yml(OSS) orhosting/docker-compose/ee/docker-compose.dev.yml(EE) for the network names and service attachments. - Lack of memory provided to docker: If you are experiencing the web container restarting and dying unexpectedly, the most likely cause is that you are running out of memory. You may need to increase the memory allocated to docker (desktop).
- The runner container does not start and Docker reports
error gathering device information while adding custom device "/dev/fuse": the host has no FUSE device. See Run agents locally.
To set up a development environment with features like hot-reloading, refer to our Development Guide.
Agents run in a separate runner service. To understand the runner topology and where agent code executes, see How agents run.
Need help? Either:
- Create a GitHub issue
- Join our Slack community for quick support