Containers
LocalAI supports Docker, Podman, and other OCI-compatible container engines. This guide covers the common aspects of running LocalAI in containers.
Prerequisites
Before you begin, ensure you have a container engine installed:
- Install Docker (Mac, Windows, Linux)
- Install Podman (Linux, macOS, Windows WSL2)
Quick Start
The fastest way to get started is with the CPU image:
This will:
- Start LocalAI (you’ll need to install models separately)
- Make the API available at
http://localhost:8080
Image Types
LocalAI provides several image types to suit different needs. These images work with both Docker and Podman.
Standard Images
Standard images don’t include pre-configured models. Use these if you want to configure models manually.
CPU Image
GPU Images
NVIDIA CUDA 13:
NVIDIA CUDA 12:
AMD GPU (ROCm):
Intel GPU:
Vulkan:
NVIDIA Jetson (L4T ARM64):
CUDA 12 (for Nvidia AGX Orin and similar platforms):
CUDA 13 (for Nvidia DGX Spark):
Using Compose
For a more manageable setup, especially with persistent volumes, use Docker Compose or Podman Compose:
Using CDI (Container Device Interface) - Recommended for NVIDIA Container Toolkit 1.14+
The CDI approach is recommended for newer versions of the NVIDIA Container Toolkit (1.14 and later). It provides better compatibility and is the future-proof method:
Save this as compose.yaml and run:
Using Legacy NVIDIA Driver - For Older NVIDIA Container Toolkit
If you are using an older version of the NVIDIA Container Toolkit (before 1.14), or need backward compatibility, use the legacy approach:
Persistent Storage
The container exposes the following volumes:
| Volume | Description | CLI Flag | Environment Variable |
|---|---|---|---|
/models | Model files used for inferencing | --models-path | $LOCALAI_MODELS_PATH |
/backends | Custom backends for inferencing | --backends-path | $LOCALAI_BACKENDS_PATH |
/configuration | Dynamic config files (api_keys.json, external_backends.json, runtime_settings.json) | --localai-config-dir | $LOCALAI_CONFIG_DIR |
/data | Persistent data (collections, agent state, tasks, jobs) | --data-path | $LOCALAI_DATA_PATH |
To persist models and data, mount volumes:
Or use named volumes:
Next Steps
After installation:
- Access the WebUI at
http://localhost:8080 - Check available models:
curl http://localhost:8080/v1/models - Install additional models
- Try out examples
Troubleshooting
Container won’t start
- Check container engine is running:
docker psorpodman ps - Check port 8080 is available:
netstat -an | grep 8080(Linux/Mac) - View logs:
docker logs local-aiorpodman logs local-ai
GPU not detected
- Ensure Docker has GPU access:
docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi - For Podman, pass the GPU with the
--deviceflags shown in the GPU sections above (for example--device nvidia.com/gpu=all) - For NVIDIA: Install NVIDIA Container Toolkit
- For AMD: Ensure devices are accessible:
ls -la /dev/kfd /dev/dri
NVIDIA Container fails to start with “Auto-detected mode as ’legacy’” error
If you encounter this error:
This indicates a Docker/NVIDIA Container Toolkit configuration issue. The container runtime’s prestart hook fails before LocalAI starts. This is not a LocalAI code bug.
Solutions:
Use CDI mode (recommended): Update your docker-compose.yaml to use the CDI driver configuration:
Upgrade NVIDIA Container Toolkit: Ensure you have version 1.14 or later, which has better CDI support.
Check NVIDIA Container Toolkit configuration: Run
nvidia-container-cli --query-gputo verify your installation is working correctly outside of containers.Verify Docker GPU access: Test with
docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu22.04 nvidia-smi
Models not downloading
- Check internet connection
- Verify disk space:
df -h - Check container logs for errors:
docker logs local-aiorpodman logs local-ai
Full image reference
The quick-start examples above use the Docker Hub image names. Every image is published to both Docker Hub and Quay. The tables below map the Docker Hub tag to its Quay equivalent for each variant. Replace v4.7.1 with a released version to pin a specific build.
| Description | Quay | Docker Hub |
|---|---|---|
| Latest images from the branch (development) | quay.io/go-skynet/local-ai:master | localai/localai:master |
| Latest tag | quay.io/go-skynet/local-ai:latest | localai/localai:latest |
| Versioned image | quay.io/go-skynet/local-ai:v4.7.1 | localai/localai:v4.7.1 |
| Description | Quay | Docker Hub |
|---|---|---|
| Latest images from the branch (development) | quay.io/go-skynet/local-ai:master-gpu-nvidia-cuda-12 | localai/localai:master-gpu-nvidia-cuda-12 |
| Latest tag | quay.io/go-skynet/local-ai:latest-gpu-nvidia-cuda-12 | localai/localai:latest-gpu-nvidia-cuda-12 |
| Versioned image | quay.io/go-skynet/local-ai:v4.7.1-gpu-nvidia-cuda-12 | localai/localai:v4.7.1-gpu-nvidia-cuda-12 |
| Description | Quay | Docker Hub |
|---|---|---|
| Latest images from the branch (development) | quay.io/go-skynet/local-ai:master-gpu-nvidia-cuda-13 | localai/localai:master-gpu-nvidia-cuda-13 |
| Latest tag | quay.io/go-skynet/local-ai:latest-gpu-nvidia-cuda-13 | localai/localai:latest-gpu-nvidia-cuda-13 |
| Versioned image | quay.io/go-skynet/local-ai:v4.7.1-gpu-nvidia-cuda-13 | localai/localai:v4.7.1-gpu-nvidia-cuda-13 |
| Description | Quay | Docker Hub |
|---|---|---|
| Latest images from the branch (development) | quay.io/go-skynet/local-ai:master-gpu-intel | localai/localai:master-gpu-intel |
| Latest tag | quay.io/go-skynet/local-ai:latest-gpu-intel | localai/localai:latest-gpu-intel |
| Versioned image | quay.io/go-skynet/local-ai:v4.7.1-gpu-intel | localai/localai:v4.7.1-gpu-intel |
| Description | Quay | Docker Hub |
|---|---|---|
| Latest images from the branch (development) | quay.io/go-skynet/local-ai:master-gpu-hipblas | localai/localai:master-gpu-hipblas |
| Latest tag | quay.io/go-skynet/local-ai:latest-gpu-hipblas | localai/localai:latest-gpu-hipblas |
| Versioned image | quay.io/go-skynet/local-ai:v4.7.1-gpu-hipblas | localai/localai:v4.7.1-gpu-hipblas |
| Description | Quay | Docker Hub |
|---|---|---|
| Latest images from the branch (development) | quay.io/go-skynet/local-ai:master-gpu-vulkan | localai/localai:master-gpu-vulkan |
| Latest tag | quay.io/go-skynet/local-ai:latest-gpu-vulkan | localai/localai:latest-gpu-vulkan |
| Versioned image | quay.io/go-skynet/local-ai:v4.7.1-gpu-vulkan | localai/localai:v4.7.1-gpu-vulkan |
These images are compatible with Nvidia ARM64 devices with CUDA 12, such as the Jetson Nano, Jetson Xavier NX, and Jetson AGX Orin. For more information, see the Nvidia L4T guide.
| Description | Quay | Docker Hub |
|---|---|---|
| Latest images from the branch (development) | quay.io/go-skynet/local-ai:master-nvidia-l4t-arm64 | localai/localai:master-nvidia-l4t-arm64 |
| Latest tag | quay.io/go-skynet/local-ai:latest-nvidia-l4t-arm64 | localai/localai:latest-nvidia-l4t-arm64 |
| Versioned image | quay.io/go-skynet/local-ai:v4.7.1-nvidia-l4t-arm64 | localai/localai:v4.7.1-nvidia-l4t-arm64 |
These images are compatible with Nvidia ARM64 devices with CUDA 13, such as the Nvidia DGX Spark. For more information, see the Nvidia L4T guide.
| Description | Quay | Docker Hub |
|---|---|---|
| Latest images from the branch (development) | quay.io/go-skynet/local-ai:master-nvidia-l4t-arm64-cuda-13 | localai/localai:master-nvidia-l4t-arm64-cuda-13 |
| Latest tag | quay.io/go-skynet/local-ai:latest-nvidia-l4t-arm64-cuda-13 | localai/localai:latest-nvidia-l4t-arm64-cuda-13 |
| Versioned image | quay.io/go-skynet/local-ai:v4.7.1-nvidia-l4t-arm64-cuda-13 | localai/localai:v4.7.1-nvidia-l4t-arm64-cuda-13 |
See Also
- Full image reference - Complete Quay and Docker Hub image matrix
- Install Models - Install and configure models
- GPU Acceleration - GPU setup and optimization
- Kubernetes Installation - Deploy on Kubernetes