Docker on Btrfs Playground
Hands-on Docker on Btrfs: experiment with native snapshots, compression, and checksums; inspect setup, grow the filesystem live, and back up/restore images and containers.

Motivation
This playground demonstrates Docker using the Btrfs storage driver.
Use it to experiment with running Docker on Btrfs (instead of the default overlay2):
- Inspect the setup (
lsblk,docker info,btrfs filesystem show, etc.) - Practice online growth of the Btrfs filesystem (add a device, then rebalance)
- Set up Btrfs usage monitoring (e.g.,
btrfs filesystem usage) - Back up and restore images/containers with snapshots and
btrfs send/receive. - etc.
Under the hood
The playground's single VM is an Ubuntu Server with Docker Engine preinstalled. It has four drives:
- The root filesystem (ext4) resides on
/dev/vda. /dev/vdband/dev/vdcform a multi-device Btrfs filesystem.- That Btrfs filesystem is mounted at
/var/lib/docker(Docker's data-root). - The fourth drive (
/dev/vdd) is unused and available to grow the Btrfs filesystem.
lsblk
NAME
MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
vda 254:0 0 10G 0 disk /
vdb 254:16 0 15G 0 disk /var/lib/docker/btrfs
/var/lib/docker
vdc 254:32 0 15G 0 disk
vdd 254:48 0 10G 0 disk
Initial Btrfs filesystem configuration:
sudo btrfs filesystem show
Label: none uuid: 1739f1bd-af61-43a5-b9ad-65921c9a50a4
Total devices 2 FS bytes used 144.00KiB
devid 1 size 15.00GiB used 272.00MiB path /dev/vdb
devid 2 size 15.00GiB used 264.00MiB path /dev/vdc
The Docker daemon is already configured to use Btrfs:
cat /etc/docker/daemon.json
{
"storage-driver": "btrfs",
...other options
}
To grow the filesystem without restarting the Docker daemon (and any running containers):
sudo btrfs device add /dev/vdd /var/lib/docker
sudo btrfs filesystem balance start /var/lib/docker
sudo btrfs filesystem show
A real VM, not a container
Get root on a VM with its own kernel, so Docker, Kubernetes, and systemd just work.
Read the docs →
SSH from browser or CLI
Use the built-in web terminal, or connect with labctl ssh, plain ssh, scp, or rsync.
Read the docs →
Drive it with AI
Let Claude, Codex, or any MCP client start this playground and run commands in it.
Read the docs →
Expose HTTP(S) ports
Give any web app running inside the VM a public URL - for yourself or to share with others.
Read the docs →
Share terminals
Invite others into your terminal session, or open it yourself from another device.
Read the docs →
Customize with init scripts
Add shell scripts that run at boot to install packages, clone repos, or seed test data.
Read the docs →
Private networking
VMs reach the internet via NAT with no public IP; several VMs share bridge networks.
Read the docs →
Ephemeral or persistent
By default, VMs are destroyed when the session ends; enable persistence to keep the disks for next time.
Read the docs →
Built-in container registry
A private registry.iximiuz.com for every playground to share images across services and VMs.
Read the docs →