Introduction
Transfer.sh is a self-hosted file sharing service designed for the command line. It accepts file uploads via HTTP PUT and returns shareable URLs, making it ideal for transferring files between servers, sharing artifacts in CI/CD pipelines, or quickly sending files to colleagues without leaving the terminal.
What Transfer.sh Does
- Accepts file uploads via curl, wget, or any HTTP client with a single command
- Generates unique download URLs with configurable expiration and download limits
- Supports client-side encryption via gpg piping for sensitive files
- Stores files on local disk, S3, GCS, or any S3-compatible object storage
- Provides a minimal web interface for drag-and-drop uploads from browsers
Architecture Overview
Transfer.sh is a single Go binary that runs an HTTP server handling multipart and PUT uploads. Files are stored in a configurable backend (local filesystem, S3, or GCS) with metadata tracked for expiration and download counting. A cleanup goroutine periodically purges expired files.
Self-Hosting & Configuration
- Run as a single binary or via Docker:
docker run --publish 8080:8080 dutchcoders/transfer.sh - Configure storage backend via flags: --provider local, s3, or gcs
- Set --max-upload-size, --purge-days, and --purge-interval for retention policy
- Enable HTTPS with --tls-cert and --tls-key or put behind a reverse proxy
- Add --httpauth-user and --httpauth-pass for basic upload authentication
Key Features
- Zero-dependency uploads with curl—no client app needed
- Configurable file expiration by time or download count
- Multiple storage backends: local disk, AWS S3, Google Cloud Storage
- Virus scanning integration via ClamAV
- Simple web UI for non-technical users alongside the CLI interface
Comparison with Similar Tools
- Firefox Send — discontinued; Transfer.sh is actively maintained and self-hostable
- croc — peer-to-peer transfer requiring both parties online; Transfer.sh uses a server for async sharing
- magic-wormhole — direct P2P; Transfer.sh provides persistent download links
- Nextcloud — full cloud platform; Transfer.sh is minimal and CLI-first
- PairDrop — LAN-only browser sharing; Transfer.sh works across networks with persistent URLs
FAQ
Q: Is there a file size limit? A: Configurable via --max-upload-size flag. Default depends on deployment; no hard-coded limit.
Q: How do I encrypt files before upload?
A: Pipe through gpg: cat secret.txt | gpg -ac | curl --upload-file - https://transfer.sh/secret.txt.gpg
Q: Can I password-protect downloads? A: Not natively, but you can use client-side encryption. The server supports basic auth for uploads.
Q: What happens when a file expires? A: The background purge process deletes it from storage. The download URL returns 404.