PhotoPrism is a web-based photo management tool for uploading, managing and sharing photos. PhotoPrism provides automatic image classification, searching images using various filters, RAW file format conversion, duplicate files detection, and more.
This tutorial explains how to install PhotoPrism inside a Docker container in the Linux. Commands have been tested on Ubuntu.
Prepare environment
Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.
You also need to have a running MariaDB container. Instructions can be found in the post.
Install PhotoPrism
Before starting, create photoprism database:
docker exec -it mariadb mariadb -u root -p -e "CREATE DATABASE photoprism"- Host network
Run the following command to create a container for PhotoPrism that uses host network:
docker run -d --name=photoprism --restart=always --network=host \
    -v /opt/photoprism/photos:/photoprism/originals \
    -v /opt/photoprism/data:/photoprism/storage \
    -e PHOTOPRISM_ADMIN_USER=admin \
    -e PHOTOPRISM_ADMIN_PASSWORD=pwd123 \
    -e PHOTOPRISM_DATABASE_DRIVER=mysql \
    -e PHOTOPRISM_DATABASE_USER=root \
    -e PHOTOPRISM_DATABASE_PASSWORD=pwd123 \
    -e PHOTOPRISM_DATABASE_NAME=photoprism \
    -e PHOTOPRISM_DATABASE_SERVER=127.0.0.1:3306 \
    photoprism/photoprismMariaDB container should run on host network as well.
- User-defined bridge network
User-defined bridge network can be used for listening on different port. By default, PhotoPrism service is listening on port 2342. It can be changed with -p option.
docker network create app-netdocker run -d --name=photoprism --restart=always --network=app-net \
    -p 8080:2342 \
    -v /opt/photoprism/photos:/photoprism/originals \
    -v /opt/photoprism/data:/photoprism/storage \
    -e PHOTOPRISM_ADMIN_USER=admin \
    -e PHOTOPRISM_ADMIN_PASSWORD=pwd123 \
    -e PHOTOPRISM_DATABASE_DRIVER=mysql \
    -e PHOTOPRISM_DATABASE_USER=root \
    -e PHOTOPRISM_DATABASE_PASSWORD=pwd123 \
    -e PHOTOPRISM_DATABASE_NAME=photoprism \
    -e PHOTOPRISM_DATABASE_SERVER=mariadb:3306 \
    photoprism/photoprismMariaDB container should run on the same user-defined bridge network as well.
Notes:
- Don't forget to change adminpassword for PhotoPrism usingPHOTOPRISM_ADMIN_PASSWORD.
- The PHOTOPRISM_DATABASE_USERandPHOTOPRISM_DATABASE_PASSWORDcan be used to specify MariaDB credentials.
- When user-defined bridge network is used, don't forget to change PHOTOPRISM_DATABASE_SERVER. It specifies MariaDB container name.
Testing PhotoPrism
Open a web browser and go to http://<IP_ADDRESS>:2342, where <IP_ADDRESS> is the IP address of the system. Log in to the dashboard with the admin username and password.
 
Uninstall PhotoPrism
To completely remove PhotoPrism, remove its container:
docker rm --force photoprismRemove PhotoPrism image:
docker rmi photoprism/photoprismYou can also remove PhotoPrism data:
sudo rm -rf /opt/photoprismIf a user-defined bridge network was created, you can delete it as follows:
docker network rm app-net 
             
                         
                         
                        
Leave a Comment
Cancel reply