Home > Software > How to Set Up PhotoPrism with Docker Compose: A Secure Home for Your Memories

How to Set Up PhotoPrism with Docker Compose: A Secure Home for Your Memories

Anastasios Antoniadis

Learn to set up PhotoPrism, a powerful, privacy-friendly photo management tool, using Docker Compose with our easy-to-follow guide. Organize and share your memories securely and efficiently in your self-hosted gallery.

Docker (1)

PhotoPrism is an open-source, privacy-focused photo management tool that leverages powerful AI to provide automatic photo tagging and indexing. It offers a user-friendly interface and secure storage for digital memories, making it an excellent alternative to cloud-based photo services. Deploying PhotoPrism using Docker Compose simplifies the setup process, enabling your private photo gallery to be up and running on your server in no time. This guide will walk you through the steps to deploy PhotoPrism using Docker Compose.

Prerequisites

Before starting, ensure you have:

  • Docker installed on your server.
  • Docker Compose installed on your server.
  • Basic knowledge of Docker concepts and YAML syntax.

Step 1: Create a Docker Compose File

Create a directory dedicated to your PhotoPrism deployment. This directory will contain your Docker Compose file (docker-compose.yml) and any additional configuration files or directories you might need.

mkdir photoprism-docker && cd photoprism-docker

Create the docker-compose.yml file:

touch docker-compose.yml

Open this file in a text editor and add the following configuration:

version: '3.8'
services:
  photoprism:
    image: photoprism/photoprism:latest
    container_name: photoprism
    ports:
      - "2342:2342"
    environment:
      PHOTOPRISM_HTTP_PORT: 2342
      PHOTOPRISM_ORIGINALS_PATH: /photoprism/originals
      PHOTOPRISM_STORAGE_PATH: /photoprism/storage
    volumes:
      - photoprism-originals:/photoprism/originals
      - photoprism-storage:/photoprism/storage
    restart: unless-stopped

volumes:
  photoprism-originals:
  photoprism-storage:

Configuration Explained:

  • photoprism: Defines the PhotoPrism service using the official PhotoPrism Docker image.
  • ports: Exposes port 2342 on the host to access PhotoPrism’s web interface.
  • environment:
    • PHOTOPRISM_HTTP_PORT: Specifies the internal HTTP port that PhotoPrism uses.
    • PHOTOPRISM_ORIGINALS_PATH: Sets the path where your original photos will be stored.
    • PHOTOPRISM_STORAGE_PATH: Sets the path for PhotoPrism’s internal storage, used for thumbnails and other data.
  • volumes: Maps persistent storage for your original photos and PhotoPrism’s internal storage to ensure data is retained across container restarts.

Step 2: Launch PhotoPrism

With your docker-compose.yml file ready, start the PhotoPrism service by running:

docker compose up -d

This command pulls the necessary Docker image and starts the PhotoPrism container in detached mode.

Step 3: Access PhotoPrism

After a few moments, PhotoPrism will be up and running. You can access the PhotoPrism web interface by navigating to http://your-server-ip:2342 in a web browser. Here, you can begin uploading your photos and exploring PhotoPrism’s features, such as automatic tagging, photo sharing, and secure storage.

Conclusion

Deploying PhotoPrism with Docker Compose offers a straightforward method for setting up a powerful and privacy-focused photo management solution on your own server. Following the steps outlined in this guide, you can quickly get a PhotoPrism instance running, providing a secure and user-friendly platform for storing, organizing, and sharing your digital memories. Docker Compose simplifies the management of PhotoPrism services, making it easy to maintain, backup, and upgrade your instance as your photo collection grows.

Anastasios Antoniadis
Follow me
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x