Skip to main content

Overview

Security is critical when running a file server accessible over the network. This guide covers authentication, HTTPS setup, permission models, and hardening techniques.
Running copyparty with default settings gives everyone read-write access. Always configure proper authentication and permissions before exposing to the internet.

Authentication

Basic Authentication

Define user accounts and passwords:
Never use weak passwords or default credentials in production.

Password Hashing

Store passwords as hashes instead of plaintext:
1

Enable password hashing

2

Generate hashed passwords

Start copyparty with plaintext passwords - it will print hashed versions:
Output:
3

Update configuration

Replace plaintext passwords with hashes:
4

Interactive hashing (optional)

Use --ah-cli to hash passwords interactively:
This never writes plaintext passwords to disk.
Default Argon2 settings use ~256 MiB RAM and take ~0.4 seconds per password on a decent laptop.
Important for username mode:
When hashing passwords with --usernames enabled, provide as username:password:

Permission Model

Copyparty uses fine-grained permissions: Shortcuts:
  • A = rwmda. (all permissions)

Example Permission Configurations

Public Read, Private Write

Multiple User Tiers

Upload-Only Folder

Write-Only with Filekeys

Users can upload but not browse. They receive unique URLs to access their uploads.

IP-Based Authentication

Auto-login users from specific IP ranges:
Restrict users to specific IPs:

HTTPS/TLS Configuration

Let nginx, Apache, or Caddy handle HTTPS:
See Reverse Proxy Setup for details.

Native HTTPS with cfssl

1

Install cfssl

2

Start copyparty

Copyparty will auto-generate certificates:
Certificates are saved to --crt-dir for distribution.
3

Install CA certificate

Distribute ca.pem to all client devices and install as trusted CA.
This is a self-signed certificate. For public deployments, use Let’s Encrypt via reverse proxy.

Hardening

Safety Profiles

Copyparty provides security shortcuts:

Profile: -s (Safe)

Enables:
  • --no-thumb - Disable thumbnails (no FFmpeg/Pillow on uploads)
  • --no-mtag-ff - Use Mutagen instead of FFmpeg for tags
  • --dotpart - Hide uploads while incomplete
  • --no-robots - Tell search engines to stay away
  • --force-js - Require JavaScript (harder for crawlers)

Profile: -ss (Safer)

All of -s plus:
  • --unpost 0 - Disable upload undo
  • --no-del - Disable delete
  • --no-mv - Disable move/rename
  • --hardlink - Use hardlinks for deduplication
  • --vague-403 - Return 404 instead of 403
  • -nih - Remove hostname from listings

Profile: -sss (Safest)

All of -ss plus:
  • --no-dav - Disable WebDAV
  • --no-logues - Disable prologues/epilogues
  • --no-readme - Disable README rendering
  • -lo cpp-%Y-%m%d-%H%M%S.txt.xz - Log to compressed files
  • -ls **,*,ln,p,r - Scan for dangerous symlinks on startup

Per-Volume Hardening

Disable HTML rendering for untrusted uploads:
This prevents XSS attacks from uploaded files.

Filekeys (Prevent Bruteforcing)

Require secret keys to access files:
Users with r permission see URLs like:
Users with g permission need the key to access the file. Dirkeys (directory access keys):

CORS Configuration

By default, non-GET/HEAD requests must:
  • Have no Origin header, OR
  • Have Origin matching the server domain, OR
  • Include PW header with password
Customize CORS:

Rate Limiting and Bans

Default settings:
  • Password attempts: 9 failures in 1 hour = 24 hour ban
  • Configure with --ban-pw
View active bans in the control panel (requires admin permission).

Additional Security Measures

Restrict Access by IP

Listen only on localhost (for reverse proxy):
Or specific interface:

Disable Unnecessary Features

Hide Server Information

Protect Against XSS

Systemd Security Hardening

The example systemd service includes hardening:
See Systemd Service for details.

Docker Security

Run as non-root user:
Limit resources:

Chroot Isolation

Run copyparty in a chroot for maximum isolation:
See Systemd Service - Chroot Setup.

Monitoring and Auditing

Enable Logging

Compressed logs:

Admin Features

Users with a permission can:
  • View uploader IPs and timestamps
  • Reload configuration
  • View active bans
  • Monitor upload progress

Prometheus Metrics

Enable monitoring endpoint:
Only accessible by admin users. See README - Prometheus for details.

Common Security Scenarios

Public File Sharing with Upload

Private Cloud Storage

Read-Only Archive

Authenticated Download Server

Security Checklist

1

Authentication

  • Set strong passwords
  • Enable password hashing with --ah-alg argon2
  • Disable default accounts
  • Use groups for permission management
2

HTTPS

  • Enable HTTPS (reverse proxy or cfssl)
  • Use valid certificates (Let’s Encrypt)
  • Disable HTTP if possible
  • Configure proper headers (X-Forwarded-For, etc.)
3

Permissions

  • Follow principle of least privilege
  • Review all volume permissions
  • Enable nohtml for user uploads
  • Use filekeys for sensitive content
4

Hardening

  • Use safety profile (-s, -ss, or -sss)
  • Disable unused features (FTP, WebDAV, etc.)
  • Enable systemd security options
  • Run as dedicated user (not root)
  • Consider chroot isolation
5

Monitoring

  • Enable logging
  • Set up log rotation
  • Monitor for suspicious activity
  • Review bans and failed login attempts
6

Network

  • Configure firewall rules
  • Use reverse proxy for internet exposure
  • Implement rate limiting
  • Restrict by IP where appropriate

Security Updates

Stay informed about security issues:
Always update to the latest version to ensure you have the latest security patches.

Next Steps

Systemd Service

Configure systemd with security hardening

Reverse Proxy

Set up nginx or Apache

Docker

Container security best practices