Skip to main content

Deploy Locally

This guide explains how to set up Agenta on your local machine, either using the default port 80 or a custom port.

Prerequisites

Quick Setup (Port 80)

  1. Clone Agenta:
git clone https://github.com/Agenta-AI/agenta && cd agenta
  1. Edit hosting/docker-compose/oss/.env.oss.gh and add your LLM provider API keys.

  2. Start Agenta services:

docker compose -f hosting/docker-compose/oss/docker-compose.gh.yml --env-file hosting/docker-compose/oss/.env.oss.gh --profile with-web up -d
  1. Access Agenta at http://localhost.

Using a Custom Port

To use a different port (e.g., 81):

  1. Clone Agenta:
git clone https://github.com/Agenta-AI/agenta && cd agenta
  1. Edit hosting/docker-compose/oss/.env.oss.gh and add your LLM provider API keys.

  2. Edit the port configuration in the environment file /hosting/docker-compose/oss/.env.oss.gh:

AGENTA_PORT=81
AGENTA_HOST=http://host.docker.internal:81
SERVICE_URL_TEMPLATE=http://localhost:81/services/{path}
  1. Build and run:
docker compose -f hosting/docker-compose/oss/docker-compose.gh.yml --env-file=hosting/docker-compose/oss/.env.oss.gh --profile with-web up -d --build
info

You need at least to rebuild the web image because the port is hardcoded at build time in Next.js. You can use the pre-build image for the rest of the services.

  1. Access Agenta at http://localhost:81.

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.

  1. 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 up -d --pull always
  1. Run migrations if needed:
docker exec -e PYTHONPATH=/app -w /app/oss/databases/postgres/migrations agenta-oss-gh-api-1 alembic -c alembic.oss.ini upgrade head

Consult the migration guide for more details.

Troubleshooting

If Agenta doesn't start properly, check these common issues:

  1. Port conflicts: Verify if another application is using your chosen port.
  2. Container status: Run docker ps to check if all Agenta containers are running
  3. Logs: Examine container logs with:
    docker logs agenta-oss-gh-web
    docker logs agenta-oss-gh-api
info

To set up a development environment with features like hot-reloading, refer to our Development Guide.

Need help? Either: