Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

Repository files navigation

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

AnythingLLM Docker & Hugging Face Spaces Deployment

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.

🌟 Features

  • 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

πŸš€ Quick Start

Deploy to Hugging Face Spaces

Deploy to Spaces

  1. Click the "Deploy to Spaces" button above
  2. Configure your Space settings (name, visibility, hardware)
  3. Set up required environment variables (see Configuration)
  4. Your AnythingLLM instance will be ready in minutes!

Local Docker Deployment

# 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

Manual Docker Build

# 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

βš™οΈ Configuration

Required Environment Variables

Variable Description Default Required
JWT_SECRET Secret key for JWT tokens - βœ…
SERVER_PORT Application port 7860 -
STORAGE_DIR Data storage directory /app/storage -

Optional Configuration

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

Hugging Face Spaces Secrets

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

πŸ—οΈ Architecture

Multi-stage Docker Build

  1. Builder Stage: Installs dependencies and builds the application
  2. Production Stage: Creates optimized runtime image with security hardening

Directory Structure

/app/
β”œβ”€β”€ storage/          # Application data and configurations
β”œβ”€β”€ vector-cache/     # Vector database cache
β”œβ”€β”€ models/           # Local LLM models
└── documents/        # Document uploads

πŸ”§ Development

With Docker Compose

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 down

Optional Services

Enable 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 -d

πŸ” Security

This 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

🚨 Troubleshooting

Common Issues

Port Conflicts

# Check if port is in use
lsof -i :3001

# Use different port
docker run -p 8080:7860 anythingllm:latest

Permission Issues (HF Spaces)

# Ensure proper ownership
RUN chown -R user:user /app
USER user

Memory Issues

# Increase memory limits in docker-compose.yml
deploy:
  resources:
    limits:
      memory: 2G

Logs and Debugging

# 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

πŸ“š Documentation

🀝 Contributing

Contributions are welcome! Please read our Contributing Guidelines first.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž 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.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages