Docker Compose is a tool for defining and running applications made of several containers, using one YAML file and a single command.
How Docker Compose works
Many applications need more than one process: a web server, a database, a cache, a background worker. Docker Compose describes them together in a file, usually compose.yaml, with each service's image, environment variables, ports, volumes, and dependencies.
Then:
docker compose up -dstarts everything in the background.docker compose logs -ffollows output.docker compose pullthenup -dupgrades.docker compose downstops it.
Compose v2 ships as a plugin to the Docker CLI, which is why the command is docker compose with a space.
An example
services:
app:
image: example/app:latest
ports: ["3000:3000"]
depends_on: [db]
db:
image: postgres:16
volumes: ["db:/var/lib/postgresql/data"]
volumes:
db:That file runs an app and its database with a persistent volume.
Why it matters for AI-agent publishing
Self-hosting is only practical if setup is short and upgrades are routine. Compose gives a repeatable setup on any machine with Docker, from a laptop to a small cloud VM.
SocialHandoff supports Docker Compose for self-hosting, alongside an all-in-one image and a ./run.sh script for local use. Set encryption and other settings through environment variables with the SOCIALHANDOFF_ prefix. The self-hosting guide walks through it, and getting started covers first sign-in.