This page provides a structured way to organize folders for media management when using the *arr stack (Radarr, Sonarr, Prowlarr, etc.), ensuring no data duplication. This is based on Trash Guides’ recommendations, but slightly modified.
Note on Hardlinks
By using subdirectories for movies, tv, and downloads, you allow the *arr applications to create hardlinks instead of copying media files, which helps save disk space and prevents data duplication.To test if your hardlinks are working, visit Trash Guides.
The primary dataset is named media
, and contains three main subdirectories:
The media
dataset can be created in the TrueNAS UI, but the subdirectories need to be created in the shell! If your pool was named tank
the command for this would be mkdir -p /mnt/tank/media/{movies,tv,downloads}
after the media
dataset has been created with the apps
permissions preset.
The separate dataset configs
stores the configuration data for various applications we’ll be deploying. Examples include application settings for qBittorrent, Radarr, Sonarr, and Prowlarr. configs
should be all datasets created in the TrueNAS UI.
Naming Rules
- Avoid spaces between datasets
- Do not use capital letters
When you are done, it should look like this:
tank
└── media
├── movies
├── tv
└── downloads
└── torrent
└── configs
├── prowlarr
├── radarr
├── sonarr
├── jellyseerr
├── recyclarr
├── bazarr
├── tdarr
├── jellyfin
├── qbittorrent
└── dozzle
Dockge is a lightweight Docker manager that organizes container volumes under /opt/stacks/
for easier backups and migrations.
Instead of using configs
, all container data is stored in stacks
for easier migration and backups. This helps keep container-related files isolated and ensures they can be quickly moved or restored when necessary.
Config directories now use ./config
meaning they are stored relative to the /opt/stacks/
directory.
This setup allows you to easily move or restore your containers by copying /opt/stacks/
and relaunching them in Dockge.
I have wriiten a script which will create the datasets necessary for the *arr stack as well as build a docker compose yaml with all apps configured for use with those datasets. All permissions are configured to work out-of-the-box.
The two datasets it will create are:
media
has the subdirectories movies
, tv
, and downloads
instead of datasets for proper hardlinking.
All permissions are set to the following:
Parameter | Value |
---|---|
User ID (UID) | apps (568) |
Group ID (GID) | apps (568) |
Permissions
The script sets770
permissions so that the owner and group have full access (r/w/x), while “others” have no access. This helps avoid permissions errors while keeping things secure.
To view the script, look here.
To run the script, execute this one-liner in the TrueNAS shell:
sudo su -c "wget https://raw.githubusercontent.com/serversathome/ServersatHome/refs/heads/main/truenas-file-structure.sh && chmod +x truenas-file-structure.sh && bash truenas-file-structure.sh"
The script will then ask you to choose the pool to install all the datasets to.
Make sure your pool name is all lowercase and has no spaces!
If the script finds any of the paths existing already it will skip it with no modifications.
The docker compose file will be in /mnt/POOLNAME/docker/docker-compose.yml
. To view it execute
cat /mnt/POOLNAME/docker/docker-compose.yml
At the end of the script it will prompt you would to deploy the containers. If you select yes
, this will execute a docker compose up -d
to launch all the containers from the shell. From there the following steps will be executed:
/media/downloads
as the default save path for qBittorrentIf you get the error
"Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
navigate to the Apps tab and enable the Apps service
If you are completely new to Docker or container volumes, you may want to check out a beginner-friendly guide (e.g. Docker docs) before running this setup.
media
and are neatly categorized into movies, tv, and downloads/torrent for torrent handling. For example, the file paths would be:Category | Example Path |
---|---|
Movies | /media/movies/Inception (2010)/Inception.mkv |
TV Shows | /media/tv/Breaking Bad/Season 1/Breaking Bad S01E01.mkv |
configs
directory for standard Docker/TrueNAS setups, while Dockge places these inside stacks
.configs
directory while other systems (e.g., Proxmox LXCs, Ubuntu) may have different volume handling.stacks
for easier backups and migrations.I started using Dockge lately in conjunction with Portainer.
In Dockge, the /opt/stacks/
directory holds all data for the containers. As such, all the config volumes have to reside within that directory, so a docker volume that used to be /config
is now ./config
. The period in front of the slash tells Dockge to keep the volume within the /opt/stacks/
directory. The benefit to this is if you need to migrate or backup your containers somewhere else, all you need to do is copy the /opt/stacks/
directory and relaunch your containers from within Dockge and you’re done!