Skip to content

Hostinger VPS Hosting

Use MariaDB Unless You Have a Very Small Library

Hostinger's one-click deployment uses SQLite instead of MariaDB. We do not recommend SQLite unless you have a very small library, as it can cause poor performance as your library grows.

PhotoPrism can be deployed at Hostinger with a single click through its Docker Manager. The installation includes a Traefik reverse proxy, which obtains a free Let's Encrypt certificate so you can access your instance over HTTPS.

This guide covers the PhotoPrism app in Hostinger's Docker Manager catalog on a VPS plan. For optional caption generation on the same server, see AI Captions With Ollama.

Setup

1. Choose a Plan

We recommend a VPS plan with at least 2 CPU cores and 4 GB of memory.

Indexing, face recognition, and video transcoding share the available CPU resources. Processing RAW images and videos can be slow on a server with only one core.

RAW image conversion and face recognition are disabled on instances with 1 GB or less memory. We take no responsibility for instability or performance problems if your server does not meet the system requirements.

2. Deploy PhotoPrism

  • Log in to your Hostinger account
  • Go to VPS, select your server, and open the Docker Manager
  • Switch to the Catalog tab, search for "PhotoPrism", and click Select

Screenshot of the Docker Manager catalog with the PhotoPrism result

  • Enter the password for the "admin" account and click Deploy

Screenshot of the Deploy PhotoPrism dialog with the admin password field

Hostinger then creates two applications, photoprism-<name> and traefik. Replace photoprism-<name> in the examples below with the application name shown in the Docker Manager. The deployment takes about a minute and writes its log to /docker/photoprism-<name>/.build.log on the server.

3. Open PhotoPrism

As soon as both applications show Running, click Open in the PhotoPrism row:

Screenshot of the Docker Manager applications list with both applications running

PhotoPrism opens over HTTPS at the hostname assigned to your application, for example https://photoprism-example.srv123456.hstgr.cloud. Sign in with the username "admin" and the password you entered during the deployment. You can change your password in Settings > Account.

Your Instance Is Also Reachable Without Encryption

The catalog deployment also exposes PhotoPrism over HTTP on a randomly assigned server port. Run docker port photoprism-<name>-photoprism-1 in a server terminal to find this port, which may change when the application is recreated. Use the HTTPS address shown in the Docker Manager when accessing or sharing your instance.

4. First Steps 👣

Unless you have a very small library, switch to MariaDB before adding your pictures.

After signing in, add your pictures through browser uploads or WebDAV:

Screenshot of a library with pictures, camera details, and place names

Our First Steps Tutorial introduces the user interface and library settings.

The default configuration does not mount an import folder. Browser uploads and WebDAV work without changing the Compose file.

Terminal Access

You can open a terminal in the hPanel user interface:

  • The Web console button in the Docker Manager opens a server terminal in a new browser tab.
  • The Terminal link in the Access column of an application's row opens a terminal for that application.

To connect over SSH, add your public key under VPS > Settings > SSH keys with + SSH key, then run ssh root@<your-server> from your computer. Replace <your-server> with your server's IP address or hostname.

Run the Docker and Docker Compose commands in this guide in a server terminal, using the Web console or SSH. To use PhotoPrism's command-line interface from there, prefix its commands with docker exec:

docker exec photoprism-<name>-photoprism-1 photoprism status
docker exec photoprism-<name>-photoprism-1 photoprism index
docker exec photoprism-<name>-photoprism-1 photoprism faces status
docker exec photoprism-<name>-photoprism-1 photoprism backup -i -f

If you use the application's Terminal instead, run the photoprism commands directly, without the docker exec photoprism-<name>-photoprism-1 prefix.

The deployment runs the PhotoPrism container as root. See our Docker Security Guide for instructions on running it as a non-root user. After verifying that SSH key authentication works, disable SSH password authentication and review the firewall settings in hPanel.

Switch to MariaDB

Use the following steps to replace the default SQLite database with MariaDB. The transfer preserves your existing index, including users, albums, and settings, so you can also follow these steps if you have already added pictures.

  1. Open a server terminal, change to your application's directory, and create a database backup:

    cd /docker/photoprism-<name>
    docker compose exec photoprism photoprism backup -i -f
    
  2. Edit /docker/photoprism-<name>/docker-compose.yml and add the mariadb service from our example configuration under the existing services key. Keep the existing PhotoPrism settings, volumes, and Traefik labels. Set strong, unique passwords for MARIADB_PASSWORD and MARIADB_ROOT_PASSWORD before starting MariaDB. The example stores its database files in /docker/photoprism-<name>/database through the ./database:/var/lib/mysql bind mount.

  3. Start MariaDB and check its logs. Wait until it is ready for connections, then stop PhotoPrism to prevent changes during the transfer:

    docker compose up -d mariadb
    docker compose logs mariadb
    docker compose stop photoprism
    
  4. Transfer the SQLite index to the new, empty MariaDB database. Replace YOUR_DATABASE_PASSWORD with the MARIADB_PASSWORD you set above, keeping the quotes:

    docker compose run --rm --entrypoint /opt/photoprism/bin/photoprism photoprism database transfer --target-driver mariadb --target-server mariadb:3306 --target-name photoprism --target-user photoprism --target-password 'YOUR_DATABASE_PASSWORD'
    
  5. After the transfer succeeds, add or update these variables in the existing environment list of the photoprism service in docker-compose.yml. Use the same password as above and remove any PHOTOPRISM_DATABASE_DSN setting that points to SQLite:

          - PHOTOPRISM_DATABASE_DRIVER=mysql
          - PHOTOPRISM_DATABASE_SERVER=mariadb:3306
          - PHOTOPRISM_DATABASE_NAME=photoprism
          - PHOTOPRISM_DATABASE_USER=photoprism
          - PHOTOPRISM_DATABASE_PASSWORD=YOUR_DATABASE_PASSWORD
    
  6. Start PhotoPrism again and check its logs with the following commands. Open your HTTPS address and verify that your pictures, albums, and accounts are complete:

    docker compose up -d
    docker compose logs photoprism
    

Include the new database directory in your backups. Keep your SQLite backup until you have verified the migration. SQLite SQL dumps cannot be restored into MariaDB; use the transfer command above to migrate your index.

Learn more ›

Updates

The deployment uses the latest image tags for PhotoPrism and Traefik. Containers must be updated separately from the server's operating system.

Create a backup before updating. Then open a server terminal, change to your application's directory, and pull the latest images:

cd /docker/photoprism-<name>
docker compose pull
docker compose up -d

After the update, check the application log with docker compose logs -f photoprism. You can also update the application through the Docker Manager.

Learn more ›

Backups

After Switching to MariaDB

The paths and restore command below apply to the default SQLite installation. With MariaDB, database files are stored in /docker/photoprism-<name>/database, and SQL dumps are saved in the database driver's subdirectory of your configured backup folder. Back up the database as well as your originals and storage volumes, and follow the restore instructions when restoring a MariaDB dump.

The installation stores your pictures in the photoprism-<name>_photoprism_originals Docker volume. The photoprism-<name>_photoprism_storage volume contains the SQLite index database, configuration, cache, and backup files. Both volumes are stored below /var/lib/docker/volumes/ on the server.

PhotoPrism's default configuration creates daily database backups and retains up to three SQL dumps. You can change the schedule and retention limits in the backup configuration.

To create a database backup manually, run:

docker exec photoprism-<name>-photoprism-1 photoprism backup -i -f

With the default Docker image configuration, the dump is saved as /photoprism/storage/backups/sqlite3/<date>.sql inside the container. The corresponding path on the host is /var/lib/docker/volumes/photoprism-<name>_photoprism_storage/_data/backups/sqlite3/.

These database backups remain on the same server. For a full backup, also copy your originals and storage volumes to a separate location, as described in our Backup Guide.

To restore a dump, stop PhotoPrism and mount its existing volumes in a temporary container. Replace <file> with the SQL dump filename:

docker stop photoprism-<name>-photoprism-1
docker run --rm --entrypoint sh \
  -e PHOTOPRISM_STORAGE_PATH=/photoprism/storage \
  -e PHOTOPRISM_ORIGINALS_PATH=/photoprism/originals \
  -v photoprism-<name>_photoprism_storage:/photoprism/storage \
  -v photoprism-<name>_photoprism_originals:/photoprism/originals \
  photoprism/photoprism:latest -c "photoprism restore -i -f /photoprism/storage/backups/sqlite3/<file>.sql"
docker start photoprism-<name>-photoprism-1

Restoring a database backup does not restore or remove original files. Files that remain in the originals volume can be indexed again during the next scan.

Learn more ›

Domains & HTTPS

Your instance receives a valid Let's Encrypt certificate for the Hostinger hostname by default. Traefik renews this certificate automatically.

To use your own domain, follow Hostinger's Docker Domain Guide:

  1. Create an A record for your hostname, for example photos.example.com, pointing to your VPS IP address. If your domain uses Hostinger nameservers, you can manage its DNS records in hPanel. Otherwise, use your DNS provider's dashboard.
  2. In hPanel, open VPS > Manage > Docker Manager, select your PhotoPrism project, and click Manage to open the YAML editor.
  3. Update the existing Traefik router rules in the photoprism service's labels section to use your full hostname, for example Host(`photos.example.com`). Keep the existing router names and update both HTTP and HTTPS rules if present.
  4. Set the photoprism service's PHOTOPRISM_SITE_URL environment variable to https://photos.example.com/ so generated links use the new address.
  5. Click Deploy to apply the changes. Traefik will request a Let's Encrypt certificate for the new hostname. Allow 1-3 minutes, then open your HTTPS address.

If an existing router rule combines ${COMPOSE_PROJECT_NAME} and ${TRAEFIK_HOST}, changing TRAEFIK_HOST alone also keeps the project name as a hostname prefix. Set the complete hostname in the router's Host rule as described above.

Always use HTTPS when accessing PhotoPrism over the Internet to protect your files and passwords.

Learn more ›

AI Captions With Ollama

You can optionally run Ollama on the same server to generate captions with a local vision model. The example below makes its API available to PhotoPrism over the Docker network and to the server over localhost.

Step 1: Install Ollama

Create the /docker/ollama directory on your server, then save the following as /docker/ollama/docker-compose.yml. Replace photoprism-<name>_default with your application's Docker network name:

services:
  ollama:
    image: ollama/ollama:latest
    restart: unless-stopped
    ports:
      - "127.0.0.1:11434:11434"
    mem_limit: 4g
    volumes:
      - ollama_models:/root/.ollama
    networks:
      - photoprism

volumes:
  ollama_models:

networks:
  photoprism:
    name: photoprism-<name>_default
    external: true

To check the network name, run docker network ls in a server terminal. Start Ollama from its own directory:

cd /docker/ollama
docker compose up -d

Step 2: Download a Model

From the /docker/ollama directory, download the model:

docker compose exec ollama ollama pull minicpm-v4.6:1b

Step 3: Configure PhotoPrism

Add these variables to the existing environment list of the photoprism service in /docker/photoprism-<name>/docker-compose.yml:

      - OLLAMA_BASE_URL=http://ollama:11434
      - OLLAMA_MODEL=minicpm-v4.6:1b

Then recreate the PhotoPrism service to apply the environment variables:

cd /docker/photoprism-<name>
docker compose up -d

Create or edit vision.yml in PhotoPrism's storage/config folder, which is located at /photoprism/storage/config/ inside the container. Add the following model to generate captions for newly indexed pictures:

Models:
  - Type: caption
    Model: minicpm-v4.6:1b
    Engine: ollama
    Run: newly-indexed
    Service:
      Uri: ${OLLAMA_BASE_URL}/api/generate
      Think: "false"

Captions for newly indexed pictures are generated by background workers, so they may appear a few minutes after an upload.

On a server with 8 GB of memory, we recommend a small model such as minicpm-v4.6:1b to leave enough memory for indexing, face recognition, and video transcoding.

Learn more ›