Cooked up by Alex Kern & Neeraj Baid while eating Sliver @ UC Berkeley.
Made deployable by Fares Abawi using Cloudflare Tunnel.
Using WebRTC, FilePizza eliminates the initial upload step required by other web-based file sharing services. Because data is never stored in an intermediary server, the transfer is fast, private, and secure.
A hosted instance of the Cloudflare deployed FilePizza is available at filepizza.emaily.re.
To use the FilePizza in your own apps, we created an unofficial filepizza-client API which is designed to work with this FilePizza fork.
You'd first need to install this package locally or remotely (deployed with Cloudflare Tunnel).
The filepizza-client API runs by default on http://localhost:8081
which is automatically configured in the docker-compose.yml
.
For hosting the API and this package remotely, you'd have to modify the API_ORIGINS
variable in the .env
file (a copy of the provided envfile
) to include the domain or sub-domain where the API is hosted.
- A new UI with dark mode support, now built on modern browser technologies.
- Works on most mobile browsers, including Mobile Safari.
- Transfers are now directly from the uploader to the downloader's browser (WebRTC without WebTorrent) with faster handshakes.
- Uploaders can monitor the progress of the transfer and stop it if they want.
- Better security and safety measures with password protection and reporting.
- Support for uploading multiple files at once, which downloaders receive as a zip file.
- Streaming downloads with a Service Worker.
- Out-of-process storage of server state using Redis.
$ git clone https://github.com/kern/filepizza.git
$ pnpm install
$ pnpm dev
$ pnpm build
$ pnpm start
$ pnpm docker:local:build
$ pnpm docker:local:up
$ pnpm docker:local:down
You can deploy FilePizza using Cloudflare Tunnel for easy hosting without port forwarding or complex network configuration.
- A Cloudflare account with your domain added
- Cloudflare Global API token
- Docker and Docker Compose installed
-
Get your Cloudflare API token: Go to Cloudflare dashboard → My Profile → API Tokens → Global API Key
-
Configure environment: Copy the
envfile
to.env
and fill in your details:cp envfile .env # Edit .env with your values
-
Build and deploy:
npm run docker:build npm run deploy:full
-
Manual deployment (if you prefer):
# Build the Docker image npm run docker:build # Start the application stack npm run docker:up # Set up and start Cloudflare tunnel npm run tunnel:setup npm run tunnel:start
Once deployed, your FilePizza instance will be available at https://your-domain.com
. Users can access the web interface to share files peer-to-peer.
FilePizza supports CORS configuration through the API_ORIGINS
environment variable for external API access:
# Allow specific origins
API_ORIGINS=https://myapp.com,https://myapp.dev,https://localhost:3000
# Allow all origins (not recommended for production)
API_ORIGINS=*
# No external API access (if not specified)
# API_ORIGINS=
Important: Always specify the exact origins that should be allowed to access your FilePizza API in production environments for security.
Create a .env
file based on envfile
:
HOST_DOMAIN
: Your domain/subdomain for FilePizzaCLOUDFLARE_API_KEY
: Your Cloudflare Global API tokenAPI_ORIGINS
: Comma-separated list of allowed origins for CORSEXTERNAL_IP
: Your external IP (for TURN server)TURN_SECRET
: Secret for TURN server authenticationNODE_ENV
: Environment (production/development)
If you need to set up the tunnel manually:
./scripts/run_filepizza_cloudflare_tunnel.sh "your-api-key" "your-domain.com"
- Next.js
- Tailwind
- TypeScript
- React
- PeerJS for WebRTC
- View Transitions
- Redis (optional)
How are my files sent? Your files are sent directly from your browser to the downloader's browser. They never pass through our servers. FilePizza uses WebRTC to send files. This requires that the uploader leave their browser window open until the transfer is complete.
Can multiple people download my file at once? Yes! Just send them your short or long URL.
How big can my files be? As big as your browser can handle.
What happens when I close my browser? The URLs for your files will no longer work. If a downloader has completed the transfer, that downloader will continue to seed to incomplete downloaders, but no new downloads may be initiated.
Are my files encrypted? Yes, all WebRTC communications are automatically encrypted using public-key cryptography because of DTLS. You can add an optional password to your upload for an extra layer of security.
FilePizza is released under the BSD 3-Clause license. A huge thanks to iblowyourdesign for the pizza illustration.