Lightweight SFTP server streaming files directly to AWS S3, Azure Blob, and Google Cloud Storage.
5.9K
For the full changelog, see the CHANGELOG.
SFTP Gateway is a secure, scalable, and easy-to-use solution for transferring files via SFTP to cloud storage services such as AWS S3, Azure Blob, and Google Cloud Storage. Files are streamed directly to cloud storage—data is never stored in transit or exposed to a third party.
Administrators manage the SFTP service through an intuitive web dashboard with support for OIDC and LDAP integration.
SFTP Gateway consists of two container images that work together:
| Image | Description |
|---|---|
| thorntech/sftpgateway-backend (this image) | Core SFTP server, API, and cloud storage integration |
| thorntech/sftpgateway-admin-ui | Web-based administration dashboard |
A PostgreSQL database is also required (included in the quick start below).
Run the following to generate security credentials and a self-signed TLS certificate, and save them to a .env file that Docker Compose picks up automatically:
# Generate security credentials
SECURITY_CLIENT_ID=$(openssl rand -hex 16)
SECURITY_CLIENT_SECRET=$(openssl rand -hex 32)
SECURITY_JWT_SECRET=$(uuidgen 2>/dev/null \
|| cat /proc/sys/kernel/random/uuid 2>/dev/null \
|| openssl rand -hex 16)
# Generate a self-signed TLS certificate (valid for 1 year)
openssl req -x509 -newkey rsa:2048 -keyout tls.key -out tls.crt \
-days 365 -nodes -subj "/CN=localhost" 2>/dev/null
# Save everything to .env (Docker Compose reads this automatically)
{
echo "SECURITY_CLIENT_ID=${SECURITY_CLIENT_ID}"
echo "SECURITY_CLIENT_SECRET=${SECURITY_CLIENT_SECRET}"
echo "SECURITY_JWT_SECRET=${SECURITY_JWT_SECRET}"
printf 'WEBSITE_BUNDLE_CRT="%s"\n' "$(cat tls.crt)"
printf 'WEBSITE_KEY="%s"\n' "$(cat tls.key)"
} > .env
rm -f tls.crt tls.key
echo "Credentials saved to .env"
Create a docker-compose.yml file:
services:
db:
container_name: sftpgw_container_db
image: postgres:16-alpine
environment:
POSTGRES_DB: sftpgw
POSTGRES_USER: sftpgw
POSTGRES_PASSWORD: sftpgw
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_INITDB_ARGS: "--data-checksums"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sftpgw -d sftpgw"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- sftpgw-network
init-permissions:
image: thorntech/sftpgateway-backend:3.8.3
user: root
entrypoint: ["/bin/sh", "-c"]
command: ["chown -R sftpgw:sftpgw /mnt/sftpgw_1"]
volumes:
- mount:/mnt/sftpgw_1
backend:
container_name: backend
image: thorntech/sftpgateway-backend:3.8.3
depends_on:
db:
condition: service_healthy
init-permissions:
condition: service_completed_successfully
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/sftpgw
SPRING_DATASOURCE_USERNAME: sftpgw
SPRING_DATASOURCE_PASSWORD: sftpgw
SECURITY_CLIENT_ID: ${SECURITY_CLIENT_ID}
SECURITY_CLIENT_SECRET: ${SECURITY_CLIENT_SECRET}
SECURITY_JWT_SECRET: ${SECURITY_JWT_SECRET}
SERVER_PORT: 8080
FEATURES_FIRST_CONNECTION_CLOUD_PROVIDER: lfs
FEATURES_FIRST_CONNECTION_BASE_PREFIX: /mnt/sftpgw_1
AWS_REGION: ${AWS_REGION:-us-east-1}
HOME: /home/sftpgw
volumes:
- sftpgw_home:/home/sftpgw
- mount:/mnt/sftpgw_1
ports:
- "8080:8080"
- "2244:22"
user: "sftpgw"
working_dir: /opt/sftpgw
restart: unless-stopped
networks:
- sftpgw-network
ui:
container_name: sftpgw-ui
image: thorntech/sftpgateway-admin-ui:3.8.3
environment:
BACKEND_URL: http://backend:8080/
SECURITY_CLIENT_ID: ${SECURITY_CLIENT_ID}
SECURITY_CLIENT_SECRET: ${SECURITY_CLIENT_SECRET}
CLOUD_PROVIDER: lfs
WEBSITE_BUNDLE_CRT: ${WEBSITE_BUNDLE_CRT}
WEBSITE_KEY: ${WEBSITE_KEY}
ports:
- "80:80"
- "443:443"
restart: unless-stopped
networks:
- sftpgw-network
volumes:
postgres_data:
driver: local
sftpgw_home:
driver: local
mount:
driver: local
networks:
sftpgw-network:
driver: bridge
docker compose up -d
Access the admin dashboard at https://localhost and the SFTP server on port 2244.
| Variable | Description | Required |
|---|---|---|
SPRING_DATASOURCE_URL | PostgreSQL JDBC connection string | Yes |
SPRING_DATASOURCE_USERNAME | Database username | Yes |
SPRING_DATASOURCE_PASSWORD | Database password | Yes |
SECURITY_CLIENT_ID | OAuth client ID (must match UI) | Yes |
SECURITY_CLIENT_SECRET | OAuth client secret (must match UI) | Yes |
SECURITY_JWT_SECRET | JWT signing secret | Yes |
SERVER_PORT | API server port (default: 8080) | No |
FEATURES_FIRST_CONNECTION_CLOUD_PROVIDER | Initial cloud provider: lfs, s3, azureblob, gcp (default: none) | No |
FEATURES_FIRST_CONNECTION_BASE_PREFIX | Base path for local file storage (default: none) | No |
AWS_REGION | Default AWS region (default: us-east-1) | No |
| Port | Protocol | Description |
|---|---|---|
| 22 | TCP | SFTP server |
| 8080 | TCP | REST API |
| Path | Description |
|---|---|
/home/sftpgw | Application home directory |
/mnt/sftpgw_1 | Local file storage mount point |
SFTP Gateway supports multiple methods for authenticating with cloud storage providers:
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)SFTP Gateway supports streaming files to:
Configure storage destinations through the admin dashboard.
SFTP Gateway container images are built on Docker Hub Infrastructure (DHI) with near-zero CVEs and a distroless runtime, minimizing the attack surface. Every release includes SBOMs (Software Bill of Materials) and SLSA Build Level 3 provenance attestations, providing verifiable proof of build integrity.
You can inspect the SBOM and provenance for any image using Docker Scout or the BuildKit imagetools:
# View attestations with Docker Scout
docker scout attestation list thorntech/sftpgateway-backend:latest
# Inspect SBOM and provenance with buildx
docker buildx imagetools inspect thorntech/sftpgateway-backend:latest --format '{{json .SBOM}}'
docker buildx imagetools inspect thorntech/sftpgateway-backend:latest --format '{{json .Provenance}}'
SFTP Gateway is commercial software. Use is governed by the End User License Agreement. A 30-day free trial is included — no payment information required.
To purchase a license, visit sftpgateway.com/purchase.
For technical support, contact [email protected].
Full documentation is available at sftpgateway.com.
SFTP Gateway is developed by Thorn Technologies, specialists in secure file transfer and cloud integration solutions.
Content type
Image
Digest
sha256:4f703d750…
Size
364.1 MB
Last updated
about 1 month ago
docker pull thorntech/sftpgateway-backend