Skip to content

Docker Volume Mounts

When using Docker, all application services run in isolated containers, so you must explicitly mount the host folders you want to use. Be aware that PhotoPrism and MariaDB cannot see folders that have not been mounted. This is an important security feature.

Originals Folder

The originals folder contains your original photo and video files.

~/Pictures will be mounted by default, where ~ is a shortcut for your home directory:

volumes:
  # "/host/folder:/photoprism/folder"  # example
  - "~/Pictures:/photoprism/originals"

You can mount any folder accessible from the host, including network shares. Additional directories can also be mounted as sub folders of /photoprism/originals (depending on overlay file system support):

volumes:
  - "/home/username/Pictures:/photoprism/originals"
  - "/example/friends:/photoprism/originals/friends"
  - "/mnt/photos:/photoprism/originals/media"

On Windows, prefix the host path with the drive letter and use / instead of \ as separator:

volumes:
  - "D:/Example/Pictures:/photoprism/originals"

If read-only mode is enabled, all features that require write permission to the originals folder are disabled, e.g. WebDAV, uploading and deleting files. Set PHOTOPRISM_READONLY to "true" in docker-compose.yml for this. You can mount a folder with the :ro flag to make Docker block write operations as well.

Storage Folder

SQLite, config, cache, thumbnail and sidecar files are saved in the storage folder:

  • a storage folder mount must always be configured in your docker-compose.yml file so that you do not lose these files after a restart or upgrade
  • never configure the storage folder to be inside the originals folder unless the name starts with a . to indicate that it is hidden
  • we recommend placing the storage folder on a local SSD drive for best performance
  • mounting symbolic links or using them inside the storage folder is currently not supported

Should you later want to move your instance to another host, the easiest and most time-saving way is to copy the entire storage folder along with your originals and database.

Import Folder

You can optionally mount an import folder from which files can be transferred to the originals folder in a structured way that avoids duplicates:

  • imported files receive a canonical filename and will be organized by year and month
  • never configure the import folder to be inside the originals folder, as this will cause a loop by importing already indexed files

You can safely skip this. Adding files via Web Upload and WebDAV remains possible, unless read-only mode is enabled or the features have been disabled.

MariaDB Database

Our example includes a pre-configured MariaDB database server that stores it files in the database folder by default. If you remove it and provide no other database server credentials, SQLite database files will be created in the storage folder.

Never store database files on an unreliable device such as a USB flash drive, SD card, or shared network folder. These may also have unexpected file size limitations, which is especially problematic for databases that do not split data into smaller files. We strongly recommend using SSD storage for databases only.

Network Storage

Shared folders that have already been mounted on your host under a drive letter or path can be used with Docker containers like any other directory. In addition, certain types of network storage like NFS (Unix/Linux) and CIFS (Windows/Mac) can also be mounted directly with Docker Compose.

For more information, see the Network Storage section of our Docker Troubleshooting Guide.

Configure Network Storage ›