how to install photoprism server on ubuntu
- User
how to install photoprism server on ubuntu
- Assistant
how to install photoprism server on ubuntu
Installing PhotoPrism on an Ubuntu server involves several steps, including setting up Docker and Docker Compose, which are used for managing and running containerized applications. Below is a step-by-step guide to installing PhotoPrism on Ubuntu:
Before starting, make sure your Ubuntu system is updated:
sudo apt update
sudo apt upgrade -y
Docker is a platform used to develop, ship, and run applications inside containers. Install Docker using the following commands:
Install necessary packages for Docker:
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
Add the Docker GPG key and repository:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Install Docker:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
Enable and start Docker service:
sudo systemctl enable docker
sudo systemctl start docker
Add your user to the Docker group (optional, but recommended for managing Docker without sudo):
sudo usermod -aG docker ${USER}
After running the above command, you may need to log out and back in to apply the changes.
Docker Compose is a tool for defining and running multi-container Docker applications.
Download the Docker Compose binary:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Apply executable permissions:
sudo chmod +x /usr/local/bin/docker-compose
Verify the installation:
docker-compose --version
Create a directory for PhotoPrism:
mkdir -p ~/photoprism
cd ~/photoprism
Create a docker-compose.yml file inside this directory with the following content:
version: '3.5'
services:
photoprism:
image: photoprism/photoprism:latest
ports:
- "2342:2342" # choose a different port if needed
volumes:
- "~/photoprism/storage:/photoprism/storage" # storage path
- "~/photoprism/import:/photoprism/import" # directory for photo imports
- "~/photoprism/originals:/photoprism/originals" # directory for originals
environment:
PHOTOPRISM_ADMIN_PASSWORD: "your_password" # make sure to set a strong password
restart: always
Start PhotoPrism using Docker Compose:
docker-compose up -d
Check the status of your PhotoPrism server:
docker-compose ps
Open your web browser and navigate to http://your_server_ip:2342 to access PhotoPrism.
import directory or the originals directory.By following these steps, you should have PhotoPrism running on your Ubuntu server. Be sure to replace placeholder values with your actual configuration details (such as your_password) to ensure a secure setup.