Skip to main content
Server configuration for copyparty including network settings, SSL/TLS, and daemon options.

Configuration Files

Copyparty supports configuration files in addition to command-line arguments. Config files are recommended for complex setups.

Using Config Files

# Specify config file with -c
python copyparty-sfx.py -c foobar.conf

# Or use environment variable
PRTY_CONFIG=foobar.conf python copyparty-sfx.py
The config file syntax is not actually YAML but looks similar. Inline comments are OK if there are 2 spaces before the # sign.

Network Configuration

Ports and Interfaces

-p, --port
number
default:"3923"
Port(s) to listen on. Can specify multiple ports.
-p 3923         # single port
-p 8080,3939    # multiple ports
-i, --ip
string
default:"0.0.0.0"
Network interface to bind to.
-i 0.0.0.0      # all interfaces (default)
-i 127.0.0.1    # localhost only
-i 192.168.1.5  # specific interface
--https
string
Enable HTTPS with certificate.
--https 3923,/path/to/cert.pem,/path/to/key.pem

Unix Socket

Recommended for reverse-proxy setups (better performance and security).
[global]
  i: /dev/shm/party.sock  # listen on unix socket
# Set permissions on the socket
chmod 0770 /dev/shm/party.sock

File Indexing

Enable database features for searching, upload tracking, and metadata.
-e2d
boolean
Enable database; makes files searchable and enables upload-undo
-e2ds
boolean
Scan writable folders for new files on startup (also sets -e2d)
-e2dsa
boolean
Scan all folders for new files on startup (also sets -e2d)
-e2t
boolean
Enable multimedia indexing; makes it possible to search for tags
-e2ts
boolean
Scan existing files for tags on startup (also sets -e2t)
-e2tsr
boolean
Delete all metadata from DB for full rescan (also sets -e2ts)
[global]
  e2dsa  # enable general file indexing
  e2ts   # enable audio metadata indexing (needs FFprobe or Mutagen)

Database Location

By default, a .hist folder is created inside each volume for the filesystem index, thumbnails, audio transcodes, and markdown history.
--hist
string
Move database and thumbnails to another location (global or per-volume)
[global]
  hist: /tmp/cdb  # global setting

[/music]
  /mnt/music
  flags:
    hist: /tmp/music-cache  # per-volume setting
--dbpath
string
Move only the database (keep thumbnails in volume)
[/music]
  /mnt/music
  flags:
    dbpath: /tmp/music-db
If the up2k.db is on a network share (samba/NFS), you may get unpredictable behavior if the share disconnects. Use --hist or --dbpath to place it on local storage.

Zeroconf / mDNS / SSDP

Announce services on the local network for easy discovery.
-z, --zeroconf
boolean
Enable zeroconf (mDNS + SSDP)
--mdns
boolean
Enable mDNS only (Bonjour/Avahi)
--ssdp
boolean
Enable SSDP only (Windows Explorer)
[global]
  z     # enable both mDNS and SSDP
  qr    # show QR code on startup

QR Code

Print a QR code for quick access from mobile devices.
[global]
  qr  # print QR code on startup

Protocol Servers

FTP Server

--ftp
number
Enable FTP server on specified port
--ftp 3921
--ftps
number
Enable FTPS (FTP over SSL) on specified port
--ftps 3990

SFTP Server

--sftp
number
Enable SFTP server (goes ~700 MiB/s, slower than WebDAV and FTP)
--sftp 3922

WebDAV Server

--no-dav
boolean
Disable WebDAV support (enabled by default)
--dav-auth
boolean
Ask WebDAV clients to login for all folders (required for some clients)

TFTP Server

--tftp
number
Enable TFTP server (read/write) on specified port
--tftp 3969

SMB Server

--smb
number
Enable SMB/CIFS server (unsafe, slow, not recommended for WAN)
--smb 3945
SMB server is unsafe and slow. Not recommended for internet-facing deployments.

Performance Options

-j
number
default:"0"
Enable multiprocessing (actual multithreading)
-j0  # disabled (default)
-j2  # 2 worker processes
-j4  # 4 worker processes
Usually NOT recommended. Can reduce performance in most cases despite lower latency.
-q
boolean
Disable logging (improves performance)
--no-hash
regex
Skip hashing files matching pattern
[global]
  no-hash: \.iso$  # skip hashing *.iso files
--no-dirsz
boolean
Show folder inode size instead of total contents size (~30% faster listings)

Firewall Ports

Example firewall configuration for all copyparty features:
firewall-cmd --permanent --add-port={80,443,3921,3922,3923,3945,3990}/tcp
firewall-cmd --permanent --add-port=12000-12099/tcp  # passive FTP
firewall-cmd --permanent --add-port={69,1900,3969,5353}/udp
firewall-cmd --reload
Port mapping:
  • 69: TFTP
  • 80/443: HTTP/HTTPS
  • 1900: SSDP
  • 3921: FTP
  • 3922: SFTP
  • 3923: HTTP/HTTPS (default)
  • 3945: SMB
  • 3969: TFTP
  • 3990: FTPS
  • 5353: mDNS
  • 12000-12099: Passive FTP

Systemd Service

Run copyparty as a systemd service:
systemd/copyparty.service
[Unit]
Description=copyparty file server
After=network.target

[Service]
Type=simple
User=copyparty
Group=copyparty
ExecStart=/usr/bin/copyparty -c /etc/copyparty/config.conf
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target
# Enable and start service
sudo systemctl enable copyparty
sudo systemctl start copyparty

# Reload config without restart
sudo systemctl reload copyparty

Reverse Proxy

See reverse-proxy documentation for nginx/Apache configurations.
When running behind a reverse-proxy, listen on a unix socket for better performance and security.

Security Hardening

1

Set reverse proxy mode

Set --rproxy 0 if copyparty is directly facing the internet (not through a reverse-proxy)
2

Use unix socket

When behind a reverse-proxy, listen on a unix socket for tighter access control
3

Prevent XSS

Use volflag nohtml for volumes with anonymous uploads or untrusted content
4

Disable dangerous features

Use -s safety profile to disable thumbnails and audio transcoding

Complete Example

[global]
  # Network
  i: /dev/shm/party.sock
  
  # Indexing
  e2dsa  # enable file indexing
  e2ts   # enable multimedia indexing
  
  # Features
  z      # zeroconf
  qr     # show QR code
  
  # Performance
  q      # quiet mode
  hist: /var/cache/copyparty
  
  # Protocols
  ftp: 3921
  sftp: 3922

[accounts]
  admin: secure_password_here
  guest: guest123

[/]
  /srv/files
  accs:
    r: *
    rw: admin

Build docs developers (and LLMs) love