Skip to main content
copyparty supports multiple authentication methods to suit different clients and use cases.

Authentication Methods

Authentication is attempted in the following order:
  1. URL Parameter (?pw=)
  2. HTTP Header (PW:)
  3. Basic Auth (Authorization: Basic)
  4. Cookies (cppwd or cppws)
The first non-empty authentication method is used.

URL Parameter Authentication

Include password in the URL:

With Username

If server has --usernames enabled:
string
Authentication credentials. Format:
  • password - Password only (default)
  • username:password - If --usernames is enabled

Security Notes

  • URL parameters appear in server logs and browser history
  • Can be disabled server-side with --pw-urlp=A
  • Only use over HTTPS or on trusted networks

Configuration

Server can rename or disable URL parameter authentication:

HTTP Header Authentication

Use the PW header for authentication:

With Username

string
Authentication credentials in password or username:password format

Custom Header Name

Server can rename or disable the PW header:
Then use:

Basic Authentication

Standard HTTP Basic Auth:
Or manually:
string
Format: Basic base64(username:password)

Disable Basic Auth

After successful login via web interface, cookies are set:
  • HTTP: cppwd=hashed-password
  • HTTPS: cppws=hashed-password
Format:
  • cppwd=hash for HTTP connections
  • cppws=hash for HTTPS connections
Cookie values are hashed passwords, not plaintext. Obtain them from browser after login.

Account Configuration

Define accounts in server config:

Command Line

Config File

Permissions

Accounts can have different permissions per volume:

Example: Volume Permissions

Authentication Examples

Upload with Password

Download with Basic Auth

Search with Header Auth

List Files with URL Auth

Security Features

Failed Login Bans

Default ban policy (configurable with --ban-pw):
  • 9 failed attempts within 1 hour
  • Results in 24 hour ban

Password Hashing

Passwords can be hashed in config files:
Output:
Use in config:
Hashed passwords use Argon2 or bcrypt. See Password Hashing for details.

IP-Based Authentication

Auto-login from specific IP ranges:

Restrict Users to IP Ranges

Limit user access by IP:

Authentication Headers in Responses

When authentication fails:
Client should retry with credentials.

Logout

Logout (clear cookies):
string
default:"x"
Set to x to logout and clear authentication cookies

Multi-Account Groups

Create groups of users:

Built-in Groups

  • @acct - All logged-in users
  • * - Everyone (including anonymous)

Exclude from Group

Identity Providers

Replace password auth with OAuth/OIDC:
See Identity Providers for configuration.

Best Practices

  • Use HTTPS for all authentication in production
  • Prefer header or basic auth over URL parameters
  • Use strong passwords or password hashing
  • Configure IP restrictions for sensitive accounts
  • Enable --usernames if multiple users need same password
  • Use groups for easier permission management
  • Don’t share URLs containing ?pw= parameter
  • Don’t log passwords in client applications
  • Implement retry delays for failed authentications
  • Monitor server logs for authentication failures

Troubleshooting

Authentication Not Working

  1. Check if auth method is enabled:
    • URL param: Not disabled with --pw-urlp=A
    • Header: Not disabled with --pw-hdr=A
    • Basic: Not disabled with --no-bauth
  2. Verify username format:
    • Without --usernames: Use ?pw=password
    • With --usernames: Use ?pw=username:password
  3. Check account permissions:
    • User has appropriate permission (r, w, etc.)
    • Path is within allowed volumes

Failed Login Bans

If you’re banned:
Check current ban settings:

Advanced Configuration

User-Changeable Passwords

Allow users to change their own passwords:
Users can then change passwords via web interface.

Header-Based Authentication

Authenticate via reverse proxy headers:
Proxy must set these headers.

Reference

  • Authentication is evaluated per-request
  • No sessions (except cookies from web UI)
  • Permissions are per-volume
  • First matching auth method is used
  • Failed auth triggers ban counter