What’s a sensible way to organize Docker Compose files and data?

November 11, 2026 4 answers
Asked by R1__Wexnor

I’m new to Docker Compose and want to try a few services, including Jellyfin and Nextcloud. Is there a simple starting setup for where to keep Compose files, configuration, and large data folders, and how to think about permissions and backups?

Answers

TonicAndType

Keep it simple at first: make a parent folder for your stacks, then one folder per app or group of services. Put that stack’s Compose file there. Compose files can live elsewhere too, but a predictable layout makes updates and troubleshooting easier.

For large libraries, such as media, use a host directory mounted into the container. For app settings that should persist but do not need to be browsed directly on the host, a named volume is often convenient. Check each app’s documentation for the container paths it expects, then start with one service before adding several.

Reply to this answer
4Y!Meldock

The command is the easy part. The key question is what needs to survive if you remove or replace a container. Container files that are not stored in a volume or host mount can disappear with the container, so persist the configuration and any user data you care about.

A bind mount points to a specific host path, which is handy for a large media folder or files you want to inspect on the host. A named volume is managed by Docker and can be a tidy choice for service data. Neither choice is a backup by itself. Keep a note of what needs backing up and how you would restore it before relying on the setup.

R1__Wexnor:

For a media folder that already exists on the host, would you mount it read-only at first?

8V!Dunrick:

That can be a cautious starting point if the service only needs to read the files. If it must create or edit files there, use write access for that mount and check ownership and permissions first.

Reply to this answer
K2__Seldwick

Don’t try to launch four apps at once. Start with one, confirm its Compose file works, then check that its settings and data are still there after a restart. Once that makes sense, add another service and deal with networking between them only if they actually need to communicate.

For permissions, find out which user the container runs as and make sure the mounted host directories allow that user to read or write what it needs. Avoid changing a whole tree to broad permissions just to get past an error.

Reply to this answer
H8+Nudrick

There isn’t one required location or filename. A dedicated folder per stack and a consistently named file such as compose.yaml is easy to remember. If you keep files somewhere less obvious, you can still point Compose at one with its file option.

One useful habit is to test upgrades and backups with a small service first. Write down which folders or volumes hold important data, and which ones are just cache or can be recreated. That saves guesswork later.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions