Hey everyone! I'm relatively new to Docker and have been using Portainer casually. I recently set up a system on Debian 13, which has multiple partitions, with the biggest one being /home. I want to create a stack (specifically, immich) in Portainer that uses a Docker volume instead of a bind mount. My goal is to have that volume stored on the /home partition, as Docker is installed on /var. I believe that using a volume will allow me to easily manage backups and restores, since Docker can package the volume data into a single file for backups. Am I on the right track with this? Any advice would be appreciated!
5 Answers
You can indeed set your volume data wherever you like by modifying the volume definition. If you'd like the persistent volume data to be stored in /home, you can use a syntax like ". /home/docker-volumes/immich/xxx:xxx". Just replace the `xxx` placeholders with the volume names you need for immich!
Another route you can take is to edit the `daemon.json` file to change the Docker data location, including where volumes are stored. Adjusting the "data-root" option will shift the location for new images and volumes, but remember that you'll need to migrate or recreate existing data for it to point to the new directory. Also, consider using the offen/docker-volume-backup tool for backups—it has tons of helpful features!
I get where you're coming from regarding backups, but have you considered just using a bind mount instead? It might simplify things.
If you're looking for a more streamlined approach, check out alternatives like Dockge, Arcane, or Dockhand. They can make accessing and backing up your stacks much easier.
Setting it up should be straightforward. Just follow the installation instructions and make sure to adjust the `UPLOAD_LOCATION` and `DB_DATA_LOCATION` in your `.env` file to point to your desired storage folder. Also, if you have a model cache volume, you can modify the `model-cache` entry with your specific folder and get rid of the `volume:` section at the end of the stack file.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically