Running copyparty as a systemd service ensures it starts automatically on boot and can be managed using standard systemd commands. This guide covers installation and configuration of copyparty as both a system-wide and user service.
Or create /etc/systemd/system/copyparty.service with the following content:
[Unit]Description=copyparty file server[Service]Type=notifySyslogIdentifier=copypartyEnvironment=PYTHONUNBUFFERED=xExecReload=/bin/kill -s USR1 $MAINPIDPermissionsStartOnly=true# User to run as + where the TLS certificate is (if any)User=copypartyGroup=copypartyWorkingDirectory=/var/lib/copypartyEnvironment=XDG_CONFIG_HOME=/var/lib/copyparty/.config# OPTIONAL: allow copyparty to listen on low ports (80/443)AmbientCapabilities=CAP_NET_BIND_SERVICE# Security hardeningMemoryMax=50%MemorySwapMax=50%ProtectClock=trueProtectControlGroups=trueProtectHostname=trueProtectKernelLogs=trueProtectKernelModules=trueProtectKernelTunables=trueProtectProc=invisibleRemoveIPC=trueRestrictNamespaces=trueRestrictRealtime=trueRestrictSUIDSGID=true# Create logs directoryLogsDirectory=copyparty# Start copypartyExecStart=/usr/bin/python3 /usr/local/bin/copyparty-sfx.py -c /etc/copyparty.conf# If installed from package manager, use:# ExecStart=/usr/bin/copyparty -c /etc/copyparty.conf[Install]WantedBy=multi-user.target
5
Create configuration file
Create /etc/copyparty.conf with your settings:
[global] e2dsa # enable file indexing e2ts # enable multimedia indexing ansi # colors in log messages # Log to file instead of journalctl q, lo: $LOGS_DIRECTORY/%Y-%m%d.log # Uncomment to listen on ports 80/443 (requires CAP_NET_BIND_SERVICE) # p: 80,443,3923[accounts] admin: your_password_here[/] /var/lib/copyparty-jail accs: r: * rwmda: admin flags: grid
The default configuration provides read access to everyone and full access to the admin user. Customize permissions according to your security requirements.
Create ~/.config/copyparty/copyparty.conf with your settings.
3
Enable user service
systemctl --user daemon-reloadsystemctl --user enable --now copyparty# Enable linger to start service on boot without loginloginctl enable-linger $USER