Skip to main content

Self-Hosting Chevereto V4 (Free Edition) using Docker

I recently set up Chevereto, a powerful image hosting service, on my self-hosted server. While Chevereto offers a paid edition, the Free (V4) edition is robust enough for personal use.

In the past, many users relied on the linuxserver/chevereto image. However, that image has been deprecated. The correct modern approach is to use the Official Chevereto image (ghcr.io/chevereto/chevereto).

This guide covers how to deploy it on a Debian 12 server running a YunoHost/Docker hybrid ecosystem, including a fix for the common "Write Permission" error.

Prerequisites

  • A server with Docker and Docker Compose installed.
  • (Optional) YunoHost for managing domain proxying.
  • A subdomain configured (e.g., photos.example.com).

Deployment

Create a directory for the project and a docker-compose.yml file.

services:
  app:
    image: ghcr.io/chevereto/chevereto:latest
    container_name: chevereto_app
    restart: unless-stopped
    ports:
      - "8080:80" # Exposing to internal port 8080
    environment:
      # Database Connection
      CHEVERETO_DB_HOST: db
      CHEVERETO_DB_USER: chevereto
      CHEVERETO_DB_PASS: MY_SECURE_PASSWORD # Change this
      CHEVERETO_DB_NAME: chevereto
      CHEVERETO_DB_PORT: 3306
      
      # App Settings
      CHEVERETO_LICENSE_KEY: "" # Empty for Free Edition
      CHEVERETO_SERVICING: server # Allows updates via the dashboard
      
      # PHP Limits (Adjust based on server RAM)
      CHEVERETO_MAX_POST_SIZE: 64M
      CHEVERETO_MAX_UPLOAD_SIZE: 64M
      
    volumes:
      # Persist uploaded images
      - ./chevereto_data:/var/www/html/images
    depends_on:
      - db

  db:
    image: mariadb:lts
    container_name: chevereto_db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: MY_ROOT_PASSWORD # Change this
      MYSQL_DATABASE: chevereto
      MYSQL_USER: chevereto
      MYSQL_PASSWORD: MY_SECURE_PASSWORD # Must match app env above
    volumes:
      - ./db_data:/var/lib/mysql

Run the container:

docker compose up -d

Troubleshooting: The "System Error" Permission Issue

Upon first accessing the site, you might encounter a red/grey error screen stating:

System error No write permission for PHP user www-data in /images/ directory.

Why this happens

Docker usually creates volume directories as the root user. However, the Chevereto application inside the container runs as the user www-data (User ID 33). Since www-data cannot write to a folder owned by root, the application crashes.

The Fix

You must manually change the ownership of the mapped data folder to User ID 33. Run the following command in your terminal inside your project folder:

chown -R 33:33 chevereto_data

Then, restart the container to ensure the application recognises the change:

docker compose restart app

Exposing via YunoHost

Since I use YunoHost to manage my domains, I did not need to configure Nginx manually.

  1. Go to the YunoHost Admin Panel.
  2. Applications -> Install.
  3. Select Redirect (or "My Custom Webapp").
  4. Set the domain (e.g., chevereto.nulu.my) and path (/).
  5. Set the destination URL to http://127.0.0.1:8080.

Once installed, the site should be live with SSL automatically handled by YunoHost.