Deployment model

  • One server process per data folder. The configuration is a SQLite database (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.)
  • The data folder holds 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.
  • Sign-ins to the web GUI and portal survive restarts. Active SFTP / FTP transfers get SHUTDOWN_GRACE_MS to finish when the server stops.

Windows service

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.

  • The 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.
  • While it is installed the desktop app does not run listeners itself. Changes to users, passwords and folders apply to new sessions straight away; restart the service (button in the same panel) after changing listeners or server settings.
  • It restarts automatically after a crash, and stops gracefully: transfers in progress get up to 25 seconds to finish.
  • The service is run by WinSW (MIT), shipped with the installer. Remove the service (same panel) before uninstalling SLightSFTP.

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

Docker

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:
  • The image runs as the unprivileged 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).
  • Passive FTP needs FTP_PASV_URL (public address) and the published range FTP_PASV_MIN–FTP_PASV_MAX.

Behind a reverse proxy

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
}
  • Set 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.
  • The proxy's X-Request-Id is kept and appears in the server's log lines.
  • When the proxy runs on the same machine, make the web GUI listen on 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.

Production checklist

  • HTTPS only. Turn on HTTPS for the web GUI and get a Let's Encrypt certificate (Security → Certificate), or put a reverse proxy in front. Over plain HTTP from another machine, the sign-in page and the dashboard show a red "not encrypted" warning.
  • With a trusted certificate (Let's Encrypt or your own CA-issued one) the server sends 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.
  • Keep the admin GUI off the internet where you can: reach it over a VPN, behind a reverse proxy with its own sign-in, or limit it to 127.0.0.1. Publish only the SFTP / FTPS ports and the portal.
  • Two-factor sign-in, or single sign-on with your provider's MFA, for every administrator. Give read-only roles to people who only need to look.
  • SFTP: keep SSH algorithms on Modern. Prefer SSH keys over passwords for partners.
  • Scheduled, passphrase-protected backups to another disk or machine. Test a restore once.
  • Email alerts for a failed listener, a failed backup and a failed certificate renewal.
  • Update promptly: watch the GitHub releases for security fixes.

Upgrades

  • Read the release notes, then replace the image or installer and restart.
  • Before a new version changes the database it saves a copy as config.db.v<old schema>-<time>.bak (newest three kept).
  • To roll back: stop the server, reinstall the previous version, rename that copy to config.db and start. An older version refuses to open a newer database rather than damaging it.
  • Verify downloads before installing: SHA256SUMS, gh attestation verify, cosign verify for the image (see the release guide).

Backup and restore

  • Turn on Security → Backup & Restore → Scheduled backups, set a passphrase, and point the folder at another disk or a synced location. Each bundle holds the configuration, host key, TLS certificate and master key.
  • Back up the shared folders themselves separately: SLightSFTP backs up its configuration, not users' files.
  • Restore from the GUI or POST /api/backup/restore with { bundle, passphrase }; the listeners restart and current sign-ins are kept.
  • Test a restore on a spare machine now and then.
  • If you set SLIGHTSFTP_MASTER_KEY, store it in your secret manager: it is not in the backups, and stored credentials cannot be read without it.

Monitoring

# 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"]
  • Alert on 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).
  • Forward the activity log to your SIEM with syslog (Security → Audit export) or webhooks.
  • Logs: LOG_FORMAT=json, LOG_LEVEL=http for one line per web request.

Hardening checklist

  • Choose a strong admin password (forced on first sign-in) and enable two-factor sign-in for every GUI user.
  • Give automation read-only GUI users and expiring API tokens.
  • Web GUI over HTTPS only; keep the admin GUI off the public internet where possible.
  • Keep Protocol Security on Modern SSH algorithms and TLS 1.2+; prefer SFTP or FTPS (required) over plain FTP.
  • Keep brute-force protection on; use per-user IP allow-lists for partners with fixed addresses.
  • Map users to the narrowest folders and permissions they need; set quotas.
  • Do not mount folders that contain symlinks to sensitive places: links that lead outside a user's folders are refused, but keep the shared tree clean anyway.
  • Encrypt backups with a passphrase and keep secret.key as private as config.db.
  • Subscribe to releases (GitHub Watch → Releases) and upgrade promptly; report vulnerabilities privately (see SECURITY.md).