Skip to content

Configuration

Plik is configured via a TOML file (plikd.cfg) and optional environment variable overrides.

Config File Locations

The server looks for configuration in this order:

  1. --config flag
  2. PLIKD_CONFIG environment variable
  3. ./plikd.cfg (current directory)
  4. /etc/plikd.cfg

Environment Variable Override

Any config parameter can be set via environment variable using PLIKD_ prefix with SCREAMING_SNAKE_CASE:

bash
PLIKD_DEBUG_REQUESTS=true ./plikd
PLIKD_LISTEN_PORT=9090 ./plikd

Arrays and maps must be provided in JSON format. Arrays are overridden, maps are merged:

bash
PLIKD_DATA_BACKEND_CONFIG='{"Directory":"/var/files"}' ./plikd

Server Settings

ParameterDefaultDescription
ListenPort8080HTTP server port
ListenAddress0.0.0.0HTTP server bind address
MetricsPort0Prometheus metrics port (0 = disabled)
Path""HTTP root path prefix
SslEnabledfalseEnable TLS
SslCert / SslKeyTLS certificate and key paths
TlsVersiontlsv10Minimum TLS version
NoWebInterfacefalseDisable web UI
DownloadDomain""Enforce download domain (e.g., https://dl.plik.example.com)
DownloadDomainAlias[]Additional accepted domains
EnhancedWebSecurityfalseExtra security headers + secure cookies
SessionTimeout365dAuthentication session duration
AbuseContact""Abuse contact email (displayed in UI)
WebappDirectory../webapp/distWeb UI static files directory
ClientsDirectory../clientsCLI client binaries directory
ChangelogDirectory../changelogRelease changelog directory
SourceIpHeader""Header for real IP behind proxy (e.g., X-Forwarded-For)
UploadWhitelist[]Restrict uploads to IP ranges (CIDR)

Limits

ParameterDefaultDescription
MaxFileSizeStr10GBMaximum file size (or "unlimited")
MaxUserSizeStrunlimitedDefault per-user storage limit
MaxFilePerUpload1000Max files per upload
DefaultTTLStr30dDefault time-to-live
MaxTTLStr30dMaximum TTL (0 = no limit)

Feature Flags

Features can be set to one of four states:

ValueBehavior
disabledFeature always off
enabledFeature available, opt-in
defaultFeature available, opt-out (on by default)
forcedFeature always on
FlagDefaultDescription
FeatureAuthenticationdisabledUser authentication (forced = no anonymous uploads)
FeatureOneShotenabledFiles deleted after first download
FeatureRemovableenabledAnyone can delete files
FeatureStreamenabledDirect uploader-to-downloader streaming
FeaturePasswordenabledPassword-protected uploads
FeatureCommentsenabledMarkdown comments on uploads
FeatureSetTTLenabledCustom TTL setting
FeatureExtendTTLdisabledExtend TTL on each download
FeatureClientsenabledShow CLI download button in UI
FeatureGithubenabledShow source code link in UI
FeatureTextenabledText upload dialog
DisableLocalLoginfalseHide login/password form

Full Example

See the default plikd.cfg for a fully commented configuration file.

Released under the MIT License.