| title | AnythingLLM Docker Deployment |
|---|---|
| emoji | π |
| colorFrom | blue |
| colorTo | purple |
| sdk | docker |
| app_port | 7860 |
| pinned | false |
| license | mit |
| suggested_hardware | cpu-basic |
| suggested_storage | small |
A comprehensive deployment solution for AnythingLLM supporting both Docker and Hugging Face Spaces environments. This repository provides production-ready configurations for the all-in-one AI application that handles RAG, AI Agents, and more with minimal configuration.
- Multi-stage Docker build optimized for production
- Hugging Face Spaces compatibility with proper user permissions
- Local development environment with docker-compose
- Environment-based configuration for different deployment scenarios
- Health checks and monitoring built-in
- Security best practices following Docker and HF Spaces guidelines
- Click the "Deploy to Spaces" button above
- Configure your Space settings (name, visibility, hardware)
- Set up required environment variables (see Configuration)
- Your AnythingLLM instance will be ready in minutes!
# Clone the repository
git clone https://github.com/your-username/anythingllm-deployment.git
cd anythingllm-deployment
# Copy environment template
cp .env.example .env
# Edit your environment variables
nano .env
# Start with docker-compose
docker-compose up -d
# Access your instance
open http://localhost:3001# Build the image
docker build -t anythingllm:latest .
# Run the container
docker run -d \
--name anythingllm \
-p 3001:7860 \
-v anythingllm_storage:/app/storage \
-v anythingllm_models:/app/models \
-e JWT_SECRET=your-secret-here \
anythingllm:latest| Variable | Description | Default | Required |
|---|---|---|---|
JWT_SECRET |
Secret key for JWT tokens | - | β |
SERVER_PORT |
Application port | 7860 |
- |
STORAGE_DIR |
Data storage directory | /app/storage |
- |
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment mode | production |
DISABLE_TELEMETRY |
Disable telemetry | true |
LOG_LEVEL |
Logging level | info |
LLM_PROVIDER |
LLM provider | native |
VECTOR_DB |
Vector database | lancedb |
EMBEDDING_ENGINE |
Embedding provider | native |
For Hugging Face Spaces deployment, set these as Secrets in your Space settings:
JWT_SECRET=your-super-secret-jwt-key-here
AUTH_TOKEN=optional-auth-token
DATABASE_CONNECTION_STRING=optional-external-db- Builder Stage: Installs dependencies and builds the application
- Production Stage: Creates optimized runtime image with security hardening
/app/
βββ storage/ # Application data and configurations
βββ vector-cache/ # Vector database cache
βββ models/ # Local LLM models
βββ documents/ # Document uploads
The included docker-compose.yml provides a complete development environment:
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f anythingllm
# Stop services
docker-compose downEnable optional services using profiles:
# Start with ChromaDB
docker-compose --profile chromadb up -d
# Start with Ollama for local LLMs
docker-compose --profile ollama up -d
# Start with both
docker-compose --profile chromadb --profile ollama up -dThis deployment follows security best practices:
- Non-root user: Runs as user ID 1000 (required for HF Spaces)
- Minimal base image: Alpine Linux for reduced attack surface
- Health checks: Built-in container health monitoring
- Secret management: Proper handling of sensitive configuration
- Resource limits: Configurable memory and CPU constraints
# Check if port is in use
lsof -i :3001
# Use different port
docker run -p 8080:7860 anythingllm:latest# Ensure proper ownership
RUN chown -R user:user /app
USER user# Increase memory limits in docker-compose.yml
deploy:
resources:
limits:
memory: 2G# View container logs
docker logs anythingllm
# Enter container for debugging
docker exec -it anythingllm bash
# Check health status
docker inspect --format='{{.State.Health.Status}}' anythingllm- AnythingLLM Official Documentation
- Docker Best Practices
- Hugging Face Spaces Documentation
- Docker Compose Reference
Contributions are welcome! Please read our Contributing Guidelines first.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- AnythingLLM Team for the amazing application
- Hugging Face for the Spaces platform
- Community contributors and early adopters
- π Report Issues
- π¬ Discussions
- π§ Email Support
Note: This is an unofficial deployment guide for AnythingLLM on Hugging Face Spaces. While the configurations follow best practices, please test thoroughly in your environment before production use.