English
Get started

← All templates · Media

Deploy Lychee in one click

A photo gallery to upload, sort and share your photos

A self-hosted alternative to Flickr and Google Photos.

What is Lychee?

Lychee is an open-source photo gallery and photo management app that people run on their own server in place of Flickr. You upload photos in the browser, sort them into albums and subalbums, tag them and rate them from one to five stars. It reads each photo's EXIF data and shows geotagged ones on a map. An album can be public, locked with a password or shared with chosen users, and you decide whether visitors may download the files.

People self-host it to keep full-size photos under their own control: Lychee stores originals without compression and sets no storage limit. It suits a photographer's portfolio or a family's shared albums. The catch is that it keeps photos in its own folder structure, so an existing library has to be imported, not browsed where it already is.

Hosting Lychee on Pethost

  1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
  2. New project opens at Lychee, and you click Create project.
  3. In a minute or two Lychee is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
  4. It is a project like any other: you or your agent can change it, roll it back or restore it.

Questions about Lychee

Is Lychee free and open source?

Yes, Lychee is free and released under the MIT license. A paid Supporter Edition adds extras such as library statistics, watermarking and secured image links, and its code is public on GitHub under MIT as well.

Is Lychee a good Google Photos alternative?

Partly. It covers browsing and sharing, with albums, a timeline, a map and search. It does not back up a phone on its own: photos go in by upload or by an import command.

How do I import existing photos into Lychee?

Upload them in the browser, or run php artisan lychee:sync /path/to/import inside the Lychee container: each folder becomes an album. It deletes the original files after import unless you add --delete_imported=0.

Can Lychee have multiple users?

Yes. The admin adds users in the Users menu, and albums are shared with them read-only or with full access. User groups and per-user upload quotas come with the Supporter Edition.

Does Lychee support videos?

Yes. Lychee takes videos alongside photos, in ogv, mp4, mpg, webm, mov, m4v, avi and wmv formats.

How much memory and disk does Lychee need?

Lychee is moderate: about 600 MB with MariaDB; the disk is your photos plus resized copies of each. On Pethost the Starter plan is enough for it, with room for other apps beside it.

Lychee Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

Containers: lychee (lycheeorg/lychee:v7), db (mariadb:11.8).

Volumes, in the nightly backup: uploads, logs, tmp, db.

services:
  lychee:
    image: lycheeorg/lychee:v7
    restart: unless-stopped
    # Lychee's start takes a key only as base64 of 32 bytes: the 32 characters of KEY are those
    # bytes. Compose writes KEY into the command, so the container's environment has APP_KEY alone.
    entrypoint:
      - sh
      - -c
      - export APP_KEY="base64:$$(printf %s ${KEY} | base64)"; exec /usr/local/bin/entrypoint.sh "$$@"
      - lychee
    command: [php, artisan, octane:start, --server=frankenphp, --host=0.0.0.0, --port=8000]
    environment:
      APP_URL: ${URL}
      # TLS ends at the machine's proxy, which says so in X-Forwarded-Proto.
      TRUSTED_PROXIES: "*"
      DB_CONNECTION: mysql
      DB_HOST: db
      DB_PORT: "3306"
      DB_DATABASE: lychee
      DB_USERNAME: lychee
      DB_PASSWORD: ${DB_PASSWORD}
      # No worker: a job runs as it is made.
      QUEUE_CONNECTION: sync
    depends_on:
      db:
        condition: service_healthy
    volumes:
      - uploads:/app/public/uploads
      - logs:/app/storage/logs
      - tmp:/app/storage/tmp

  db:
    image: mariadb:11.8
    restart: unless-stopped
    environment:
      MARIADB_DATABASE: lychee
      MARIADB_USER: lychee
      MARIADB_PASSWORD: ${DB_PASSWORD}
      MARIADB_RANDOM_ROOT_PASSWORD: "1"
    volumes:
      - db:/var/lib/mysql
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 5s
      timeout: 5s
      retries: 30

volumes:
  uploads:
  logs:
  tmp:
  db:

More in Media