Photoprism - Self hosted google photos #server #photos #googlephotosalternative

 https://docs.photoprism.app/getting-started/docker-compose/#__tabbed_1_1


https://docs.docker.com/


Here's a detailed, step-by-step guide on how to install **PhotoPrism** on **Zorin OS**. PhotoPrism is a self-hosted solution for browsing, organizing, and sharing your photo collection.


### 1. **Update Your System**

First, make sure your system is up to date:


```bash

sudo apt update

sudo apt upgrade

```


### 2. **Install Docker**

PhotoPrism uses Docker to run, so you need to install Docker and Docker Compose.


#### Install Docker:


```bash

sudo apt install docker.io

```


#### Start Docker and enable it to run on startup:


```bash

sudo systemctl start docker

sudo systemctl enable docker

```


#### Verify the Docker installation:


```bash

docker --version

```


#### Install Docker Compose:

Download the Docker Compose binary:


```bash

sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name | cut -d '"' -f 4)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

```


Make the binary executable:


```bash

sudo chmod +x /usr/local/bin/docker-compose

```


Verify the installation:


```bash

docker-compose --version

```


### 3. **Create a Directory for PhotoPrism**

Create a directory where PhotoPrism and its data will reside:


```bash

mkdir -p ~/photoprism

cd ~/photoprism

```


### 4. **Create a Docker Compose File**

Inside the `~/photoprism` directory, create a `docker-compose.yml` file:


```bash

nano docker-compose.yml

```


Paste the following content into the file:


```yaml

version: '3.8'


services:

  photoprism:

    image: photoprism/photoprism:latest

    restart: unless-stopped

    security_opt:

      - seccomp:unconfined

    volumes:

      - "./storage:/photoprism/storage"

      - "/path/to/your/photos:/photoprism/originals"

    environment:

      PHOTOPRISM_ADMIN_PASSWORD: "YourPassword"

      PHOTOPRISM_STORAGE_PATH: "/photoprism/storage"

      PHOTOPRISM_ORIGINALS_PATH: "/photoprism/originals"

      PHOTOPRISM_DEBUG: "false"

      PHOTOPRISM_PUBLIC: "false"

      PHOTOPRISM_READONLY: "false"

      PHOTOPRISM_UPLOAD_NSFW: "true"

      PHOTOPRISM_DATABASE_DRIVER: "sqlite"

      PHOTOPRISM_DATABASE_SERVER: ""

      PHOTOPRISM_DATABASE_NAME: "photoprism"

      PHOTOPRISM_DATABASE_USER: "photoprism"

      PHOTOPRISM_DATABASE_PASSWORD: "secret"

      PHOTOPRISM_SITE_URL: "http://localhost:2342/"

    ports:

      - "2342:2342"

    healthcheck:

      test: ["CMD", "photoprism", "status"]

      interval: 30s

      timeout: 10s

      retries: 3

```


### 5. **Replace Placeholder Paths and Passwords**

In the `docker-compose.yml` file:


- Replace `/path/to/your/photos` with the path where your photos are stored.

- Set the `PHOTOPRISM_ADMIN_PASSWORD` to a strong password of your choice.


After making these changes, save the file and exit the editor (press `CTRL+O` to save and `CTRL+X` to exit in `nano`).


### 6. **Start PhotoPrism**

Run the following command to start PhotoPrism:


```bash

sudo docker-compose up -d

```


This will download the necessary Docker images and start the PhotoPrism service in the background.


### 7. **Access PhotoPrism**

Once the containers are running, you can access PhotoPrism by opening your web browser and navigating to:


```

http://localhost:2342

```


Log in using the username `admin` and the password you set in the `docker-compose.yml` file.


### 8. **Initial Setup and Indexing**

When you log in for the first time, PhotoPrism will ask you to configure some settings and start indexing your photos. Follow the on-screen instructions to complete the setup.


### 9. **Stopping and Managing PhotoPrism**

To stop PhotoPrism, use:


```bash

sudo docker-compose down

```


To view logs:


```bash

sudo docker-compose logs -f

```


To restart PhotoPrism after stopping:


```bash

sudo docker-compose up -d

```


### 10. **(Optional) Enable PhotoPrism to Start on Boot**

To ensure PhotoPrism starts automatically when your system boots, you can create a systemd service.


Create a systemd service file:


```bash

sudo nano /etc/systemd/system/photoprism.service

```


Add the following content:


```ini

[Unit]

Description=PhotoPrism Service

After=network.target docker.service

Requires=docker.service


[Service]

Restart=always

WorkingDirectory=/home/yourusername/photoprism

ExecStart=/usr/local/bin/docker-compose up

ExecStop=/usr/local/bin/docker-compose down


[Install]

WantedBy=multi-user.target

```


Replace `/home/yourusername/photoprism` with the path to your PhotoPrism directory.


Save and close the file, then enable the service:


```bash

sudo systemctl enable photoprism

```


Start the service:


```bash

sudo systemctl start photoprism

```


With these steps, you should have a fully functioning PhotoPrism installation on Zorin OS.


**Restart PhotoPrism**: After making these changes, restart PhotoPrism to apply the new configuration:


bash


Copy code



sudo docker-compose down 

sudo docker-compose up -d`


Comments

Popular posts from this blog

SAMBA SERVER 2.0 #server

Setup SSH for accessing outside from network

Speech tools - espeak and festival etc.