AlmaLinuxRHEL Based

How To Install PhotoPrism on AlmaLinux 9

Install PhotoPrism on AlmaLinux 9

PhotoPrism is a powerful, self-hosted photo management application that allows you to organize, browse, and share your digital photos with ease. It offers a user-friendly interface and advanced features, making it an excellent choice for both personal and professional use. In this article, we will guide you through the process of installing PhotoPrism on AlmaLinux 9, a stable and community-driven Linux distribution that provides a solid foundation for hosting applications like PhotoPrism.

Why Choose AlmaLinux 9 for PhotoPrism?

AlmaLinux 9 is a reliable and secure operating system that is well-suited for hosting applications like PhotoPrism. It is a community-driven, free, and open-source distribution that aims to provide a stable and consistent platform for servers and workstations. By installing PhotoPrism on AlmaLinux 9, you can take advantage of its robustness, security updates, and long-term support, ensuring a smooth and uninterrupted photo management experience.

Prerequisites

Before proceeding with the installation of PhotoPrism on AlmaLinux 9, ensure that your system meets the following requirements:

System Requirements

  • A server or virtual machine running AlmaLinux 9
  • Minimum 2 CPU cores (4 cores recommended)
  • At least 4 GB of RAM (8 GB or more recommended)
  • Sufficient storage space for your photo library (SSD recommended)

Required Software and Dependencies

To install PhotoPrism on AlmaLinux 9, you will need the following software and dependencies:

  • Docker: A containerization platform that simplifies the deployment and management of applications.
  • Docker Compose: A tool for defining and running multi-container Docker applications.

Updating System Packages

Before installing any software, it’s essential to ensure that your AlmaLinux 9 system is up to date. Run the following commands to update the system packages:

sudo dnf update -y
sudo dnf upgrade -y

Step-by-Step Installation Guide

1. Setting Up the Environment

To begin the installation process, we need to set up the necessary environment by installing Docker and Docker Compose on AlmaLinux 9.

Installing Docker

Run the following commands to install Docker on AlmaLinux 9:

sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install docker-ce docker-ce-cli containerd.io -y
sudo systemctl enable --now docker

Configuring Docker Compose

To install Docker Compose, execute the following commands:

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

2. Downloading PhotoPrism

With Docker and Docker Compose installed, we can now proceed to download the latest PhotoPrism image using the following command:

sudo docker pull photoprism/photoprism:latest

3. Configuring PhotoPrism

To configure PhotoPrism, we need to create a docker-compose.yml file that defines the services and their settings.

Creating the docker-compose.yml File

Create a new directory for PhotoPrism and navigate to it:

mkdir photoprism && cd photoprism

Create a new file named docker-compose.yml and open it with a text editor:

nano docker-compose.yml

Copy and paste the following content into the file:

version: '3.5'

services:
  photoprism:
    image: photoprism/photoprism:latest
    depends_on:
      - mariadb
    ports:
      - 2342:2342
    environment:
      PHOTOPRISM_ADMIN_PASSWORD: "your_admin_password"
      PHOTOPRISM_SITE_URL: "http://your_server_ip:2342/"
      PHOTOPRISM_ORIGINALS_LIMIT: 5000
      PHOTOPRISM_HTTP_COMPRESSION: "gzip"
      PHOTOPRISM_DATABASE_DRIVER: "mysql"
      PHOTOPRISM_DATABASE_SERVER: "mariadb:3306"
      PHOTOPRISM_DATABASE_NAME: "photoprism"
      PHOTOPRISM_DATABASE_USER: "photoprism"
      PHOTOPRISM_DATABASE_PASSWORD: "your_database_password"
    volumes:
      - "./photos:/photoprism/originals"
      - "./import:/photoprism/import"
      - "./storage:/photoprism/storage"

  mariadb:
    image: mariadb:10.5
    security_opt:
      - seccomp:unconfined
      - apparmor:unconfined
    command: mysqld --innodb-buffer-pool-size=512M --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120
    volumes:
      - "./database:/var/lib/mysql"
    environment:
      MYSQL_ROOT_PASSWORD: "your_root_password"
      MYSQL_DATABASE: "photoprism"
      MYSQL_USER: "photoprism"
      MYSQL_PASSWORD: "your_database_password"

Replace your_admin_password, your_server_ip, your_database_password, and your_root_password with your desired values.

Setting Up Secure Access

To ensure secure access to PhotoPrism, it’s recommended to change the default admin password and configure HTTPS. Modify the PHOTOPRISM_ADMIN_PASSWORD and PHOTOPRISM_SITE_URL variables in the docker-compose.yml file accordingly.

4. Launching PhotoPrism

With the configuration in place, we can now launch PhotoPrism using Docker Compose:

sudo docker-compose up -d

This command will start the PhotoPrism and MariaDB containers in detached mode.

Verifying Installation Success

To verify that PhotoPrism is running successfully, execute the following command:

sudo docker-compose ps

If the containers are running without any errors, you should see output similar to this:

       Name                     Command               State           Ports         
-------------------------------------------------------------------------------------
photoprism_mariadb_1   docker-entrypoint.sh mysqld     Up      3306/tcp              
photoprism_photoprism_1   /entrypoint.sh photoprism       Up      0.0.0.0:2342->2342/tcp

5. Initial Setup and Configuration

With PhotoPrism up and running, you can now access the web interface to perform the initial setup and configuration.

Accessing the PhotoPrism Interface

Open a web browser and navigate to http://your_server_ip:2342. You will be prompted to create an admin account. Enter your desired username and password, then click “Create Admin.”

Install PhotoPrism on AlmaLinux 9

Basic Configuration Settings

After logging in, you can explore the various configuration options available in PhotoPrism. Some basic settings to consider include:

  • Configuring storage paths for your photo library
  • Setting up user accounts and permissions
  • Customizing the appearance and theme
  • Enabling features like face recognition and geo-tagging

Advanced Configuration Options

PhotoPrism offers several advanced configuration options to enhance its functionality and adapt to your specific needs.

Integrating with External Databases

By default, PhotoPrism uses a MariaDB database for storing metadata and user information. However, you can integrate PhotoPrism with other external databases like PostgreSQL or SQLite. To do so, modify the database-related settings in the docker-compose.yml file accordingly.

Configuring Backup Solutions

To ensure the safety of your photo library and metadata, it’s crucial to implement a reliable backup solution. You can use tools like rsync or duplicity to create regular backups of your PhotoPrism data. Consider setting up automated backup scripts to streamline the process.

Setting Up User Management and Roles

PhotoPrism Plus, the premium version of PhotoPrism, offers advanced user management features, including the ability to define user roles and permissions. If you require granular control over user access, consider upgrading to PhotoPrism Plus and exploring its user management capabilities.

Troubleshooting Common Issues

While installing and using PhotoPrism on AlmaLinux 9, you may encounter some common issues. Here are a few troubleshooting tips to help you resolve them:

Addressing Installation Errors

If you encounter errors during the installation process, double-check that you have followed all the steps correctly. Ensure that you have the necessary permissions and that your system meets the prerequisites. If the issue persists, consult the PhotoPrism documentation or community forums for specific error messages and solutions.

Using Logs and Status Checks

If PhotoPrism is not functioning as expected, you can use logs and status checks to diagnose the problem. Run the following command to view the logs of the PhotoPrism container:

sudo docker-compose logs photoprism

Additionally, you can check the status of the containers using the docker-compose ps command. Look for any error messages or indications of issues in the output.

Congratulations! You have successfully installed PhotoPrism. Thanks for using this tutorial for installing the PhotoPrism on the AlmaLinux 9 system. For additional help or useful information, we recommend you check the official PhotoPrism website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button