Back to stack index

Tool

Docker

Default packaging in self-host docs.

Short answer

Docker packages an application and everything it needs into a container image that runs the same way on any Linux server, Mac or Windows PC. It is the standard way to self-host open-source AI tools: Dify, Langflow, Open WebUI, n8n, AnythingLLM and LibreChat all publish official images and Docker Compose files that start the app and its databases with one command. Docker Engine, the open-source runtime, is at version 29.9.2 and is free under the Apache 2.0 license. Docker Desktop, the app for Mac and Windows, reached 4.96.2 on October 22, 2026, a release that removed trust for certificates from a compromised eMudhra intermediate certificate authority. Docker Desktop is free for personal use, education, open-source projects and companies with fewer than 250 employees and under $10 million in annual revenue; larger companies need a paid plan, from $9 a month per user for Pro on annual billing.

Docker Engine
29.9.2, Apache 2.0
Docker docs
Docker Desktop
4.96.2, October 22, 2026
Docker Desktop release notes
Desktop free for
Under 250 employees and under $10M revenue
Docker subscription terms
Paid plans
Pro $9, Team $15, Business $24 per user/month (annual)
docker.com/pricing

Updated October 21, 2026How we evaluate tools

Official site

Directory projects (6)

  • Dify

    Visual builder for RAG apps and agents with deployable API endpoints.

  • Langflow

    Node editor for LangChain-style flows exportable as Python or API.

  • Open WebUI

    Full-featured web UI for Ollama and OpenAI-compatible backends.

  • n8n

    n8n accelerates app backends or internal tools with frameworks you can self-host.

  • AnythingLLM

    Document chat and workspaces with optional vector DB and multi-user mode.

  • LibreChat

    Multi-model chat UI with plugins, agents, and self-hosted deployment.

Docker for self-hosting open-source AI tools: Dify, Langflow, Open WebUI, n8n and more in 2026

Why AI tools ship as containers

A self-hosted AI platform is rarely one program. Dify's default setup runs an API server, a worker, a web front end, a sandbox for code execution, an SSRF proxy, Nginx, PostgreSQL, Redis and a vector database. Each needs a specific version and configuration. A Docker Compose file describes all of them, and docker compose up -d starts the whole stack on any machine with Docker. Upgrades become pulling new images and restarting, and the same setup runs on a laptop, a $20 virtual server or a Kubernetes cluster.

Which directory projects ship Docker setups

ProjectWhat the Compose setup includes
DifyAPI, worker, web, sandbox, PostgreSQL, Redis, Weaviate or another vector store, Nginx
LangflowLangflow app with optional PostgreSQL
Open WebUIOne container; image variants bundle Ollama or CUDA support
n8nn8n with optional PostgreSQL, plus worker containers for queue mode
AnythingLLMOne container with storage volume
LibreChatAPI, MongoDB, Meilisearch, RAG API, pgvector

Docker Engine and Desktop versions

Docker Engine is the daemon and command-line tool that run containers on Linux; it is the Moby open-source project under Apache 2.0, and version 29.9.2 is current. Docker Desktop bundles the engine in a lightweight virtual machine for Mac and Windows, with a graphical interface, Compose, Kubernetes, extensions and AI features. Desktop 4.96.2, on October 22, 2026, removed trust for certificates chained to a compromised eMudhra intermediate certificate authority. If you use Desktop, update it.

Docker Desktop pricing

PlanPrice per user per monthWho needs it
PersonalFreeIndividuals, education, non-commercial open source, businesses under 250 employees and $10M revenue
Pro$9 annual, $11 monthlyIndividual professionals wanting more build and Scout features
Team$15 annual, $16 monthlyTeams needing collaboration and access controls
Business$24Larger companies needing SSO, central management and compliance features

The licensing rule applies only to Docker Desktop. Docker Engine on a Linux server, which is what most self-hosted AI tools run on in production, has no fee at any company size.

GPUs in containers

PlatformHow to use the GPU
Linux with NVIDIAInstall the driver and NVIDIA Container Toolkit; use --gpus all
Linux with AMDUse ROCm images and pass /dev/kfd and /dev/dri devices
WindowsDocker Desktop with WSL 2 and a recent NVIDIA driver
macOSNo GPU in containers; run Ollama or Docker Model Runner natively

In Compose, request GPUs with a deploy.resources.reservations.devices entry specifying the nvidia driver and gpu capability. Check with docker run --rm --gpus all nvidia/cuda:12.9.0-base-ubuntu24.04 nvidia-smi before debugging an AI app.

Docker's AI features

Docker has added several AI-specific tools since 2025:

FeatureWhat it does
Docker Model RunnerPulls models from Docker Hub and Hugging Face and serves them with an OpenAI-compatible API
MCP Catalog and ToolkitRuns MCP servers in isolated containers and connects them to Claude, Cursor and other clients
Compose for agentsDeclares models and MCP servers in Compose files alongside app services
GordonAn AI assistant inside Docker Desktop and the CLI
SandboxesIsolated environments for running coding agents such as Claude Code safely

Running MCP servers in containers is a sensible security step, since each server then sees only the files and network access you grant it.

Compose tips for AI stacks

  • Pin image tags. Use version tags, not latest, so an unplanned update cannot break a working setup.
  • Use named volumes. Databases, vector stores and uploaded files must live on volumes, or they vanish when containers are recreated.
  • Keep secrets in an .env file with restricted permissions, never in the Compose file you commit.
  • Expose only the front door. Publish the web port through a reverse proxy; keep databases and Redis on the internal network with no published ports.
  • Set restart policies such as unless-stopped so services return after a reboot.
  • Set memory limits for workers that load models, so one runaway process cannot take down the host.

Upgrading safely

  1. Read the project's release notes for breaking changes and migrations.
  2. Back up volumes, especially PostgreSQL. A pg_dump from the database container is usually enough.
  3. Update the image tag, run docker compose pull, then docker compose up -d.
  4. Watch logs with docker compose logs -f until migrations finish.
  5. Remove old images with docker image prune to recover disk space.

AI images are large, often several gigabytes with CUDA libraries, so disk space runs out faster than with typical web apps.

Security

Containers isolate processes but are not a full security boundary by default. Do not run containers in privileged mode unless documented and necessary, avoid mounting the Docker socket into containers, which grants control of the host, and keep the host and Docker updated. Docker publishes ports through its own firewall rules, which can bypass UFW on Ubuntu, so a published database port may be reachable from the internet even if your firewall seems to block it; bind such ports to 127.0.0.1 or do not publish them.

Troubleshooting common AI container problems

SymptomLikely causeFix
App cannot reach Ollama on the hostlocalhost inside a container is the container itselfUse host.docker.internal, or the host's LAN IP on Linux with extra_hosts
Model runs very slowlyContainer is using the CPUCheck GPU access with nvidia-smi inside the container
Disk fullLarge images and build cachedocker system df, then prune unused images and cache
Database container restarts in a loopMajor version changed on existing dataRestore the old tag, then upgrade with a dump and restore

Alternatives to Docker Desktop

ToolPlatformsNotes
Podman DesktopMac, Windows, LinuxDaemonless, rootless by default, Compose support
OrbStackMacFast and light; free for personal use, paid for business
Rancher DesktopMac, Windows, LinuxFree and open source, from SUSE
ColimaMac, LinuxFree command-line runtime

All run the same images, so Compose files from AI projects work with any of them, sometimes with small changes for GPU access.

Related: Kubernetes stack, PostgreSQL stack, Redis stack, Ollama stack, MCP stack, Stack index.

Frequently asked questions

Do I need Docker to self-host AI tools?

Not strictly, but it is by far the easiest way. Most AI platforms combine a web app, an API, workers, PostgreSQL, Redis and a vector database, and their Compose files start all of these together with tested versions. Installing each piece by hand is possible but slower and more error-prone.

Is Docker free?

Docker Engine on Linux is free open source. Docker Desktop is free for individuals, education, non-commercial open-source projects and businesses under 250 employees and $10 million revenue. Larger businesses need Pro at $9, Team at $15 or Business at $24 per user per month on annual billing. Alternatives such as Podman, Rancher Desktop, OrbStack and Colima can replace Desktop.

How do I give a container access to my NVIDIA GPU?

On Linux, install the NVIDIA driver and the NVIDIA Container Toolkit, then run containers with --gpus all or a Compose deploy.resources.reservations.devices block. On Windows, Docker Desktop with WSL 2 supports NVIDIA GPUs. On Macs, containers cannot use the Apple GPU, so run Ollama natively and connect containers to it.

What is Docker Model Runner?

A Docker feature that pulls and runs language models as OCI artifacts from Docker Hub and other registries, with an OpenAI-compatible API. On Macs it runs models natively on Apple silicon outside a container to use the GPU. It is an alternative to Ollama for teams already using Docker tooling.

Why did Docker Desktop 4.96.2 change certificates?

It removed trust for certificates issued by an eMudhra intermediate certificate authority that was reported compromised in October 2026. Several vendors, including the Python project, made similar changes. Update Docker Desktop to pick up the change.

Sources

  1. Docker Desktop release notes
  2. Docker Engine release notes
  3. Docker pricing
  4. NVIDIA Container Toolkit