Skip to content

How I Organise My Docker Folders

One of the first challenges I encountered when building a homelab was deciding where to store Docker applications.

Many installation guides simply tell you to create a folder somewhere and run Docker Compose, but after deploying multiple applications this can quickly become difficult to manage.

This page explains how I currently organise Docker applications across my servers.


My Main Rule

All Docker applications live under:

/opt/docker

Every application gets its own folder.

Example:

/opt/docker
├── caddy
├── homeassistant
├── homebox
├── immich
├── jellyfin
├── joplin
├── paperless
├── vaultwarden
└── docker-backups

This gives me a single location for:

  • Docker Compose files
  • Application configuration
  • Application data
  • Backup jobs

Why I Use /opt/docker

Linux already uses /opt for optional software.

Using:

/opt/docker

keeps Docker applications separate from:

/home
/etc
/var

and makes the server easier to understand.

When I log into a server, I immediately know where all container data lives.


One Folder Per Application

Each application gets its own folder.

Example:

/opt/docker/jellyfin

Inside that folder I keep:

jellyfin/
├── docker-compose.yml
├── config/
└── cache/

The goal is simple:

Everything required for that application lives in one place.


Keeping Data Beside The Compose File

Whenever possible I use relative paths.

Example:

volumes:
  - ./config:/config
  - ./cache:/cache

instead of:

volumes:
  - /opt/docker/jellyfin/config:/config
  - /opt/docker/jellyfin/cache:/cache

Advantages:

  • Easier backups
  • Easier restores
  • Easier migrations
  • Easier troubleshooting

Note: Large media libraries are stored separately on my Synology NAS and mounted into containers as required.

volumes:
  - ./config:/config
  - ./cache:/cache
  - /mnt/media/movies:/movies:ro
  - /mnt/media/tv:/tv:ro

Why This Helps With Backups

My backup container simply backs up:

/opt/docker

Because every Docker application lives underneath that folder, I do not need separate backup jobs for each application.

The backup process is simple and predictable.


Why This Helps With Migration

If I build a new server, I can usually:

  1. Copy the application folder
  2. Run Docker Compose
  3. Start the containers

Example:

cd /opt/docker/jellyfin
docker compose up -d

Most applications can be restored very quickly using this approach.


Example From My Homelab

A typical application folder looks like:

/opt/docker/homebox
├── docker-compose.yml
└── data/

A more complex application might look like:

/opt/docker/paperless
├── docker-compose.yml
├── consume/
├── data/
├── db/
├── export/
├── media/
└── redis/

Both follow the same principle:

Everything stays together.


Alternatives

Many people prefer:

/home/docker

or:

/srv/docker

There is nothing wrong with these approaches.

The most important thing is consistency.

Choose a structure and use it everywhere.


My Recommendation

For a homelab, I recommend:

/opt/docker

with one folder per application and all application data stored inside that folder whenever practical.

It keeps deployments simple, backups simple, and migrations simple.

As my homelab has grown, this structure has remained easy to manage and has required very little maintenance.