Deploying PairDrop
Introduction
PairDrop is a self-hosted file sharing solution that enables seamless file transfers between devices on the same network. Inspired by Apple’s AirDrop, PairDrop works across all platforms and browsers without requiring any app installation or account creation.
Built as a Progressive Web App (PWA), PairDrop uses WebRTC for peer-to-peer file transfers, meaning files go directly between devices without passing through a server. The server only facilitates the initial connection between peers.
Key highlights of PairDrop:
- Cross-Platform: Works on any device with a modern web browser (Windows, macOS, Linux, iOS, Android)
- No Installation Required: Access through any web browser, no app downloads needed
- Peer-to-Peer Transfers: Files transfer directly between devices using WebRTC
- No File Size Limits: Transfer files of any size between devices
- End-to-End Encryption: All transfers are encrypted for privacy and security
- Offline Capable: The PWA can be installed and used even with intermittent connectivity
- Text and Link Sharing: Share text snippets and URLs alongside files
- QR Code Pairing: Easily connect devices by scanning QR codes
- Room System: Create private rooms for file sharing with specific people
- No Account Required: Start sharing immediately without registration
- Open Source: Licensed under GPL-3.0, community-driven development
This guide walks through deploying PairDrop on Klutch.sh using Docker, configuring the application for your organization, and enabling secure file sharing across your network.
Why Deploy PairDrop on Klutch.sh
Deploying PairDrop on Klutch.sh provides several advantages for file sharing:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds PairDrop without complex orchestration. Push to GitHub, and your file sharing service deploys automatically.
Always Available: Access your PairDrop instance from anywhere with an internet connection, enabling file sharing even across different networks.
HTTPS by Default: Klutch.sh provides automatic SSL certificates, which is required for WebRTC functionality and secure file transfers.
Custom Domains: Assign a memorable domain to your PairDrop instance for easy access across your organization.
Environment Variable Management: Configure PairDrop behavior through Klutch.sh’s environment variable system.
Reliable Hosting: Enterprise-grade infrastructure ensures your file sharing service remains available when you need it.
Prerequisites
Before deploying PairDrop on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your PairDrop configuration
- Basic familiarity with Docker and containerization concepts
Understanding PairDrop Architecture
PairDrop uses a simple yet effective architecture:
Web Server: Serves the Progressive Web App and static assets to browsers.
Signaling Server: WebSocket server that helps devices discover each other and establish peer connections. This is the only component that handles network traffic; actual file transfers are peer-to-peer.
WebRTC: Browser-based technology that enables direct, encrypted connections between devices for file transfer.
STUN/TURN Servers: External servers that help establish peer connections when devices are behind NAT or firewalls.
Preparing Your Repository
Create a GitHub repository containing your Dockerfile for PairDrop deployment.
Repository Structure
pairdrop-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM node:20-alpine
WORKDIR /app
# Install git for cloningRUN apk add --no-cache git
# Clone PairDrop repositoryRUN git clone https://github.com/schlagmichdansen/PairDrop.git . && \ npm ci --omit=dev
# Set environment variablesENV NODE_ENV=production
# Expose the application portEXPOSE 3000
# Start PairDropCMD ["npm", "start"]Creating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdLICENSE.gitignore*.log.DS_Storenode_modules/.env.env.localEnvironment Variables Reference
PairDrop supports several environment variables for configuration:
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | The port PairDrop listens on |
WS_FALLBACK | false | Enable WebSocket fallback for networks blocking WebRTC |
RATE_LIMIT | false | Enable rate limiting for the signaling server |
DEBUG_MODE | false | Enable debug logging |
RTC_CONFIG | - | Custom WebRTC configuration (JSON string) |
Deploying PairDrop on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 3000
- Detect your Dockerfile automatically
- Build the container image
- Start the PairDrop container
- Provision an HTTPS certificate
Push Your Repository to GitHub
Initialize your repository and push to GitHub with your Dockerfile and configuration files.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “pairdrop” or “file-share”.
Create a New App
Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your PairDrop Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables (Optional)
Configure optional environment variables as needed:
| Variable | Value |
|---|---|
WS_FALLBACK | true (if you need WebSocket fallback) |
RATE_LIMIT | true (recommended for public instances) |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Access PairDrop
Once deployment completes, access your PairDrop instance at https://your-app-name.klutch.sh and start sharing files.
Using PairDrop
Sharing Files
- Open PairDrop on two or more devices
- Devices on the same network automatically discover each other
- Click on a device to start sharing
- Select files or drag and drop them onto the target device
- The recipient accepts the transfer
- Files transfer directly between devices
Creating Private Rooms
For sharing across different networks:
- Click the room icon in the bottom menu
- Create a new room with a custom name
- Share the room name with your recipient
- Both devices join the same room
- Devices in the same room can share files regardless of network
Installing as PWA
PairDrop can be installed as a Progressive Web App:
- Open PairDrop in Chrome, Edge, or Safari
- Click the install prompt or use the browser menu
- Add PairDrop to your home screen or applications
- Launch PairDrop directly from your device
Sharing Text and Links
Beyond files, PairDrop supports sharing:
- Text Messages: Send quick notes between devices
- URLs: Share links that open directly in the browser
- Clipboard Content: Transfer clipboard data between devices
Security Considerations
End-to-End Encryption
All PairDrop transfers use WebRTC’s built-in encryption. Files are encrypted in transit and never stored on the server.
Network Privacy
- Files transfer directly between devices (peer-to-peer)
- The server only facilitates initial connection setup
- No file content passes through the PairDrop server
Best Practices
- Deploy with HTTPS (automatic on Klutch.sh)
- Use private rooms for sensitive transfers
- Consider enabling rate limiting for public instances
- Regularly update your deployment for security patches
Troubleshooting
Devices Not Discovering Each Other
Issue: Devices on the same network don’t see each other.
Solutions:
- Ensure both devices are on the same local network
- Check that WebRTC is not blocked by browser settings
- Try using a private room instead
Transfers Failing
Issue: File transfers start but don’t complete.
Solutions:
- Enable WebSocket fallback with
WS_FALLBACK=true - Check firewall settings for WebRTC traffic
- Try smaller files to test connectivity
Connection Issues
Issue: Cannot establish peer connections.
Solutions:
- Ensure HTTPS is properly configured (required for WebRTC)
- Configure custom STUN/TURN servers if behind strict firewalls
- Check browser console for specific error messages
Additional Resources
Conclusion
Deploying PairDrop on Klutch.sh gives you a powerful, self-hosted file sharing solution that works across all your devices. The combination of peer-to-peer transfers and easy browser access means you can share files instantly without complex setup or app installations.
With end-to-end encryption, cross-platform support, and no file size limits, PairDrop provides a privacy-respecting alternative to cloud-based file sharing services. Whether you’re transferring documents between your laptop and phone or sharing files with colleagues, PairDrop makes it seamless.