Skip to content

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:

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
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM node:20-alpine
WORKDIR /app
# Install git for cloning
RUN apk add --no-cache git
# Clone PairDrop repository
RUN git clone https://github.com/schlagmichdansen/PairDrop.git . && \
npm ci --omit=dev
# Set environment variables
ENV NODE_ENV=production
# Expose the application port
EXPOSE 3000
# Start PairDrop
CMD ["npm", "start"]

Creating the .dockerignore File

Create a .dockerignore file:

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
node_modules/
.env
.env.local

Environment Variables Reference

PairDrop supports several environment variables for configuration:

VariableDefaultDescription
PORT3000The port PairDrop listens on
WS_FALLBACKfalseEnable WebSocket fallback for networks blocking WebRTC
RATE_LIMITfalseEnable rate limiting for the signaling server
DEBUG_MODEfalseEnable debug logging
RTC_CONFIG-Custom WebRTC configuration (JSON string)

Deploying PairDrop on Klutch.sh

    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:

    • Select HTTP as the traffic type
    • Set the internal port to 3000

    Set Environment Variables (Optional)

    Configure optional environment variables as needed:

    VariableValue
    WS_FALLBACKtrue (if you need WebSocket fallback)
    RATE_LIMITtrue (recommended for public instances)

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Detect your Dockerfile automatically
    • Build the container image
    • Start the PairDrop container
    • Provision an HTTPS certificate

    Access PairDrop

    Once deployment completes, access your PairDrop instance at https://your-app-name.klutch.sh and start sharing files.

Using PairDrop

Sharing Files

  1. Open PairDrop on two or more devices
  2. Devices on the same network automatically discover each other
  3. Click on a device to start sharing
  4. Select files or drag and drop them onto the target device
  5. The recipient accepts the transfer
  6. Files transfer directly between devices

Creating Private Rooms

For sharing across different networks:

  1. Click the room icon in the bottom menu
  2. Create a new room with a custom name
  3. Share the room name with your recipient
  4. Both devices join the same room
  5. Devices in the same room can share files regardless of network

Installing as PWA

PairDrop can be installed as a Progressive Web App:

  1. Open PairDrop in Chrome, Edge, or Safari
  2. Click the install prompt or use the browser menu
  3. Add PairDrop to your home screen or applications
  4. Launch PairDrop directly from your device

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.