Deploy, upgrade, back up, monitor and harden a SLightSFTP server
config.db, with config.db-wal / -shm while running), so two
servers must never run listeners from the same folder. Scale out by running separate servers.
(The desktop app and its own Windows service share the folder safely: while the service is
installed, the app only edits the configuration and leaves the listeners to the service.)config.db, secret.key (master key for stored secrets),
the SFTP host key, the TLS certificate, backups/, logs/ and the recycle bin.
In Docker it is /data.SHUTDOWN_GRACE_MS to finish when the server stops.The desktop app stops its servers when you sign out of Windows. To keep SLightSFTP running in the background, starting with Windows, open Listeners → Windows service in the installed app, choose the web GUI port and click Install and start service.
SLightSFTP Server in services.msc) runs the same listeners,
users and settings as the desktop app, plus the web GUI on the chosen port, and scheduled
backups. It uses the app's config folder and logs to its logs folder.On Linux, run the headless server under systemd, or use the Docker image below.
[Unit]
Description=SLightSFTP server
After=network-online.target
[Service]
# from a checkout: npm ci && npm run build
ExecStart=/usr/bin/node /opt/slightsftp/dist/web-only.js
WorkingDirectory=/var/lib/slightsftp
Environment=WEB_PORT=3000 SHUTDOWN_GRACE_MS=20000
User=slightsftp
Restart=on-failure
TimeoutStopSec=30
[Install]
WantedBy=multi-user.target
services:
slightsftp:
image: ghcr.io/slightlabs/slightsftp:1 # pin a major version; see "Upgrades"
restart: unless-stopped
init: true
stop_grace_period: 30s
environment:
WEB_HTTPS: "true"
SHUTDOWN_GRACE_MS: "20000"
TRUST_PROXY: "172.16.0.0/12" # only behind a reverse proxy
LOG_FORMAT: json # for log collectors
LOG_FILES: "false" # stdout only
# SLIGHTSFTP_MASTER_KEY: from a secret store, instead of /data/secret.key
ports:
- "2222:2222"
- "127.0.0.1:3000:3000" # admin GUI only via the proxy
volumes:
- slightsftp-data:/data
- /srv/files:/files
- /mnt/backup/slightsftp:/backups # set the backup folder to /backups
volumes:
slightsftp-data:
node user; listen on ports above 1024 and
map them (e.g. 22:2222).HEALTHCHECK probes /readyz: the container turns unhealthy when an enabled
listener cannot start (port in use, bad certificate).FTP_PASV_URL (public address) and the published range
FTP_PASV_MIN–FTP_PASV_MAX.Put the web GUI and file portal behind nginx, Caddy or Traefik for a public certificate. SFTP and FTP are not HTTP; publish them directly. WebSockets are used for live updates.
# nginx
location / {
proxy_pass https://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Request-Id $request_id;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 0; # large portal uploads
}
TRUST_PROXY (or the trustProxy setting) to the proxy's address or range, so
brute-force bans and IP allow-lists see real client addresses. Without it,
X-Forwarded-For is ignored.X-Request-Id is kept and appears in the server's log lines.127.0.0.1 only
(Listeners → Web GUI Server → Edit → Listen on address, or WEB_HOST=127.0.0.1
for the headless server), so nobody can go around the proxy. Not inside Docker: the container
needs every address; publish the port as -p 127.0.0.1:3000:3000 instead.Strict-Transport-Security, so browsers refuse plain HTTP for it. The self-signed certificate
doesn't send it, so browsers still offer to continue past their warning.127.0.0.1. Publish only the SFTP / FTPS ports and the portal.config.db.v<old schema>-<time>.bak (newest three kept).config.db and start. An older version refuses to open a newer database rather than
damaging it.SHA256SUMS, gh attestation verify,
cosign verify for the image (see the release guide).POST /api/backup/restore with { bundle, passphrase }; the
listeners restart and current sign-ins are kept.SLIGHTSFTP_MASTER_KEY, store it in your secret manager: it is not in the
backups, and stored credentials cannot be read without it.# prometheus.yml
scrape_configs:
- job_name: slightsftp
scheme: https
tls_config: { insecure_skip_verify: true } # self-signed certificate
authorization:
credentials: sst_... # API token of a read-only GUI user
static_configs:
- targets: ["sftp.example.com:3000"]
slightsftp_listener_up == 0, a rising
rate(slightsftp_logins_total{result="failure"}[5m]), and slightsftp_ip_bans./healthz for liveness, /readyz for readiness (load balancers, Kubernetes).LOG_FORMAT=json, LOG_LEVEL=http for one line per web request.secret.key as private as config.db.SECURITY.md).