How to Use Docker Volumes on a Different Partition with Portainer?

0
7
Asked By CuriousCat93 On

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

Answered By VolumeMaster23 On

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!

Answered By DockerNinja45 On

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!

Answered By BackupBuddy67 On

I get where you're coming from regarding backups, but have you considered just using a bind mount instead? It might simplify things.

Answered By SimplicitySeeker On

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.

Answered By TechGuru101 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.