how to setup photoprism on ubuntu
- User
how to setup photoprism on ubuntu
- Assistant
how to setup photoprism on ubuntu
Setting up PhotoPrism on Ubuntu involves a series of steps, including installing Docker, Docker Compose, and configuring PhotoPrism itself. Here is a step-by-step guide:
Update System Packages
Ensure your system is up-to-date:
sudo apt update && sudo apt upgrade -y
Install Docker
PhotoPrism runs in Docker containers, so you need Docker installed on your system. Install it by following these steps:
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install -y docker-ce
Verify the Docker installation:
docker --version
Install Docker Compose
Docker Compose is needed to run multi-container Docker applications. Install it using:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Verify the Docker Compose installation:
docker-compose --version
Create Directories for PhotoPrism
You'll need a directory to store the configuration and data for PhotoPrism:
mkdir -p ~/photoprism/storage
mkdir -p ~/photoprism/pictures
Replace ~/photoprism with your preferred path if desired.
Create a Docker Compose File
Inside the photoprism directory (or wherever you chose), create a docker-compose.yml file:
nano ~/photoprism/docker-compose.yml
Add the following configuration:
version: '3.5'
services:
photoprism:
image: photoprism/photoprism:latest
container_name: photoprism
restart: unless-stopped
security_opt:
- seccomp:unconfined
ports:
- "2342:2342"
environment:
PHOTOPRISM_ADMIN_PASSWORD: "YourAdminPasswordHere"
PHOTOPRISM_DEBUG: "false"
PHOTOPRISM_PUBLIC: "false" # Change to true if you want public access
PHOTOPRISM_READONLY: "false"
PHOTOPRISM_UPLOAD_NSFW: "false"
volumes:
- "~/photoprism/storage:/photoprism/storage"
- "~/photoprism/pictures:/photoprism/pictures"
- "/etc/localtime:/etc/localtime:ro"
Be sure to replace YourAdminPasswordHere with a secure password.
Start PhotoPrism
Navigate to the directory containing your docker-compose.yml file and bring up PhotoPrism using:
cd ~/photoprism
docker-compose up -d
This will start PhotoPrism in detached mode.
Access PhotoPrism
Open a web browser and go to http://localhost:2342 on the machine running PhotoPrism. If you're using a remote server, replace localhost with the server's IP address.
Login and Configure
Use the admin password you set in the docker-compose.yml to log into PhotoPrism. From there, you can configure additional settings, add photos, and more.
Stop PhotoPrism:
docker-compose down
View Logs:
docker-compose logs -f
Update PhotoPrism:
docker-compose pull
docker-compose up -d
This should help you set up PhotoPrism on your Ubuntu system. Make sure to back up your data and configurations regularly.