Overview
Security is critical when running a file server accessible over the network. This guide covers authentication, HTTPS setup, permission models, and hardening techniques.Authentication
Basic Authentication
Define user accounts and passwords:Password Hashing
Store passwords as hashes instead of plaintext:Generate hashed passwords
Start copyparty with plaintext passwords - it will print hashed versions:Output:
Default Argon2 settings use ~256 MiB RAM and take ~0.4 seconds per password on a decent laptop.
--usernames enabled, provide as username:password:
Permission Model
Copyparty uses fine-grained permissions:| Permission | Description |
|---|---|
r | Read: browse folders, download files, zip/tar |
w | Write: upload files, move files into folder |
m | Move: move files/folders from this folder |
d | Delete: delete files/folders |
a | Admin: see upload times, IPs, reload config |
. | Dots: see dotfiles in listings |
g | Get: download files only (no browsing) |
G | Upget: upload + get filekeys |
h | HTML: serve index.html, hide listings |
A=rwmda.(all permissions)
Example Permission Configurations
Public Read, Private Write
Multiple User Tiers
Upload-Only Folder
Write-Only with Filekeys
IP-Based Authentication
Auto-login users from specific IP ranges:HTTPS/TLS Configuration
Using a Reverse Proxy (Recommended)
Let nginx, Apache, or Caddy handle HTTPS:Native HTTPS with cfssl
Start copyparty
Copyparty will auto-generate certificates:Certificates are saved to
--crt-dir for distribution.Hardening
Safety Profiles
Copyparty provides security shortcuts:Profile: -s (Safe)
--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:Filekeys (Prevent Bruteforcing)
Require secret keys to access files:r permission see URLs like:
g permission need the key to access the file.
Dirkeys (directory access keys):
CORS Configuration
By default, non-GET/HEAD requests must:- Have no
Originheader, OR - Have
Originmatching the server domain, OR - Include
PWheader with password
Rate Limiting and Bans
Default settings:- Password attempts: 9 failures in 1 hour = 24 hour ban
- Configure with
--ban-pw
Additional Security Measures
Restrict Access by IP
Listen only on localhost (for reverse proxy):Disable Unnecessary Features
Hide Server Information
Protect Against XSS
Systemd Security Hardening
The example systemd service includes hardening:Docker Security
Run as non-root user:Chroot Isolation
Run copyparty in a chroot for maximum isolation:Monitoring and Auditing
Enable Logging
Admin Features
Users witha permission can:
- View uploader IPs and timestamps
- Reload configuration
- View active bans
- Monitor upload progress
Prometheus Metrics
Enable monitoring endpoint:Common Security Scenarios
Public File Sharing with Upload
Private Cloud Storage
Read-Only Archive
Authenticated Download Server
Security Checklist
Authentication
- Set strong passwords
- Enable password hashing with
--ah-alg argon2 - Disable default accounts
- Use groups for permission management
HTTPS
- Enable HTTPS (reverse proxy or cfssl)
- Use valid certificates (Let’s Encrypt)
- Disable HTTP if possible
- Configure proper headers (
X-Forwarded-For, etc.)
Permissions
- Follow principle of least privilege
- Review all volume permissions
- Enable
nohtmlfor user uploads - Use filekeys for sensitive content
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
Monitoring
- Enable logging
- Set up log rotation
- Monitor for suspicious activity
- Review bans and failed login attempts
Security Updates
Stay informed about security issues:- Join the Discord server for announcements
- Watch the GitHub repository
- Check releases regularly
Next Steps
Systemd Service
Configure systemd with security hardening
Reverse Proxy
Set up nginx or Apache
Docker
Container security best practices