shop.example.comVisitorDeveloper's laptopDockerfileFROM node:20-alpineWORKDIR /appCOPY package*.json .RUN npm ciCOPY . .CMD ["node","server.js"]image shop:1.1node:20-alpineWORKDIR /apppackage.jsonnode_modulesapp codeYour server (host)Docker EngineLinux kernel (shared)Hardware · 4 CPURAM 0.8 / 8 GBno volumeshopshop:1.1appruntimelibrariesshopnode 16sharp: ✗✓ works✗ does not start
← Back to blog
How it worksInteractive

How Docker Works: Containers Explained with Animations

What Docker is, how containers differ from virtual machines, and what images, layers, ports and volumes actually do. Explained with interactive visuals.

Scroll: the diagram opens up step by step. Tap any part of it to explore.

Your developer says the new site "runs in Docker", the hosting invoice mentions "containers", and the one time something broke the fix was "just restart the container". If you nodded along without knowing what any of that means, this article is for you. No command line required: every mechanism is shown on a living diagram you can try out yourself.

01 / 08

The short answer

Docker packs an application together with everything it needs to run (its runtime, libraries, config files) into a single sealed box called a container. That box behaves identically on a developer's laptop, on a €5 VPS and on a cloud server. The box is built from a blueprint called an image, and the image is described by a short text file called a Dockerfile.

That is the whole idea. Everything else, from the way containers share memory to the reason your database survives an update, follows from it.

02 / 08

Containers vs virtual machines

Before Docker, the standard way to isolate applications was a virtual machine: a complete simulated computer with its own operating system, running on top of your real one. It works, but each VM boots a full OS, so three apps means three operating systems eating RAM.

A container skips that. It reuses the operating system kernel of the server it runs on and isolates only the application. The result is that a container starts in under a second and costs tens of megabytes instead of hundreds.

For a small business this is the practical difference: a single €20 server comfortably runs a website, a database, an n8n automation instance and an analytics tool as four containers. Doing the same with four virtual machines would need a server three times the size.

03 / 08

Images and layers

An image is the frozen blueprint of a container. It is built from a Dockerfile, a plain text recipe of five to fifteen lines: start from this base system, copy these files, install these dependencies, run this command.

Each line in the recipe produces a layer: a read-only slice of the file system stacked on the previous one. Layers are the reason Docker builds are fast. If only your application code changed, Docker rebuilds only the top layer and reuses everything below it from cache.

Two consequences matter for you as a customer:

  • Reproducibility. The same image produces the same container every time. "It worked on my machine" stops being an excuse, because the machine ships with the code.
  • Cheap copies. Running a second or tenth container from one image adds only a thin writable layer. This is how one server handles traffic spikes by starting extra copies for a few hours.
04 / 08

Ports: how a request reaches the app

A container is isolated by default; nothing outside can talk to it. To expose a web application you map a port on the server to a port inside the container, say 8080 on the outside to 80 inside. The browser talks to the server's port, Docker forwards the traffic, and the app inside never knows the difference.

That isolation is also why two containers can both use port 80 internally without conflict: each one gets its own network namespace, and only the outside mapping has to be unique.

05 / 08

Volumes: where the data lives

Here is the part that catches most newcomers. Everything a container writes goes into its own writable layer, and that layer is deleted together with the container. Update the image, recreate the container, and the orders your shop saved yesterday are gone.

The fix is a volume: a folder on the server's disk that is mounted into the container. The database writes into the volume, the container can be destroyed and rebuilt a hundred times, and the data stays put.

Try it yourself on the diagram: delete the container with the volume switched off, then with it on. The difference is exactly the difference between a hosting setup you can trust and one that loses data on the first update.

06 / 08

What this means in practice

At qikdev we run client infrastructure the same way: every service is a container, every container comes from an image we built, and every piece of state sits in a volume with a backup schedule. When we need to update n8n or the site, we pull a new image and restart. Downtime is measured in seconds.

The same approach powers the open-source stack we covered in Affordable Small Business Tools 2026: Plane, Twenty, n8n and the rest are all distributed as Docker images, which is why they install in an afternoon instead of a week.

07 / 08

When you do not need Docker

Honest part. If your business runs on a WordPress site at a managed host and nothing else, Docker adds a layer you do not need. Managed platforms (Vercel, Netlify, most WordPress hosts) handle isolation for you.

Docker starts paying off when you run two or more self-hosted services, need the same setup in development and production, or want to move between providers without rebuilding everything. Below that threshold, keep it simple.

08 / 08

Verdict

Docker is not magic and not only for large companies. It is a packaging format: one box per application, built from a recipe, with data kept outside the box. Understanding those three ideas is enough to read your hosting invoice, ask your developer the right questions and know why "restart the container" fixes so much.

Want to know whether your current setup should be containerised, or whether you are paying for virtual machines you do not need? Bring your hosting details to a free 30-minute audit and we will walk through it together. Book a slot.