SH SelfHostAlt
Sponsored Self-host any open-source app on Hostinger KVM VPS from $4.99/mo (1-Click Docker) →
LocalAI logo

LocalAI

MIT Docker Ready ★ 50,599 Stars Active · 2026-11-28

Run your AI models locally and generate images and audio (alternative to OpenAI and Claude). , Clients).

Category
Generative Artificial Intelligence (GenAI)
Tech Stack / Runtime
Docker/K8S · Go
Open-Source License
MIT
GitHub Health
★ 50,599 · 4,658 forks
#llama#ai#llm#stable-diffusion#api
Official docker-compose.yaml

Quick Docker Compose Reference for LocalAI

# LocalAI with Docker Compose.
#
#   curl -fsSL https://localai.io/install/docker-compose.yaml -o docker-compose.yaml
#   docker compose up -d
#
# Then open http://localhost:8080 and install a model from the gallery.
#
# Models, backends, settings and application data are kept in four named
# volumes, so they survive `docker compose down`, image upgrades and
# container recreation. `docker compose down -v` deletes them.
#
# Upgrade:  docker compose pull && docker compose up -d
#
# GPU: change the image tag and uncomment the block for your GPU below.
# Documentation: https://localai.io/docs/start/install/containers/
#
# This file is also served at https://localai.io/install/docker-compose.yaml.
# Keep the two copies identical (CI checks it). To build LocalAI from source,
# use docker-compose.dev.yaml in the repository.

services:
  localai:
    # CPU image. For a GPU, use one of these tags instead:
    #   localai/localai:latest-gpu-nvidia-cuda-12   NVIDIA, CUDA 12 drivers
    #   localai/localai:latest-gpu-nvidia-cuda-13   NVIDIA, CUDA 13 drivers
    #   localai/localai:latest-gpu-hipblas          AMD (ROCm)
    #   localai/localai:latest-gpu-intel            Intel (oneAPI/SYCL)
    #   localai/localai:latest-gpu-vulkan           any GPU with a Vulkan driver
    # Podman needs the registry in the name: docker.io/localai/localai:latest
    image: localai/localai:latest
    init: true
    restart: unless-stopped
    ports:
      - "8080:8080"
    # environment:
    #   # Require an API key on every request.
    #   LOCALAI_API_KEY: "change-me"
    #   # More log output: error, warn, info, debug or trace.
    #   LOCALAI_LOG_LEVEL: debug
    volumes:
      - models:/models
      - backends:/backends
      - data:/data
      - configuration:/configuration
      # Bind mounts instead of named volumes: create the folders first as your
      # own user (mkdir -p models backends data configuration), then replace
      # the four lines above with these. See "Container user and permissions"
      # in the documentation for who owns the files.
      # - ./models:/models
      # - ./backends:/backends
      # - ./data:/data
      # - ./configuration:/configuration

    # --- NVIDIA (latest-gpu-nvidia-cuda-12 or -cuda-13) ---
    # Needs the NVIDIA Container Toolkit on the host.
    # deploy:
    #   resources:
    #     reservations:
    #       devices:
    #         - driver: nvidia
    #           count: all
    #           capabilities: [gpu]

    # --- AMD (latest-gpu-hipblas) ---
    # devices:
    #   - /dev/kfd
    #   - /dev/dri

    # --- Intel (latest-gpu-intel) or Vulkan (latest-gpu-vulkan) ---
    # devices:
    #   - /dev/dri

    # The container starts as root, then runs LocalAI as uid 10001, or as the
    # owner of bind-mounted ./data and ./models, with the groups of the GPU
    # devices above. See "Container user and permissions" in the docs.

  ## PostgreSQL for the knowledge base (collections). Uncomment this service,
  ## the postgres_data volume below, and these lines in `environment`:
  ##   LOCALAI_COLLECTIONS_VECTOR_ENGINE: postgres
  ##   LOCALAI_COLLECTIONS_DATABASE_URL: postgresql://localrecall:localrecall@postgres:5432/localrecall?sslmode=disable
  # postgres:
  #   image: quay.io/mudler/localrecall:v0.5.2-postgresql
  #   restart: unless-stopped
  #   environment:
  #     POSTGRES_DB: localrecall
# ... (see full file in official GitHub repository)

LocalAI System Requirements & Self-Hosting Guide

Deploy LocalAI (4 GB+ RAM) →

Recommended VPS

4 GB+ RAM

2 – 4 vCPU · $6 – $12/mo VPS

Deployment Method

Intermediate

Docker / Docker Compose (Recommended)

Commercial Use (MIT)

Yes — free for personal, internal company, and commercial use with attribution.

Maintenance Status

Active

Last commit: 2026-11-28

Frequently Asked Questions about LocalAI

Is LocalAI free to self-host for commercial use?

LocalAI is released under the MIT license. Yes — free for personal, internal company, and commercial use with attribution. It has 50,599 GitHub stars and was last updated on 2026-11-28.

What VPS specifications do I need to self-host LocalAI?

Based on its Docker/K8S runtime and Generative Artificial Intelligence (GenAI) workload, we recommend at least 4 GB+ RAM and 2 – 4 vCPU (typically $6 – $12/mo VPS).

Does LocalAI support Docker deployment?

Yes — LocalAI supports Docker / Docker Compose (Recommended), making it intermediate to spin up on any Linux VPS.

More Open-Source Generative Artificial Intelligence (GenAI)

View all →
★ 188k Docker

Get up and running with Llama 3.3, DeepSeek-R1, Phi-4, Gemma 3, and other large language models. .

Replaces: ChatGPT
MIT Docker/Python
Details →
★ 160k Docker

User-friendly AI Interface, supports Ollama, OpenAI API. .

BSD-3-Clause Docker/Python
Details →
★ 68.7k Docker

All-in-one desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more. .

Replaces: ChatGPT
MIT Nodejs/Docker
Details →
★ 47.6k Docker

Enhanced ChatGPT-compatible AI chat interface supporting multiple AI providers, with multi-user auth, message search, and plugin support. , Source Code.

Replaces: ChatGPT
MIT Nodejs/Docker
Details →
★ 38.3k Docker

AI-powered search engine (alternative to Perplexity AI).

Replaces: Plex
MIT Docker
Details →
★ 38.3k Docker

Your AI second brain. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI. , Source Code.

AGPL-3.0 Python/Docker
Details →