Home / Guide / Copyparty configuration file

Copyparty Configuration Explained: Accounts, Volumes and Permissions

Understand copyparty configuration files: global options, accounts, volumes, permission letters, volume flags and safe patterns for upload-only folders and shares.

Keyboard, orange padlock and smartphone on a dark wooden desk

Copyparty configuration can be done entirely on the command line, but as soon as you share more than one folder or create more than one account, a configuration file becomes far easier to read and maintain. The file format is compact and forgiving, and once you understand its three building blocks, global options, accounts and volumes, you can express almost any sharing arrangement in a few lines. This guide explains each part, introduces the permission letters, shows practical patterns and covers how to apply changes safely.

Command line or configuration file?

Every option copyparty accepts can be given in either form. Short tests are quickest on the command line, while permanent setups belong in a file. You can also mix the two: start copyparty with -c pointing at a file, and add extra options on the command line when needed.

Terminal
copyparty -c /etc/copyparty.conf

The file syntax resembles YAML but is not identical to it. Sections are written in square brackets, settings are indented beneath them, and comments begin with a hash sign. Inline comments are allowed when there are at least two spaces before the hash.

The global section

The [global] section holds options that apply to the whole server, the same options you would otherwise pass as command-line flags. Common examples include the port, indexing and the default theme.

Terminal
[global]
  p: 3923      # port to listen on
  e2dsa        # index all files for search
  e2ts         # index media tags
  theme: 2     # default theme for new visitors

Options that take no value, such as e2dsa, are simply listed. Options with values use a colon. Changes to the global section require a restart to take effect.

Defining accounts

The [accounts] section lists user names and passwords, one per line.

Terminal
[accounts]
  alice: CorrectHorseBatteryStaple
  bob: AnotherLongPassphrase

Passwords can also be stored as hashes rather than plain text, which is a sensible precaution on shared machines. copyparty includes an option for generating password hashes, described in its built-in help and the password-hashing section of the documentation.

You can additionally organise users into groups, which makes permissions easier to manage as the number of accounts grows.

Defining volumes

A volume connects a folder on disk to a path in the web interface. Each volume has its own section, named after its web path, followed by the folder it serves and an access list.

Terminal
[/music]
  /mnt/storage/music
  accs:
    r: *
    rw: alice

This shares the music folder at /music, readable by everyone and writable by alice. The asterisk means every visitor, including people who are not logged in.

The root volume uses a single slash.

Terminal
[/]
  /srv/public
  accs:
    r: *

Understanding permission letters

Permissions are expressed as letters, and you can combine several for one user.

  • r lets a user browse folders and download files.
  • w lets a user upload files.
  • m lets a user move files out of the folder.
  • d lets a user delete files and folders.
  • g lets a user download a file only if they know its exact address, without browsing.
  • G works like g, but also lets uploaders receive a link to the file they just sent.
  • h serves an index.html file in a folder instead of listing it.
  • a grants administrative abilities, such as seeing upload details and reloading the configuration.
  • A is a shortcut for full control.

Thinking in these letters makes it easy to express precise rules, such as a folder where people can add files but not see what others have uploaded.

Practical patterns

A few arrangements cover most real-world needs.

A public read-only archive

Terminal
[/archive]
  /srv/archive
  accs:
    r: *

A private folder for one person

Terminal
[/alice]
  /srv/users/alice
  accs:
    A: alice

An upload-only drop box

Terminal
[/inbox]
  /srv/inbox
  accs:
    w: *
    rwmd: alice

Anyone can upload, nobody else can see the contents, and alice manages what arrives. This is ideal for collecting files from clients, students or event guests.

A family media library

Terminal
[/media]
  /srv/media
  accs:
    r: alice, bob
    rwmd: alice

Volume flags

Beyond permissions, each volume can carry flags that change its behaviour. Flags go beneath the access list under a flags heading.

Terminal
[/inbox]
  /srv/inbox
  accs:
    w: *
  flags:
    e2d          # enable the upload database for this volume
    lifetime: 86400

The lifetime flag in this example makes uploads expire after a day, measured in seconds. Other flags control deduplication, thumbnails, indexing and upload rules such as maximum file sizes. Applying flags per volume lets you switch on demanding features only where they are useful.

How permissions combine

Two rules explain most surprises. First, a volume does not inherit permissions from the volume above it in the web interface; each volume’s access list stands on its own. Second, operating-system permissions still apply. If the user account running copyparty cannot write to a folder, uploads fail no matter what the configuration says. When something behaves unexpectedly, check both layers.

Hiding and shadowing folders

Sometimes you want to share a folder while hiding one of its subfolders. copyparty supports this by mounting a different volume, or an empty one, at the subfolder’s path, which shadows the original. Dotfiles, such as hidden configuration files, are excluded from listings unless a user is granted the dot permission. These tools help you publish a directory tree without exposing everything inside it.

Applying changes safely

Changes to accounts and volumes can be applied without a full restart. On Linux, systemctl reload copyparty asks the server to reread its configuration, and an administrator can also press the reload button in the control panel. Changes to the global section still need a restart.

A sensible routine for editing a live configuration looks like this.

  • Make a copy of the working file before editing.
  • Change one thing at a time.
  • Reload or restart and watch the console for errors.
  • Test the affected volume with the relevant account.

If copyparty refuses to start after an edit, its error message names the problematic line, and your backup lets you recover in seconds.

Keeping the configuration secure

The configuration file can contain passwords, so treat it like any other secret. On Linux, make it readable only by the user that runs copyparty. Avoid committing it to public repositories, and prefer hashed passwords where several people administer the same machine. Review the access lists from time to time, removing accounts that are no longer needed.

Using groups for larger setups

As soon as more than a handful of people use your server, listing every user in every volume becomes tedious and error-prone. Groups solve this by letting you define a set of users once and refer to the whole set in access lists. A household might have a group for parents and another for children; a small office might have groups for each department. Adding a new person then means updating one group rather than every volume.

Keep group names short and descriptive, and review membership whenever someone leaves. Combined with clear volume names, groups make even a large configuration file easy to understand at a glance.

Commenting your configuration

Future you will thank present you for comments. A configuration file that explains why a volume exists, who asked for it and what each unusual flag does is far easier to maintain than a bare list of settings. Write comments as full, short sentences above each section, and note the date of significant changes. Because copyparty ignores comments, they cost nothing and can prevent mistakes months later.

Testing permissions from the visitor’s side

The surest way to confirm a configuration is to see the server as each visitor does. Open a private browser window, which has no stored login, and browse as an anonymous visitor. Then log in with each account in turn and try to read, upload, move and delete in every volume. Any action that succeeds when it should not, or fails when it should succeed, points directly to the access list that needs adjusting.

Splitting configuration across files

Large setups can grow beyond what is comfortable in a single file. copyparty can read several configuration files, which lets you keep accounts in one file, volumes in another and global settings in a third. Separating them is particularly useful when different people maintain different parts, or when you want to keep passwords in a file with stricter permissions than the rest. In Docker, every configuration file placed in the /cfg folder is read at start-up, so splitting requires nothing more than creating additional files there.

Whatever structure you choose, keep it consistent and document it at the top of the main file, so anyone reading it later knows where each part of the configuration lives.

Finally, keep a known-good copy of your configuration somewhere safe, separate from the server. If a disk fails or an edit goes badly wrong, restoring copyparty is then a matter of reinstalling the program, copying the file back and starting the service. Because copyparty stores no other essential state, the configuration file is effectively the whole server definition.

Frequently Asked Questions

Where should I put the copyparty configuration file?

Anywhere you like, as long as you pass its path with the -c option. On Linux, /etc/copyparty.conf is a common choice; in Docker, the file goes in the folder mounted at /cfg.

What does the asterisk mean in an access list?

It means every visitor, including people who are not logged in. Use it carefully, especially with write permissions.

How do I create an upload-only folder?

Give visitors only the w permission on that volume. They can upload files but cannot see the folder’s contents.

Do I need to restart copyparty after editing the configuration?

Changes to accounts and volumes can be reloaded without a restart. Changes in the global section require a restart.

Why can a user not upload even with the w permission?

The operating-system user running copyparty probably lacks write access to the folder. Check file ownership and permissions on the host.

Conclusion

Copyparty configuration rests on three simple ideas: global options shape the whole server, accounts define who can log in, and volumes connect folders to permissions. Once you are comfortable with the permission letters and a handful of patterns, such as public archives, private folders and upload-only drop boxes, you can model almost any sharing arrangement in a short, readable file. Edit carefully, test each change and protect the file itself, and your server will do exactly what you intend.