PhotoPrism is a self-hosted photo and video management solution with AI features, and an alternative to Google Photos or Apple Photos. PhotoPrism scans your photos and videos, recognizes subjects and faces, places photos with GPS data on a map, and makes your entire collection searchable—for example, by “beach,” a location, a year, or a camera. You can open PhotoPrism in a browser on any device, and on your smartphone you can also install it as a web app.
In this guide, we’ll show you two ways to get started: the easy way with a One-Click App, which runs PhotoPrism with a generated administrator password and HTTPS at your address, and a manual installation with Docker Compose. After that, you’ll upload photos, connect your smartphone, and learn what PhotoPrism can and can’t do without a membership.
PhotoPrism is a good choice if:
- You don’t want your photos stored with a cloud provider. Your originals, thumbnails, and database are stored on your own server.
- You want to make an existing collection searchable. PhotoPrism preserves your folder structure, reads metadata such as the date taken, camera, and GPS data, and automatically adds keywords.
- You want to share photos with family or friends. You can share albums and individual photos via a link, without requiring recipients to have an account.
- You work with photos from different sources. In addition to JPEG, PhotoPrism handles HEIC from iPhones, RAW files from many cameras, and videos.
PhotoPrism is less suitable if you’re mainly looking for an automatic backup of your phone’s camera roll through a dedicated app. Immich is a better fit for that. If you need files, calendars, and contacts in addition to photos, take a look at Nextcloud.
Both programs manage photos on your own server, but they focus on different things:
| PhotoPrism | Immich | |
|---|---|---|
| Focus | Searching, organizing, and sharing a collection | Automatically backing up phone photos |
| Smartphone | Browser-based web app; upload via browser or WebDAV app | Dedicated Android and iOS app with background uploads |
| Existing folders | Preserved with their folder structure | Usually added as an external library |
| Multiple users | Additional roles require a membership | Multiple users included by default |
If you mainly want to organize a large photo archive from your computer or an old hard drive, PhotoPrism is a strong choice. If automatic smartphone backups are your priority, Immich is usually more convenient.
The quickest way to get PhotoPrism is through your VPS’s One-Click Apps. With a domain, the app is directly accessible over HTTPS. The One-Click App sets up the database, reverse proxy, and certificate for you, and ZapX generates your administrator account password during installation.
- A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Setting Up One-Click Apps for instructions.
- PhotoPrism needs at least 2 vCores and 2 GB of RAM for the app; 4 vCores and 4 GB are recommended. Image recognition and thumbnail generation require a lot of processing power, and more cores significantly speed up the initial scan.
- Make sure you have enough disk space: the image takes up around 3.7 GB, in addition to your originals and thumbnails. For a photo collection, plan for at least 50 GB of free space.
- Open your VPS in the ZapX dashboard and switch to the One-Click Apps tab.
- Search the App catalog for PhotoPrism and click Install app.
- Use a custom subdomain or zap.cloud is already selected. Leave this option enabled and enter a name, for example
photos. Without a domain, PhotoPrism would only be accessible over HTTP, and your password would be transmitted unencrypted. - You don’t need to enter anything under App configuration. ZapX generates the three passwords for PhotoPrism and the database.
- Click Queue installation. The first time, the VPS downloads the image, which is around 1 GB, and PhotoPrism then sets up the database. After about two to three minutes, the app card will show the app as online.
- In the app settings (gear icon), open the App environment tab. Under Automatically generated values, find
SERVICE_PASSWORD_PHOTOPRISM. Click the eye icon to show the password, or the icon next to it to copy it. - Open the app’s Access link.
- Sign in with the username
adminand this password, then click Sign in.
The username admin is fixed. Sign-in is always enabled for the One-Click App: visitors only see the sign-in page unless they log in, and WebDAV access also requires a username and password. The other two values under Automatically generated values are for the MariaDB database. You won’t need them for everyday use.
SERVICE_PASSWORD_PHOTOPRISM is only for your first sign-in. After that, change your password in PhotoPrism under Settings > Account > Change Password. The new password remains valid after restarts and updates. The value in the App environment is outdated after that; changing it there will not reset your password.
The One-Click App starts two containers: photoprism, with the web interface, image recognition, and WebDAV server, and mariadb, which serves as the database. The database is only accessible within the app, while PhotoPrism itself is accessible only through your domain. Data is stored in three volumes:
photoprism-originals: your originals, meaning uploaded photos and videos.photoprism-storage: thumbnails, settings, sidecar files with metadata, and automatic database backups.photoprism-database: the MariaDB database with albums, keywords, people, and ratings.
The interface is set to English. Under Settings > General, select German under Language. This guide uses the English labels.
To check whether a new version is available, open the app settings (gear icon), go to App update, and click Check for updates. Install a new version by clicking Apply update. If the page says the app is up to date, there isn’t a newer version in the app catalog. Your photos, albums, and settings are preserved during updates.
PhotoPrism automatically creates a database backup once a day in the photoprism-storage volume and keeps the last three. This protects you from database errors, but not from losing the entire server. So back up your VPS from the Backups tab to protect your originals, thumbnails, and database together. For large collections, it’s also worth keeping a copy of your originals on another storage location, for example via WebDAV (see “Upload and Scan Photos”).
The rest of this guide describes a manual installation of PhotoPrism with Docker Compose on your VPS—for example, if you don’t use One-Click Apps on the server or want to manage PhotoPrism yourself alongside other services. The instructions are based on the official Docker Compose guide.
- A Linux VPS running Debian or Ubuntu, with SSH access. See First Access via SSH.
- Docker and Docker Compose. See Install Docker. Check the installation with
docker --versionanddocker compose version. - For HTTPS: a domain or subdomain whose A record points to your VPS’s IP address (e.g.,
photos.example.com).
| Minimum | Recommended | |
|---|---|---|
| CPU | 2 vCores | 4 vCores |
| RAM | 2 GB for PhotoPrism | 4 GB |
| Storage | 5 GB plus photos | 50 GB or more |
According to the official documentation, the server should have at least 3 GB of RAM in total, plus an additional 4 GB of swap. When scanning large images and videos, PhotoPrism temporarily needs significantly more memory; without swap, the container may stop. Depending on your collection, thumbnails can take up additional space equivalent to some of the space used by the originals.
PhotoPrism listens on port 2342 inside the container. Don’t open this port, because PhotoPrism should only be accessible through a reverse proxy with HTTPS. With ufw, allow only SSH and the ports required by the reverse proxy:
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status
In the Compose file below, port 2342 is bound only to 127.0.0.1. This means only the reverse proxy on the same server can access it, even if Docker sets its own firewall rules.
Create a folder for PhotoPrism and generate random passwords for the administrator account and database. They’ll be saved in the .env file:
mkdir -p ~/photoprism && cd ~/photoprism
echo "ADMIN_PASSWORD=$(openssl rand -hex 12)" > .env
echo "DB_PASSWORD=$(openssl rand -hex 24)" >> .env
echo "DB_ROOT_PASSWORD=$(openssl rand -hex 24)" >> .env
chmod 600 .env
Then create a compose.yaml file in the ~/photoprism folder, for example with nano compose.yaml:
services:
photoprism:
image: photoprism/photoprism:261029
restart: unless-stopped
stop_grace_period: 15s
depends_on:
- mariadb
security_opt:
- seccomp:unconfined
- apparmor:unconfined
ports:
- "127.0.0.1:2342:2342"
environment:
PHOTOPRISM_ADMIN_USER: "admin"
PHOTOPRISM_ADMIN_PASSWORD: "${ADMIN_PASSWORD}"
PHOTOPRISM_AUTH_MODE: "password"
PHOTOPRISM_SITE_URL: "https://photos.example.com/"
PHOTOPRISM_DISABLE_TLS: "true"
PHOTOPRISM_DEFAULT_LOCALE: "de"
PHOTOPRISM_ORIGINALS_LIMIT: 5000
PHOTOPRISM_UPLOAD_LIMIT: 5000
PHOTOPRISM_DATABASE_DRIVER: "mysql"
PHOTOPRISM_DATABASE_SERVER: "mariadb:3306"
PHOTOPRISM_DATABASE_NAME: "photoprism"
PHOTOPRISM_DATABASE_USER: "photoprism"
PHOTOPRISM_DATABASE_PASSWORD: "${DB_PASSWORD}"
working_dir: "/photoprism"
volumes:
- "./originals:/photoprism/originals"
- "./storage:/photoprism/storage"
- "./import:/photoprism/import"
mariadb:
image: mariadb:12.3
restart: unless-stopped
stop_grace_period: 15s
security_opt:
- seccomp:unconfined
- apparmor:unconfined
command: --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:
MARIADB_AUTO_UPGRADE: "1"
MARIADB_INITDB_SKIP_TZINFO: "1"
MARIADB_DATABASE: "photoprism"
MARIADB_USER: "photoprism"
MARIADB_PASSWORD: "${DB_PASSWORD}"
MARIADB_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
Important lines:
imageuses the official image with a fixed version number. The tags are the release date in YYMMDD format, so261029is the version from October 29, 2026. You can find the current version in the PhotoPrism release notes.portsbinds PhotoPrism only to127.0.0.1. The port isn’t accessible externally.PHOTOPRISM_ADMIN_PASSWORDis the password for your first sign-in asadmin. The official example file usesinsecurehere. Don’t use that; instead, use a random password from the.envfile as shown above.PHOTOPRISM_AUTH_MODE: "password"makes PhotoPrism require a sign-in. Never set this topublicon a server connected to the internet, or anyone will be able to view and edit your photos.PHOTOPRISM_SITE_URLis the address where PhotoPrism will be available. Replacephotos.example.comwith your domain. Shared links use this address.PHOTOPRISM_DISABLE_TLSdisables built-in HTTPS because nginx handles encryption.PHOTOPRISM_ORIGINALS_LIMITandPHOTOPRISM_UPLOAD_LIMITlimit the size of individual files and uploads in MB. PhotoPrism skips larger files, such as long videos../originalscontains your photos,./storagecontains thumbnails, settings, and backups, and./databasecontains the database. Use the./importfolder for the Import feature.
Start PhotoPrism:
docker compose up -d
docker compose logs -f photoprism
On the first start, PhotoPrism creates the database. The app is ready once server: listening on 0.0.0.0:2342 appears. Press Ctrl+C to exit the log view; the containers will keep running.
Before setting up the reverse proxy, you can test PhotoPrism through an SSH tunnel. Run this on your own computer:
ssh -L 2342:127.0.0.1:2342 root@SERVER_IP
Then open http://localhost:2342 in your browser and sign in with admin and the password shown on the server by running grep ADMIN_PASSWORD ~/photoprism/.env. After that, change the password under Settings > Account > Change Password. The value in the .env file is only for your first sign-in.
Set up nginx as a reverse proxy as described in Set Up an nginx Reverse Proxy, and obtain a certificate as explained in SSL Certificate with Let's Encrypt. The server block for PhotoPrism looks like this:
server {
listen 80;
server_name photos.example.com;
client_max_body_size 5000m;
location / {
proxy_pass http://127.0.0.1:2342;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_buffering off;
}
}
client_max_body_sizeallows large uploads up to the limit set byPHOTOPRISM_UPLOAD_LIMIT. Without this line, nginx stops uploads larger than 1 MB.UpgradeandConnectionforward the WebSocket connection PhotoPrism uses to show scan progress and new photos in real time.
Then run sudo nginx -t and sudo systemctl reload nginx, and obtain the certificate with sudo certbot --nginx -d photos.example.com. PhotoPrism is now available at https://photos.example.com.
First, create a current backup of the database and album data. PhotoPrism saves it in the storage/backups folder:
cd ~/photoprism
docker compose exec -T photoprism photoprism backup -i -a -f
Then back up the originals and storage folders, as well as the .env and compose.yaml files—for example, with rsync to another server or storage location. To create a complete copy that includes the database folder, briefly stop the containers:
docker compose stop
sudo tar czf ~/photoprism-backup-$(date +%F).tar.gz database storage .env compose.yaml
docker compose start
For large collections, it’s better to back up the originals separately with rsync rather than re-archive them every time. PhotoPrism also creates a database backup once a day and keeps the last three.
Create a backup first and read the release notes. Then enter the new tag for image in compose.yaml and run:
cd ~/photoprism
docker compose pull
docker compose up -d
docker image prune -f
When it starts, PhotoPrism automatically updates the database to the new version. MARIADB_AUTO_UPGRADE does the same for MariaDB when you switch database versions. Don’t use a preview image for everyday use; it’s a pre-release version for testing.
After you sign in, PhotoPrism opens the photo overview. The sidebar contains albums, videos, people, favorites, the map, calendar, keywords, and folders.
There are two convenient ways to get photos onto the server:
- In your browser: In the sidebar, open Library > Import and click Upload. You can upload individual files or ZIP archives. PhotoPrism will scan them afterward.
- Via WebDAV: Use WebDAV to mount the folder containing your originals like a network drive on Windows, macOS, or Linux, or in a file app. The address is
https://photos.example.com/originals/(for the One-Click App, use the address in the Access link with/originals/added at the end). Sign in withadminand your password. PhotoPrism also shows the exact address under Settings > Account > Connect via WebDAV.
PhotoPrism automatically scans files copied via WebDAV after about five minutes. To scan a large number of files, start the scan yourself under Library > Index by clicking Start. The first scan of a large collection can take hours because PhotoPrism creates thumbnails and recognizes subjects and faces for every image.
PhotoPrism classifies images without camera data, such as screenshots or images downloaded from the internet, as “low quality” and holds them for review. Find them in the sidebar under Search > Review. Select them and click Approve to make them appear in the regular overview.
If you’ve enabled two-factor authentication under Settings > Account > 2-Factor Authentication, WebDAV will no longer work with your regular password. Create a separate app password for WebDAV under Apps and Devices.
PhotoPrism doesn’t have a dedicated app in the app stores. Open your address in your smartphone’s browser and add it to your home screen through the browser menu. PhotoPrism will then open like an app in full-screen mode. Upload photos there just as you would on a computer, using Upload.
To automatically transfer new photos from your phone, use an app that uploads via WebDAV, such as PhotoSync. Enter the WebDAV address ending in /originals/ and your account details as the destination. PhotoPrism will then scan the new images automatically.
Select one or more images in the photo overview and use the selection menu to add them to an album. Share an album via a link using the share icon. Anyone with the link can view and download the album without an account. You can delete links or set an expiration date at any time.
- Administrator accounts only. Additional roles such as
user,viewer, orguestare only available with a paid PhotoPrism membership. Without a membership, you can share photos via links instead of creating accounts with limited permissions. - No email-based password recovery. You’ll need to reset a forgotten password on the server; see the FAQ.
- Location details require an online service. To show locations on the map, PhotoPrism looks up GPS coordinates using its own service. Place names won’t appear if the server doesn’t have an internet connection.
- Processing power. Image recognition and video processing run on the CPU. PhotoPrism doesn’t use a graphics card on a VPS, so scanning large collections takes longer.
PhotoPrism gives you your own photo library with AI-powered search, facial recognition, maps, and link sharing, without handing your pictures over to a cloud provider. To get new photos from your devices onto the server automatically, the guide Set Up Syncthing on a Linux Server shows you how to keep folders in sync between your phone, PC, and server.
If you have any other questions or need help, our support team is available every day! 🙂
