Self-Hosted

Self-hosted server parameters

Every flag and environment variable the self-hosted Simple FTP Server accepts, with defaults and the options that matter most.
Updated August 27, 2026

The server accepts configuration as command-line flags, and every flag can also be set as an environment variable of the same name in uppercase - -license is LICENSE, -passiveports21 is PASSIVEPORTS21, and so on. Environment variables are the natural fit for Docker.

Run ./sfs-server --help for the list your binary supports.

Required

FlagEnvironmentDescription
-licenseLICENSEYour DocEvent.io license key
-regionREGIONDocEvent region your configuration lives in: us-east-1, eu-west-1 or ap-southeast-2

Ports

FlagEnvironmentDefaultDescription
-port21PORT212021FTP + explicit FTPS port
-port22PORT222022SFTP/SCP port - accepts a comma-separated list to listen on several ports
-port990PORT9909990Implicit FTPS port
-passiveports21PASSIVEPORTS212030-2039Passive data-port range for FTP/explicit FTPS
-passiveports990PASSIVEPORTS9902040-2049Passive data-port range for implicit FTPS

The two passive ranges belong to two separate FTP servers inside the process - they must not overlap, or transfers will fail intermittently.

Networking

FlagEnvironmentDefaultDescription
-publicipPUBLICIPThe public IP sent to FTP clients for passive connections - required for passive FTP/FTPS to work. Must be an address your clients can route to.

TLS and SSH identity

FlagEnvironmentDescription
-tlscertTLSCERTTLS certificate file for FTPS (file path or s3 url)
-tlskeyTLSKEYTLS certificate key file (file path or s3 url)
-sshkeyfileSSHKEYFILESSH host private key file, e.g. id_rsa
-sshkeypassphraseSSHKEYPASSPHRASEPassphrase if the key file is encrypted

Messages and shutdown

FlagEnvironmentDefaultDescription
-welcomeWELCOMEDocEvent.io Simple File ServerFTP welcome message
-bannerBANNERDocEvent.io Simple File ServerSSH banner message
-shutdownwindowSHUTDOWNWINDOW1Seconds to let connections finish after a stop signal before forcing shutdown
-closeportswindowCLOSEPORTSWINDOW1Seconds to keep listening ports open while shutting down

Overload protection

FlagEnvironmentDefaultDescription
-maxconcurrenthandshakesMAXCONCURRENTHANDSHAKES256Maximum in-progress pre-login connections per listener; excess connections wait in the kernel backlog
-handshaketimeoutHANDSHAKETIMEOUT60Seconds a connection may spend before completing login (0 disables); drops stalled/slowloris connections

Production mode

EnvironmentDefaultDescription
PRODUCTION0Set to 1 for production mode

Production mode changes two things:

  • Logs are emitted as JSON for your log pipeline - see Server logging
  • The server requires your own SSH key and TLS certificate instead of generated defaults

Notable options explained

-publicip

Passive FTP works by the server telling the client "connect to me at this address and port" - the server cannot know its own public address behind NAT, so you must tell it. If Alice connects to your server at 52.1.1.2, then -publicip 52.1.1.2 is what makes her passive data connections land on your server. Without it, passive transfers fail after login. See Load balancing for what to set when a load balancer is in front.