How to Self-Host PhotoPrism on a VPS (Complete Guide)
PhotoPrism is an open-source photo management tool that allows you to organize, view, and share your photo collection. Self-hosting PhotoPrism on a VPS (Virtual Private Server) is a practical solution for developers and homelab enthusiasts looking to maintain control over their data. In this guide, we will walk you through the process of installing PhotoPrism on a VPS using Docker.
VPS Providers Overview
Before proceeding with the installation, you need to choose a VPS provider. Below is a comparison of some popular options that are suitable for hosting PhotoPrism:
| Provider | Monthly Cost | RAM | Storage Type |
|---|---|---|---|
| Contabo VPS | 5.99 EUR | 4 GB | SSD |
| Hetzner Cloud | 4.15 EUR | 2 GB | SSD |
| DigitalOcean | 6 USD | 1 GB | SSD |
| Vultr | 6 USD | 1 GB | SSD |
| Linode (Akamai) | 5 USD | 1 GB | SSD |
For more options, check our full VPS comparison.
Step 1: Get a VPS
Sign up for a VPS plan that meets PhotoPrismโs requirements. For a seamless experience, we recommend at least 2 GB of RAM. Providers like Hetzner Cloud and Contabo VPS are budget-friendly options.
Step 2: Connect to Your VPS
-
Use an SSH client to connect to your VPS:
ssh root@your_vps_ip -
Update your package list:
apt update && apt upgrade -y
Step 3: Install Docker
-
Install Docker by running:
apt install docker.io -y -
Start and enable Docker:
systemctl start docker systemctl enable docker -
Verify Docker installation:
docker --version
Step 4: Install Docker Compose
-
Download the Docker Compose binary:
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -
Set permissions:
chmod +x /usr/local/bin/docker-compose -
Verify installation:
docker-compose --version
Step 5: Deploy PhotoPrism with Docker
-
Create a directory for PhotoPrism:
mkdir -p ~/photoprism && cd ~/photoprism -
Create a
docker-compose.ymlfile:version: '3.3' services: photoprism: image: photoprism/photoprism restart: always ports: - "8080:80" environment: PHOTOPRISM_ADMIN_PASSWORD: "admin_password" PHOTOPRISM_ORIGINALS_DIR: "/photoprism/originals" PHOTOPRISM_IMPORT_PATH: "/photoprism/import" volumes: - ./photoprism:/photoprism -
Start PhotoPrism:
docker-compose up -d
Step 6: Access PhotoPrism
Open your web browser and navigate to http://your_vps_ip:8080. Log in with the username admin and the password you set in the docker-compose.yml file.
Step 7: Configuring PhotoPrism
-
Upload Photos: You can upload your photos directly through the web interface or place them in the
originalsdirectory you specified in thedocker-compose.yml. -
Access Control: PhotoPrism allows managing users and permissions. Check the documentation for more on user roles and access settings.
FAQs
Q: What are the requirements to run PhotoPrism on a VPS?
To run PhotoPrism smoothly, you need a minimum of 2 GB RAM and sufficient SSD storage for your photo library. The more RAM and storage you provide, the better performance youโll experience. Network bandwidth is also crucial, especially if you have multiple users accessing the photos simultaneously. Providers like Hetzner Cloud and Contabo VPS are affordable options to meet these requirements.
Q: Can I use my own domain with PhotoPrism?
Yes, you can use your own domain with PhotoPrism. After installing, you can configure a reverse proxy, such as Nginx, to route traffic from your domain to your PhotoPrism installation. You will need to update your domainโs DNS settings to point to your VPS IP address. Documentation for setting up a reverse proxy is available in the PhotoPrism wiki.
Q: How do I back up my PhotoPrism data?
Backing up your PhotoPrism installation involves creating copies of the volume where your photos and settings are stored. You can use Docker commands to create backups of your containers and volumes. A typical approach is to use docker cp to copy data to your local machine or to another storage solution. For long-term backups, consider automating this process with a cron job or backup scripts.
With this guide, you should now have a functional installation of PhotoPrism on your VPS. Enjoy organizing and sharing your photo library while keeping your data secure and private.