Prerequisites
Common
- Node.js 18+ LTS
- npm 9+ (bundled with Node)
- Git (optional, to clone repo)
Windows
- PowerShell 5.1+ or PowerShell 7
- Build tools:
windows-build-toolsif native deps are added later - MSI packaging uses existing scripts in repo
Linux
- Debian/Ubuntu:
sudo apt install build-essential - CentOS/RHEL:
sudo yum groupinstall \"Development Tools\" - Systemd available for service mode
macOS
- Xcode Command Line Tools:
xcode-select --install - Homebrew (optional) for Node install
Build (TypeScript)
Install deps
npm install
Compile TS → JS
npm run build # runs tsc using tsconfig.json
Lint/Tests
# (if configured) npm test
Integration tests may require SFTP/FTP listeners; run on a dev machine.
Run (Cross-Platform)
Desktop GUI (Electron)
# Windows/macOS/Linux (X11/Wayland) npm run start:desktop
Runs Electron app with embedded SFTP/FTP listeners.
Web Server Mode
# headless-friendly npm run start:web # or built output node dist/web-only.js
Serve the web GUI + API. Point browser to http://localhost:3000 (or your port).
Server Only
node dist/server-only.js
Runs listeners without GUI; manage via API/Web when paired with start:web.
Package
Windows (MSI)
- Uses existing build scripts in
release/ - Run packaging script (documented in repo)
- Outputs MSI in
release/ordist/
Linux (AppImage/zip)
- Package options: electron-builder AppImage
- Or ship as zipped Node bundle + systemd unit
- Example:
npm run build && tar -czf slightsftp-linux.tar.gz dist
macOS (.app/.dmg)
- Use electron-builder targets:
--mac dmg - Requires Apple signing for distribution
- Local dev: unsigned build works with gatekeeper override
Service / Daemon Setup
Windows (NSSM example)
# install nssm first nssm install SLightSFTP "C:\\Program Files\\nodejs\\node.exe" dist/web-only.js nssm set SLightSFTP AppDirectory C:\\path\\to\\slightsftp nssm set SLightSFTP Start SERVICE_AUTO_START
Use a service account with least privilege and open needed ports.
Linux (systemd)
[Unit] Description=SLightSFTP Web After=network.target [Service] WorkingDirectory=/opt/slightsftp ExecStart=/usr/bin/node dist/web-only.js Restart=on-failure User=slightsftp Group=slightsftp [Install] WantedBy=multi-user.target
Enable/start: sudo systemctl enable --now slightsftp.service.
macOS (launchd)
Label com.slighsftp.web ProgramArguments /usr/local/bin/node /Users/you/slightsftp/dist/web-only.js RunAtLoad KeepAlive WorkingDirectory /Users/you/slightsftp StandardOutPath /tmp/slightsftp.out.log StandardErrorPath /tmp/slightsftp.err.log
Load: launchctl load ~/Library/LaunchAgents/com.slighsftp.web.plist