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
PlikDomain""Public webapp URL (e.g., https://plik.example.com). Domain only — no path. Used for OAuth redirects and CORS. Does not restrict downloads on its own — set DownloadDomain for that
DownloadDomain""Enforce download domain (e.g., https://dl.plik.example.com). Domain only — no path. UI/API blocking and CORS require PlikDomain too
DownloadDomainAlias[]Additional accepted download hosts
AssumeHTTPSfalseEnable HSTS + Secure cookies (auto-enabled from SslEnabled or HTTPS PlikDomain)
SessionTimeout365dAuthentication session duration
AbuseContact""Abuse contact email shown in footer. settings.json "footer" takes precedence when set
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)
EnableArchiveCompressiontrueEnable zip compression for archive downloads. Set to false to use zip.Store (no compression) to prevent CPU exhaustion on public instances. See Security — Archive Compression

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
StreamTimeoutStr5mMax wait for a streaming download to start before releasing the upload goroutine (0 = no timeout)
FeaturePasswordenabledPassword-protected uploads
FeatureCommentsenabledMarkdown comments on uploads
FeatureSetTTLenabledCustom TTL setting
FeatureExtendTTLdisabledExtend TTL on each download
FeatureClientsenabledShow CLI download button in UI (enable/disable only)
FeatureApiTokensenabledAPI token creation, usage via X-PlikToken header, and CLI auth flow. When disabled + FeatureAuthentication=forced, FeatureClients is also auto-disabled (enable/disable only)
FeatureGithubenabledShow source code link in UI
FeatureTextenabledText upload dialog
FeatureLocalLoginenabledLocal login form (enable/disable only)
FeatureDeleteAccountenabledAllow users to delete their own account (enable/disable only)

Full Example

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

Released under the MIT License.