What is Docker?

Docker is a set of tools for building container images and running containers from them. Its simple commands and file format made containers an everyday developer tool.

What are the parts of Docker?

A daemon, a client and a file format, plus a registry protocol. The Docker Engine daemon manages images, containers, networks and volumes, and hands the actual running of containers to containerd and runc. The docker command-line client talks to the daemon over a Unix socket. The Dockerfile describes how to build an image. Registries store and distribute images. Docker Desktop bundles all of this for laptops; on a Linux server you install the engine from the distribution or Docker's own repository.

How is an image built?

From a Dockerfile, one instruction per layer. A multi-stage build compiles in a full toolchain image, then copies only the result into a small runtime image, which keeps production images lean and reduces what scanners find:

FROM golang:1.23 AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/ledger ./cmd/ledger

FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=build /out/ledger /usr/local/bin/ledger
USER nonroot
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/ledger"]

Order instructions so rarely changing steps come first; Docker reuses cached layers until the first changed instruction, which makes rebuilds fast.

Where does container data live?

In volumes or bind mounts, never only in the container. The writable layer disappears when a container is removed. Named volumes are managed by Docker under /var/lib/docker/volumes; bind mounts map a host directory you choose, which is convenient for backups. Put databases, uploads and anything else that must survive an upgrade into one of them, and include those paths in your backup set. Our Data backup article covers the backup side.

How does Docker networking work?

By default each container gets a private address on a bridge, with NAT for outbound traffic. Publishing a port with -p forwards a host port to the container. User-defined networks give containers DNS names for each other, so an application reaches its database as db. Note that Docker inserts its own firewall rules, which can bypass a host firewall such as ufw for published ports; publish only on 127.0.0.1 when a reverse proxy on the host fronts the service, or filter in the DOCKER-USER chain.

docker network create shopnet
docker run -d --name db --network shopnet -v pgdata:/var/lib/postgresql/data \
  -e POSTGRES_PASSWORD_FILE=/run/secrets/pg -v /srv/secrets/pg:/run/secrets/pg:ro postgres:17
docker run -d --name web --network shopnet -p 127.0.0.1:8081:8080 registry.example.net/shop:3.2

What is Docker Compose?

A YAML file that describes a multi-container application, its networks and volumes, started with one command. It is the simplest way to run a small stack on one server, and the file doubles as documentation:

services:
  web:
    image: registry.example.net/shop:3.2
    ports: ["127.0.0.1:8081:8080"]   # proxy on the host forwards here
    depends_on: [db]
    restart: unless-stopped
  db:
    image: postgres:17
    volumes: ["pgdata:/var/lib/postgresql/data"]   # named volume survives upgrades
    restart: unless-stopped
volumes:
  pgdata: {}

docker compose up -d starts it, docker compose pull && docker compose up -d updates it.

Docker or Podman?

Both run the same images. Podman needs no central daemon, runs rootless by default and integrates with systemd through Quadlet files, which many server administrators prefer. Docker has the larger ecosystem and the most familiar Compose workflow. On AlmaLinux, Rocky Linux and Fedora Server, Podman is the packaged default; on Debian and Ubuntu Server, Docker's repository is the usual route. Our Kubernetes and Docker article explains where Kubernetes fits.

How do I keep a Docker host healthy?

Prune, rotate and update. Old images and build cache fill disks; docker system df shows usage and docker image prune -a --filter until=168h removes unused images older than a week. Configure log rotation in daemon.json. Rebuild images regularly for base image security fixes and keep the engine itself updated with the operating system. Our Container management article covers these routines.

What does a Docker host need here?

Nothing beyond a Linux install. Docker runs on every distribution we offer, with full root access. A small stack runs on ESSENTIAL-1, which brings 6 and 32 GB DDR4 for $38.40 a month; busier hosts with many services suit ESSENTIAL-M or larger. Every server includes DDoS filtering in front of the published ports.

Machines for Docker hosts

ModelProcessorCoresMemoryDrivesPortPer month
ESSENTIAL-1Intel Xeon-E 2386G632 GB2x 512 GB SSD NVMe1 Gbps unmetered$38.40
ESSENTIAL-SAMD Ryzen 7 9700X864 GB2x 512 GB SSD NVMe1 Gbps unmetered$46.20
ESSENTIAL-MAMD Ryzen 9 9900X1264 GB2x 512 GB SSD NVMe1 Gbps unmetered$70.80
BUSINESS-2 2026AMD EPYC 4345P864 GB2x 960 GB SSD NVMe3 Gbps unmetered$141.60

Related pages

Kubernetes and Docker

Docker builds and runs containers; Kubernetes schedules them across machines. What each does, where Compose is enough, and running both on dedicated servers.

Read more

Container management

The everyday work of running containers: images and registries, updates, resource limits, logs, monitoring and security on your own servers.

Read more

Containerisation

Packaging an application with its libraries so it runs the same everywhere: namespaces, cgroups, images, runtimes and running containers on bare metal.

Read more

Kubernetes

The container platform explained through its parts: control plane, nodes, pods, deployments, services and ingress, plus what running it on bare metal involves.

Read more

Questions and answers

Is Docker free to use on a server?

Yes. Docker Engine on Linux is open source and free. Paid subscriptions apply to Docker Desktop in larger companies, not to the server engine.

Does Docker bypass my firewall?

It can. Published ports get their own rules that may skip ufw. Bind published ports to the loopback address and let a host proxy face the internet, or write filters in the DOCKER-USER chain.

Where should Docker store database data?

In a named volume or a bind mount to a host directory, both of which survive container removal and can be included in backups.

How does Docker Compose relate to Docker itself?

Docker runs individual containers; Compose describes a group of containers with their networks and volumes in one file and manages them together.

Will my images still work if I switch to Podman?

Yes. Podman runs the same images, needs no daemon, works rootless and is the default on AlmaLinux, Rocky Linux and Fedora.