copyparty: self-hosted file server in Docker

copyparty turns a folder into a file server with resumable uploads, media playback and WebDAV. How to run it with Docker Compose.

copyparty is a file server in one small package. It shares folders over the browser with drag-and-drop uploads that resume after a broken connection, shows thumbnails, plays audio and video, and speaks WebDAV, FTP and other protocols for clients that prefer them. Access is set per folder and per user.

What you need

  • A server with Docker and the Compose plugin
  • A folder with files to share

Install

Create a folder with two files. Both come from the official example in the copyparty repository, with the optional comments shortened.

services:
  copyparty:
    image: copyparty/ac:latest
    container_name: copyparty
    user: "1000:1000"
    ports:
      - 3923:3923
    volumes:
      - ./:/cfg:z
      - /srv/files:/w:z

    environment:
      PYTHONUNBUFFERED: 1

    stop_grace_period: 15s # thumbnailer is allowed to continue finishing up for 10s after the shutdown signal
    healthcheck:
      test: ["CMD-SHELL", "wget --spider -q 127.0.0.1:3923/?reset=/._"]
      interval: 1m
      timeout: 2s
      retries: 5
      start_period: 15s
  • /srv/files is the folder on the host that gets shared. Inside the container it is /w.
  • ./ is mounted as /cfg. Every file there named something.conf is loaded as configuration.
  • user should be the owner of the shared folder, otherwise uploads fail with a permission error.
  • copyparty/ac is the edition the project recommends: it includes ffmpeg for video and audio thumbnails.
[global]
  e2dsa  # enable file indexing and filesystem scanning
  e2ts   # enable multimedia indexing
  ansi   # enable colors in log messages

[accounts]
  admin: change-me  # username: password

[/]            # create a volume at "/" (the webroot), which will
  /w           # share /w (the docker data volume)
  accs:
    r: *          # everyone can read
    rwmda: admin  # the user "admin" gets read-write-move-delete-admin

Start it:

docker compose up -d

First run

Open http://<host>:3923. You see the shared folder as a guest. Enter the password from copyparty.conf in the login field to get upload, move and delete rights.

To add a second share with its own rules, add another [/name] block to the config and another volume to the compose file, mounted below /w.

Updating

docker compose pull && docker compose up -d