Deploying a SFTPGo App
Introduction
SFTPGo is an open-source SFTP/FTPS/WebDAV server with a web admin UI and flexible storage backends. Deploying SFTPGo with a Dockerfile on Klutch.sh provides reproducible builds, managed secrets, and persistent storage—all configured from klutch.sh/app. Because Klutch.sh supports one port per app, this guide shows a split deployment: one app for SFTP (TCP) and an optional second app for the HTTP admin/API.
Prerequisites
- A Klutch.sh account (sign up)
- A GitHub repository containing your SFTPGo Dockerfile (GitHub is the only supported git source)
- Optional: external object storage (S3/MinIO/Azure) if you don’t want local storage
For onboarding, see the Quick Start.
Architecture and ports
- Klutch.sh allows one port per app. Use two apps (same repo/image) if you need both:
- SFTP service: TCP traffic, internal port
2022(default SFTPGo SFTP). External clients connect onexample-app.klutch.sh:8000via TCP. - Admin/API (optional): HTTP traffic, internal port
8080(web admin/API).
- SFTP service: TCP traffic, internal port
- FTPS/WebDAV ports are not exposed in this layout; use SFTP or HTTP admin/API per app.
Repository layout
sftpgo/├── Dockerfile # Must be at repo root for auto-detection└── README.mdKeep secrets out of Git; store them in Klutch.sh environment variables.
Installation (local) and starter commands
Build and run locally:
docker build -t sftpgo-local .docker run -p 2022:2022 -p 8080:8080 \ -e SFTPGO_HTTPD__BIND_PORT=8080 \ -e SFTPGO_SFTPD__BIND_PORT=2022 \ sftpgo-localDockerfile for SFTPGo (production-ready)
Place this at the repo root; Klutch.sh auto-detects Dockerfiles.
FROM drakkan/sftpgo:latest
ENV SFTPGO_SFTPD__BIND_PORT=2022ENV SFTPGO_HTTPD__BIND_PORT=8080
EXPOSE 2022 8080CMD ["/bin/sh", "/entrypoint.sh"]Notes:
- Pin to a specific tag (e.g.,
drakkan/sftpgo:v2.5.6) for stability. /entrypoint.shlaunches SFTPGo with both SFTP and HTTP listeners; deploy them as separate apps on Klutch.sh to satisfy single-port routing.
Environment variables (Klutch.sh)
Set these before deploying:
- For the SFTP app (TCP):
SFTPGO_SFTPD__BIND_PORT=2022SFTPGO_HTTPD__BIND_PORT=0(disable HTTP on this app)
- For the admin/API app (HTTP):
SFTPGO_HTTPD__BIND_PORT=8080SFTPGO_SFTPD__BIND_PORT=0(disable SFTP on this app)
- Shared options:
SFTPGO_DATA_PROVIDER__DRIVER=sqlite(default) ormysql/postgresif external DBSFTPGO_DATA_PROVIDER__NAME=/var/lib/sftpgo/sftpgo.db(sqlite path) or DB URL for other driversSFTPGO_DEFAULT_ADMIN_USERNAME=<admin>SFTPGO_DEFAULT_ADMIN_PASSWORD=<strong-password>
If deploying without the Dockerfile and relying on Nixpacks:
NIXPACKS_START_CMD=/bin/sh /entrypoint.sh
Attach persistent volumes
Add storage in Klutch.sh (path and size only):
/var/lib/sftpgo— user data, sqlite DB, and logs (required for persistence)./srv/sftpgo— user home directories (if using local storage instead of object storage).
Ensure paths are writable inside the container.
Deploy SFTPGo on Klutch.sh (split-port workflow)
- Push your repository—with the Dockerfile at the root—to GitHub.
- Create the SFTP app: choose TCP traffic, set the internal port to
2022, setSFTPGO_HTTPD__BIND_PORT=0, and attach volumes at/var/lib/sftpgo(and/srv/sftpgoif storing files locally). - Deploy the SFTP app. Clients connect via SFTP to
example-app.klutch.shon external port8000. - Create the admin/API app: choose HTTP traffic, set the internal port to
8080, setSFTPGO_SFTPD__BIND_PORT=0, and attach the same volumes if needed. - Deploy the admin/API app. Manage users and settings at
https://example-app.klutch.sh.
Sample SFTP usage
Test connectivity (replace user/host):
sftp -P 8000 user@example-app.klutch.shUpload a file:
echo "hello" > hello.txtsftp -P 8000 user@example-app.klutch.sh:/upload <<'EOF'put hello.txtEOFHealth checks and production tips
- For the admin app, use an HTTP readiness probe on
/healthz(or/if unavailable). - Keep admin credentials in Klutch.sh secrets; rotate regularly.
- Pin image versions and test upgrades in staging before production.
- Monitor storage usage on
/var/lib/sftpgoand/srv/sftpgo; resize volumes proactively or offload to object storage. - If using object storage, configure S3/MinIO/Azure env vars per SFTPGo docs and keep them in secrets.
SFTPGo on Klutch.sh delivers reproducible Docker builds, split SFTP and admin endpoints to match single-port routing, managed secrets, and persistent storage—without extra YAML or CI steps. Configure ports, credentials, and volumes, then start serving secure file transfers.