English | 简体中文 | 繁體中文 | Русский
This guide helps diagnose Self-Hosted AI Stack issues before changing configuration or opening an issue.
Start with these checks:
Run docker compose commands from the directory where you started the stack. From a stack directory, run the health check as ../../stack-check.sh; from the repository root, run ./stack-check.sh.
# Show container state and published ports
docker compose ps
# Run the stack health check
# From a stack directory:
../../stack-check.sh
# Or from the repository root:
# ./stack-check.sh
# Check recent logs for one service
docker compose logs --tail=100 <service>If you started the stack with multiple compose files, use the same files for diagnostic commands:
docker compose -f docker-compose.yml -f docker-compose.proxy.yml ps
docker compose -f docker-compose.cuda.yml -f docker-compose.proxy.yml logs --tail=100 litellmFor Podman, stack-check.sh auto-detects the engine. You can also force it:
CONTAINER_ENGINE=podman ./stack-check.shOn first start, services may take a few minutes to initialize. Model downloads, database startup, and AnythingLLM initialization can all delay readiness.
If ./stack-check.sh fails immediately after startup:
- Wait a few minutes.
- Run
./stack-check.shagain. - Check the logs for the failing service.
Useful service log commands:
docker compose logs --tail=100 ollama
docker compose logs --tail=100 litellm
docker compose logs --tail=100 mcp
docker compose logs --tail=100 anythingllmGatewayCrate depends on InferCrate, UplinkCrate, and PostgreSQL. AnythingLLM depends on GatewayCrate. If a dependency is still starting, downstream services may not be ready yet.
The stack starts InferCrate (powered by Ollama) automatically, but you must pull at least one model before sending LLM requests:
docker exec ollama ollama_manage --pull llama3.2:3bList downloaded models:
docker exec ollama ollama_manage --listmodelsIf GatewayCrate or AnythingLLM reports model errors, first confirm that the model exists in InferCrate and that ./stack-check.sh reports a successful GatewayCrate routing test.
For image-specific issues, use the InferCrate repository. For upstream Ollama behavior unrelated to this Docker image, use the upstream Ollama issue tracker.
GatewayCrate (powered by LiteLLM) is exposed on port 4000 by default. The Admin UI is available at:
http://<server-ip>:4000/ui
Use username admin and the GatewayCrate master key as the password.
Show the GatewayCrate master key:
docker exec litellm litellm_manage --showkeyCheck the GatewayCrate health endpoint:
curl http://localhost:4000/health/livelinessIf local models do not work through GatewayCrate:
- Confirm a model is downloaded in InferCrate.
- Confirm
LITELLM_OLLAMA_BASE_URL=http://ollama:11434is present in the compose file or env file. - Check
docker compose logs --tail=100 litellm. - Run
./stack-check.shand review the GatewayCrate routing check.
The compose files automatically share InferCrate and UplinkCrate API keys with GatewayCrate through Docker volumes. Avoid deleting ollama-data, mcp-data, or litellm-data unless you have a backup.
UplinkCrate runs inside the Docker network on port 3000. Its port is not exposed to the host by default in the main compose file.
Show the UplinkCrate API key:
docker exec mcp mcp_manage --showkeyCheck its health endpoint from inside the container:
docker exec mcp curl -sf http://127.0.0.1:3000/healthIf an external MCP client needs direct access, uncomment the 3000:3000 port mapping in docker-compose.yml, then restart the service. For internet-facing access, put it behind HTTPS and keep the API key secret.
AnythingLLM is exposed on port 3001 by default:
http://<server-ip>:3001
On first start, a random admin password is generated and saved in the anythingllm-data volume. Retrieve it with:
docker exec anythingllm cat /app/server/storage/.initial_admin_passwordOr check the first-start logs:
docker compose logs anythingllm | grep -A4 "FIRST RUN"If AnythingLLM cannot talk to the local model:
- Confirm GatewayCrate is reachable at
http://litellm:4000/v1from inside the Docker network. - Confirm the model
ollama/llama3.2:3bexists, or update AnythingLLM to use a model that exists. - Check
docker compose logs --tail=100 anythingllm.
If you changed the AnythingLLM password in Settings, .initial_admin_password may no longer match the current password. Back up anythingllm-data before upgrades or migrations.
In the full compose file, EmbedCrate and ScribeCrate are enabled by default. SpeakCrate, ParseCrate, and ScribeCrate Live are commented out to reduce memory usage.
To enable a commented service:
- Uncomment the service in
docker-compose.ymlordocker-compose.cuda.yml. - Uncomment its named volume at the bottom of the file.
- Add or mount the service env file if you need custom settings.
- Run
docker compose up -d.
Service-specific docs:
| Service | Repository |
|---|---|
| InferCrate | https://github.com/hwdsl2/infercrate |
| GatewayCrate | https://github.com/hwdsl2/gatewaycrate |
| EmbedCrate | https://github.com/hwdsl2/embedcrate |
| ScribeCrate | https://github.com/hwdsl2/scribecrate |
| ScribeCrate Live | https://github.com/hwdsl2/scribecrate-live |
| SpeakCrate | https://github.com/hwdsl2/speakcrate |
| UplinkCrate | https://github.com/hwdsl2/uplinkcrate |
| ParseCrate | https://github.com/hwdsl2/parsecrate |
For NVIDIA GPU acceleration, start the CUDA compose file:
docker compose -f docker-compose.cuda.yml up -dRequirements:
- NVIDIA GPU
- NVIDIA driver
- NVIDIA Container Toolkit
linux/amd64host for CUDA images
If GPU acceleration is not used:
- Confirm you started
docker-compose.cuda.yml, notdocker-compose.yml. - Check
docker compose logs --tail=100 ollamaand, if enabled,docker compose logs --tail=100 whisper. - Confirm the host can run GPU containers with the NVIDIA Container Toolkit.
For Podman, the Compose deploy.resources GPU block is not used. Follow the README's Podman CDI instructions.
The stack includes a Caddy overlay for HTTPS:
DOMAIN=chat.example.com [email protected] \
docker compose -f docker-compose.yml -f docker-compose.proxy.yml up -dIn proxy mode, Caddy is the public listener on ports 80 and 443. AnythingLLM and GatewayCrate direct ports are rebound to 127.0.0.1.
Check Caddy logs:
docker logs ai-stack-caddyIf Caddy cannot get a certificate, check:
- DNS
A/AAAArecord points to this server. - Ports
80/tcpand443/tcpare reachable from the internet. - No other service is using ports
80or443. - The
DOMAINandACME_EMAILvalues are correct.
When exposing optional services publicly, use the generated API keys where present. For existing no-key deployments, set API keys via the relevant env files or put the services behind proxy authentication before publishing them.
API keys, model caches, chat history, service config, and Caddy certificate state are stored in Docker volumes. Back up before upgrades, migrations, or destructive cleanup.
See the full backup guide:
Avoid deleting volumes while troubleshooting unless you have a current backup. Deleting volumes can remove API keys, model caches, AnythingLLM data, GatewayCrate configuration, UplinkCrate settings, optional service keys, and Caddy certificates.
After updating images, run:
docker compose pull
docker compose up -d
./stack-check.shFile an issue in self-hosted-ai-stack for:
- Compose file problems
- Cross-service wiring issues
- Stack startup or health-check problems
- Caddy overlay issues in this repository
- Documentation issues in this repository
File an issue in an individual service repository for:
- Image-specific behavior
- Service-specific env options
- Service-specific API behavior
- Service-specific model download or cache behavior
File upstream if the issue is in the upstream application itself rather than the Docker image or stack wiring.
Please include:
- Host OS and architecture
- Docker or Podman version
- Compose files used, for example
docker-compose.ymlordocker-compose.cuda.yml - CPU or GPU mode
- Output of
docker compose ps - Output of
./stack-check.sh - Relevant logs, for example
docker compose logs --tail=100 litellm - Any custom env files or compose changes, with secrets redacted
Redact API keys, passwords, provider keys, tokens, public URLs with private paths, and any sensitive log content before posting.