How to Install PhotoPrism on Fedora Server Latest

PhotoPrism is a self-hosted application for managing and sharing your photo collection. It offers features such as automatic image classification, smart albums, and advanced search capabilities. In this tutorial, we will show you how to install PhotoPrism on Fedora Server latest.

Prerequisites

  • A Fedora Server latest instance
  • Root or sudo user access
  • A domain or subdomain pointing to your server’s IP address
  • 2GB of RAM or higher

Step 1: Update System

Before installing any packages, it is recommended to update the system’s software packages to the latest version.

sudo dnf update -y

Step 2: Install Required Packages

The following packages are required to install PhotoPrism:

  • PHP
  • PHP-FPM
  • PHP-XML
  • PHP-EXIF
  • PHP-ZIP
  • PHP-GD
  • NGINX
  • MariaDB

To install these packages, run the following command:

sudo dnf install -y nginx mariadb-server php php-fpm php-xml php-exif php-common php-zip php-gd 

Step 3: Create a MariaDB Database

Log in to MariaDB using the following command:

sudo mysql -u root

Create a database user by running the following command:

CREATE USER 'photoprism'@'localhost' IDENTIFIED BY 'strongpassword';

Create a new database for PhotoPrism:

CREATE DATABASE photoprism;

Grant the appropriate permissions to the user on the database:

GRANT ALL ON photoprism.* TO 'photoprism'@'localhost';

Flush the privileges and exit:

FLUSH PRIVILEGES;
EXIT;

Step 4: Install PhotoPrism

Download the latest version of PhotoPrism by running the following command:

curl -LO https://dl.photoprism.org/releases/photoprism-linux-amd64-static.tar.gz

Extract the downloaded files and move the PhotoPrism executable to the /usr/local/bin directory:

sudo tar -xzf photoprism-linux-amd64-static.tar.gz
sudo mv photoprism /usr/local/bin

Step 5: Configure NGINX

Create a new server block configuration file for NGINX:

sudo nano /etc/nginx/conf.d/photoprism.conf

Add the following configuration:

server {
    listen 80;
    listen [::]:80;
    server_name example.com; # Your domain or subdomain
    root /var/www/html/photoprism;

    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass unix:/run/php-fpm/www.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
}

Save and close the file.

Step 6: Configure PHP-FPM

Open the PHP-FPM configuration file:

sudo nano /etc/php-fpm.d/www.conf

Update the following settings:

listen = /run/php-fpm/www.sock
listen.acl_users = nginx
user = nginx
group = nginx

Save and close the file.

Step 7: Start the Services

Enable and start the NGINX, PHP-FPM, and MariaDB services using the following commands:

sudo systemctl enable --now nginx
sudo systemctl enable --now php-fpm
sudo systemctl enable --now mariadb

Step 8: Access PhotoPrism

Open your web browser and navigate to http://example.com (replace "example.com" with your domain or subdomain).

The PhotoPrism setup page should appear.

Follow the on-screen instructions to complete the setup process. You will need to provide the following information:

  • The database user credentials created in Step 3
  • The database name created in Step 3
  • A username and password for the admin account

Once the setup is complete, you can start uploading photos to your PhotoPrism instance.

Conclusion

In this tutorial, you learned how to install PhotoPrism on Fedora Server latest. PhotoPrism is a powerful tool for managing and sharing your photo collection, and by following the steps outlined in this tutorial, you can quickly get it up and running on your server.