Run PhotoPrism on another computer

I was able to launch a PhotoPrism container on another computer by following these steps.

Let's say that you have 2 computers, the server is the one that already run PhotoPrism, we'll use our local computer as a client to run PhotoPrism.

⚠️ Prerequisites:

  • you have Docker on both computers, you start PhotoPrism with docker-compose
  • the folders mounted in the photoprism container are mounted on your other computer (I use Samba for this):
    • the folder(s) with your media content
    • the storage folder
  • the storage folder is writable by the client too
  • you understand every step below

On your server:

  1. Do a backup just in case
  2. Stop the photoprism container (we don't want parallel accesses to the same database)
  3. Open the port for the database by updating docker-compose.yml, my local network is on the 192.168.1.X range so I use it to not open the port to Internet:
       # …

Restart the photoprism-db container: docker-compose up --detach photoprism-db

On your client:

We have to run PhotoPrism and it needs to access to the same paths than when it's running on the server.

  1. Copy the docker-compose.yml file, keep only the photoprism service
  2. Remove the network
  3. Update the PHOTOPRISM_DATABASE_DSN variable to use the database on the server
  4. Update the volumes:
    1. the part before : has to be updated and correspond to the paths that were mounted in the container
    2. the part after : is kept as is

You should have something like this:

version: '3.7'

    # …
      # …
      PHOTOPRISM_DATABASE_DSN: "photoprism:photoprism@tcp(,utf8&parseTime=true"
      - "/mnt/nas/photos/:/photoprism/originals/"
      - "/mnt/nas/photoprism/storage/:/photoprism/storage" # keep database files

Start the photoprism container: docker-compose up --detach photoprism.

Access to the PhotoPrism instance through the port you defined. You should see the same media than before.

I didn't do any benchmark, but the network may be the bottleneck with this setup.

Ajouter un commentaire

Les commentaires peuvent être formatés en utilisant une syntaxe wiki simplifiée.

Fil des commentaires de ce billet