Host your own file sharing server for Dropshare with automatic HTTPS.
For experienced users — get up and running in 2 minutes:
# On your server (requires Docker)
git clone https://github.com/dropshareapp/dropshare-selfhosted.git
cd dropshare-selfhosted
./setup.sh # Enter your domain, accept defaults
docker compose up -d # Start the server
# Copy the private key to your Mac
scp user@server:~/dropshare-selfhosted/config/ssh/dropshare_key ~/.ssh/
chmod 600 ~/.ssh/dropshare_keyThen in Dropshare: Preferences → Connections → + → SFTP — use the settings shown by the setup script.
- SFTP server for secure file uploads from Dropshare
- Web server (Caddy) for serving files with automatic HTTPS/TLS certificates
- SSH key authentication for security (no passwords)
- Simple setup with an interactive script
Before you start, you need:
-
A server (VPS, cloud instance, or home server) with:
- Docker and Docker Compose installed
- Ports accessible from the internet (defaults: 80, 443, 2222 — customizable during setup)
-
A domain name pointing to your server's IP address
- Example:
files.yourdomain.com→123.45.67.89 - For local testing, you can use
127.0.0.1or a local IP address
- Example:
If Docker is not already installed on your server, follow the instructions for your Linux distribution:
# Update package index
sudo apt update
# Install prerequisites
sudo apt install -y ca-certificates curl gnupg
# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the Docker repository (for Debian, replace 'ubuntu' with 'debian')
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Add your user to the docker group (logout and back in after this)
sudo usermod -aG docker $USERsudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker && sudo systemctl enable docker
sudo usermod -aG docker $USERsudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker && sudo systemctl enable docker
sudo usermod -aG docker $USERsudo pacman -S docker docker-compose
sudo systemctl start docker && sudo systemctl enable docker
sudo usermod -aG docker $USERLog out and back in, then verify:
docker --version
docker compose versiongit clone https://github.com/dropshareapp/dropshare-selfhosted.git
cd dropshare-selfhosted
./setup.shThe setup script will:
- Ask for your domain name and ports
- Generate secure SSH keys
- Create all configuration files
- Display connection settings for Dropshare
docker compose up -dThe setup script generates an SSH keypair for authentication. You need to transfer the private key to your Mac to use with Dropshare.
Option A: Copy via SCP (from your Mac)
scp user@your-server:~/dropshare-selfhosted/config/ssh/dropshare_key ~/.ssh/dropshare_key
chmod 600 ~/.ssh/dropshare_keyOption B: Copy via clipboard (on the server)
cat config/ssh/dropshare_keyThen copy the output (including -----BEGIN/END----- lines) and save it to a file on your Mac, e.g., ~/.ssh/dropshare_key. Set permissions:
chmod 600 ~/.ssh/dropshare_keyOption C: Use SFTP client
Connect to your server with an SFTP client (like Transmit or Cyberduck) and download config/ssh/dropshare_key to your Mac.
Open Dropshare preferences → Connections → Add new SFTP connection:
| Setting | Value |
|---|---|
| Protocol | SFTP |
| Hostname | your-domain.com:2222 (use your custom port if changed) |
| Username | dropshare (or your custom username) |
| Authentication | Private Key |
| Private Key | Select the dropshare_key file from step 3 |
| Upload Path | /uploads/ (or your custom path) |
| URL to Path | https://your-domain.com/ (include port if non-standard HTTPS) |
Tip: The setup script displays the exact connection settings for your configuration. Use those values.
┌─────────────────┐ ┌─────────────────┐
│ Dropshare │ SFTP │ SFTP Server │
│ (your Mac) │────────▶│ (default: 2222) │
└─────────────────┘ └────────┬────────┘
│
▼
┌─────────────────┐
│ Shared Volume │
│ /uploads │
└────────┬────────┘
│
▼
┌─────────────────┐ ┌─────────────────┐
│ Browser / │ HTTPS │ Caddy Server │
│ Recipients │◀────────│ (default: 443) │
└─────────────────┘ └─────────────────┘
dropshare-selfhosted/
├── setup.sh # Interactive setup script
├── README.md # This file
├── templates/ # Template files
│ ├── docker-compose.yml # Container orchestration template
│ ├── Caddyfile.template # Caddy configuration template
│ └── .env.example # Example environment variables
│
│ # Generated by setup.sh:
├── docker-compose.yml # Copied from templates
├── .env # Your configuration
├── config/
│ ├── Caddyfile # Generated Caddy config
│ ├── authorized_keys # SSH public key for auth
│ ├── ssh/
│ │ ├── dropshare_key # Private key (import to Dropshare)
│ │ ├── dropshare_key.pub # Public key
│ │ └── ssh_host_* # Server host keys
│ └── fail2ban/ # Fail2ban configuration
│ ├── filter.d/ # Custom filters
│ └── jail.d/ # Jail configuration
└── uploads/ # Your uploaded files
# Start the server
docker compose up -d
# Stop the server
docker compose down
# View logs
docker compose logs -f
# View specific service logs
docker compose logs -f sftp
docker compose logs -f caddy
# Restart after config changes
docker compose restartEdit .env and change any of these, then restart:
SFTP_PORT- SFTP port (default: 2222)HTTP_PORT- HTTP port (default: 80, needed for Let's Encrypt)HTTPS_PORT- HTTPS port (default: 443)
docker compose down
docker compose up -dNote: If you use a non-standard HTTPS port, you'll need to include it in your URLs (e.g., https://files.example.com:8443/).
- Check the server is running:
docker compose ps - Check firewall allows your SFTP port:
sudo ufw allow 2222(or your custom port) - Check logs:
docker compose logs sftp - Verify the private key file permissions:
chmod 600 ~/.ssh/dropshare_key
- Ensure your domain points to this server's IP
- Check ports 80 and 443 (or your custom ports) are open
- Check Caddy logs:
docker compose logs caddy - For local/IP addresses, the browser will warn about the self-signed certificate — this is expected
Check the uploads directory permissions:
chmod 755 uploads- Ensure you're using the correct private key file (
dropshare_key, notdropshare_key.pub) - Check the key file has correct permissions:
chmod 600 ~/.ssh/dropshare_key - Verify the public key is in
config/authorized_keyson the server
The server includes optional fail2ban protection against brute-force attacks. It automatically bans IP addresses after repeated failed login attempts.
Note: Fail2ban only works on Linux servers. It requires access to Docker container logs and iptables, which aren't available on macOS or Windows.
Enable fail2ban on Linux:
docker compose --profile linux up -dDefault settings:
- Max retries: 5 failed attempts
- Find time: 10 minutes (600 seconds)
- Ban time: 1 hour (3600 seconds)
Manage banned IPs:
# View banned IPs
docker compose exec fail2ban fail2ban-client status dropshare-sftp
# Unban an IP
docker compose exec fail2ban fail2ban-client set dropshare-sftp unbanip <IP>
# View fail2ban logs
docker compose logs fail2banCustomize settings:
Edit config/fail2ban/jail.d/dropshare.local and restart:
docker compose restart fail2ban- SSH key authentication only (no passwords)
- SFTP runs on port 2222 by default to avoid conflicts with system SSH (customizable)
- Caddy automatically obtains and renews TLS certificates
- Fail2ban protects against brute-force attacks
- Files are publicly accessible once uploaded (by design for sharing)
MIT