This guide provides a full Ansible playbook to deploy Agenta with Docker Compose on Debian 10+, Ubuntu LTS, and RHEL 9+ compatible hosts. Agenta is an open-source LLMOps platform for prompt management, evaluation, and observability.
- name: Deploy Agenta LLMOps Platform
hosts: agenta
become: true
vars:
app_root: /opt/agenta
app_port: 80
traefik_port: 80
agenta_repo_url: https://github.com/Agenta-AI/agenta
tasks:
- name: Install Docker on Debian/Ubuntu
apt:
name:
- docker.io
- docker-compose-plugin
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install Docker on RHEL family
dnf:
name:
- docker
- docker-compose-plugin
state: present
when: ansible_os_family == "RedHat"
- name: Enable and start Docker
service:
name: docker
state: started
enabled: true
- name: Install Git
package:
name: git
state: present
- name: Clone Agenta repository
git:
repo: "{{ agenta_repo_url }}"
dest: "{{ app_root }}"
depth: 1
version: main
- name: Copy environment configuration
copy:
src: "{{ app_root }}/hosting/docker-compose/oss/env.oss.gh.example"
dest: "{{ app_root }}/hosting/docker-compose/oss/.env.oss.gh"
remote_src: true
force: false
- name: Configure custom port (optional)
lineinfile:
path: "{{ app_root }}/hosting/docker-compose/oss/.env.oss.gh"
regexp: "^{{ item.key }}="
line: "{{ item.key }}={{ item.value }}"
loop:
- { key: 'TRAEFIK_PORT', value: '{{ traefik_port }}' }
- { key: 'AGENTA_SERVICES_URL', value: 'http://localhost:{{ traefik_port }}/services' }
- { key: 'AGENTA_API_URL', value: 'http://localhost:{{ traefik_port }}/api' }
- { key: 'AGENTA_WEB_URL', value: 'http://localhost:{{ traefik_port }}' }
- name: Start Agenta with Docker Compose
command: >
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
args:
chdir: "{{ app_root }}"
Run the playbook:
ansible-playbook -i inventory.ini deploy-agenta.yml
Access Agenta at http://your-server-ip:{{ app_port }}
traefik_port variable to change the default port 80.git pull in the app directory, then restart containers.| Variable | Description | Default |
|---|---|---|
app_root |
Installation directory | /opt/agenta |
app_port |
HTTP port for Agenta | 80 |
traefik_port |
Traefik reverse proxy port | 80 |
agenta_repo_url |
Agenta GitHub repository URL | https://github.com/Agenta-AI/agenta |
Any questions?
Feel free to contact us. Find all contact information on our contact page.