Self-Hosted Docker Compose
Clone the Future AGI repo and run the self-hosted stack locally with Docker Compose.
Clone the repo, run ./bin/install, sign in, and send your first trace to a self-hosted Future AGI instance running entirely on your machine.
| Time | Difficulty | Package |
|---|---|---|
| 15 min, plus the first boot | Beginner | fi-instrumentation-otel + traceai-openai |
- Docker Engine 24.0+ and Docker Compose v2.24+ (
docker --version,docker compose version) - 2 vCPUs and 4 GB of memory given to Docker, and 10 GB of free disk
- Linux, macOS, or Windows with WSL 2 (on Windows, run
.\bin\install.ps1from PowerShell wherever this page says./bin/install; if PowerShell refuses to run scripts, see Installation) - Python 3.11
- An OpenAI API key for the instrumented example
Install
pip install fi-instrumentation-otel traceai-openai openai
export FI_API_KEY="your-fi-api-key"
export FI_SECRET_KEY="your-fi-secret-key"
export FI_BASE_URL="http://localhost:4318"
export OPENAI_API_KEY="sk-..."
FI_BASE_URL is your install’s trace collector, which listens on this machine only. In PowerShell, set each variable with $env: instead, for example $env:FI_BASE_URL = "http://localhost:4318".
Tutorial
Clone the repo
git clone https://github.com/future-agi/future-agi.git
cd future-agiThis tutorial installs the default Standalone setup. It pulls published images, futureagi/standalone plus Postgres and ClickHouse, about 800 MB in all; there’s no source build.
You should see a future-agi/ directory with docker-compose.yml and .env.example at the root.
Run the installer
./bin/installThe installer checks the Docker VM’s memory and the host ports, writes .env with this install’s generated secrets, pulls the images, starts the stack and waits until it answers. Before it starts, it asks for your first account: an email, a name and a password of at least 8 characters that is not all digits and not a common password. Press Enter at the email prompt to skip and sign up in the UI later.
Just before the account prompt, the installer shows what deployment telemetry sends: once the first account exists, the install registers with api.futureagi.com, including the email addresses of owner, admin, staff and superuser accounts, then sends usage counts every 6 hours. To opt out, run ./bin/install --no-telemetry instead: only a minimal registration without email addresses is then sent.
The first boot sets up the databases and takes a few minutes; on a slow host, its migrations alone can take over half an hour. Meanwhile http://localhost:3000 shows a Future AGI is starting page with the current phase. To follow along:
docker compose logs -f appThe log ends with Future AGI is ready in .... When the installer finishes, it prints the endpoints:
| Service | URL | Notes |
|---|---|---|
| UI | http://localhost:3000 | Sign in here |
| API | http://localhost:8000 | Health check at /health/ |
| Traces (OTLP/HTTP) | http://localhost:4318 | This machine only; your FI_BASE_URL |
| LLM gateway | http://localhost:8090 | OpenAI-compatible |
You should see three containers, app, postgres and clickhouse, in docker compose ps.
See Installation for every installer flag.
Add a provider key (optional)
Tracing needs no provider key: the example below calls OpenAI directly with the key you exported. To use the LLM gateway, the playground or LLM-based evals in the app, add a key to .env:
OPENAI_API_KEY=sk-...Then apply it:
docker compose up -dEmail is optional too. Without it, messages are written to the app log instead of being sent. To send invites and password resets by email, add Mailgun credentials (MAILGUN_API_KEY, MAILGUN_SENDER_DOMAIN) the same way.
See Environment variables for every setting.
Open the dashboard and copy your keys
Open http://localhost:3000. A fresh install first shows the first-run setup screen, which checks your services. Then sign in with the account the installer created, or sign up if you skipped that prompt.
Open Keys in the sidebar (http://localhost:3000/dashboard/keys) and copy the API key and the secret key.
You should see an API key and a secret key. Update the FI_API_KEY and FI_SECRET_KEY values you exported in Install with them.
Tip
Forgot the password? Without email, reset it from the host. It asks for the new password:
docker compose exec app python manage.py reset_password --email you@example.com Send your first trace to the local stack
Point the instrumentation SDK at your local collector with FI_BASE_URL. Everything else is identical to the cloud setup.
import os
from fi_instrumentation import register, FITracer
from fi_instrumentation.fi_types import ProjectType
from traceai_openai import OpenAIInstrumentor
from openai import OpenAI
client = OpenAI()
# FI_BASE_URL (exported in Install) points the exporter at the local
# trace collector instead of the Future AGI cloud endpoint.
trace_provider = register(
project_type=ProjectType.OBSERVE,
project_name="local-stack-smoke-test",
)
OpenAIInstrumentor().instrument(tracer_provider=trace_provider)
tracer = FITracer(trace_provider.get_tracer("local-stack-smoke-test"))
@tracer.agent(name="smoke_test_agent")
def smoke_test_agent(question: str) -> str:
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": question}],
)
return response.choices[0].message.content
print(smoke_test_agent("What's our policy on refunds after 30 days?"))
trace_provider.force_flush()Open Tracing in the sidebar and select local-stack-smoke-test. You should see one parent span (smoke_test_agent) with the OpenAI call nested underneath. If the trace shows up, the collector, ClickHouse and the UI are wired correctly.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| The installer says Docker has too little memory | The Docker VM is smaller than Standalone needs: 3 GB minimum, 4 GB recommended | Resize the VM with the command the message prints for your runtime (for example Docker Desktop → Settings → Resources), then run ./bin/install again. --force continues anyway, at the risk of containers being killed for lack of memory |
The installer stops with Stack did not become fully ready | The first boot took longer than the installer waits for it, so the account you entered was not created | The stack keeps starting. Follow it with docker compose logs -f app until it prints Future AGI is ready in ..., then run ./bin/install again to create the account, or create it with docker compose exec app python manage.py create_user. To give a slow host more time, set INSTALL_READY_MAX_SECONDS in .env (default 3600, at most 7200) |
| The UI stays on Future AGI is starting | The first boot is still running, or a startup step keeps failing | Run docker compose logs -f app: a failed step prints its error and retries every 30 seconds. On a slow host the first migrations can take over half an hour |
Traces never appear after force_flush() | FI_BASE_URL wasn’t http://localhost:4318 when register() ran, or the script runs on another machine | Set export FI_BASE_URL="http://localhost:4318" before running the script. The collector listens on this machine only, so run the script on the host that runs the stack |
| No invite or password-reset email arrives | No Mailgun credentials in .env; messages go to the app log instead | Add MAILGUN_API_KEY and MAILGUN_SENDER_DOMAIN to .env and run docker compose up -d, or reset the password from the host with reset_password (Step 4) |
Continue to Installation for Distributed, installer flags, and everyday operations.
Questions & Discussion