Your own Telegram-style chat, on the Cloudflare free plan
Groups, end-to-end encrypted secret chats, calls, voice messages and stickers. Messages live in your browser and sync across devices, and the whole server is one Worker you deploy with a single click.
- Workers Free plan
- Works offline
- Sign in with any OpenID Connect provider
Everything you expect from a modern messenger
Built to feel like a native app, with the privacy and control of running it yourself.
Private chats and groups
Groups of up to 20 members with replies, edits, recall, reactions, pinned messages, forwarding, mentions, read receipts, typing and online status.
End-to-end encrypted secret chats
Secret chats use MLS across all of both people’s devices, media included. The server only stores ciphertext, and a 60-digit safety code reveals any inserted device.
Voice and video calls
One-to-one calls go peer to peer with a TURN relay as fallback; group calls run on Cloudflare Realtime SFU. Screen sharing, picture-in-picture and AI noise suppression.
Rich media
Photo and video albums transcoded in the browser, files, voice messages up to five minutes, up to 200 saved stickers and link preview cards.
Local-first and offline
Every message lives in SQLite in your browser (WASM on OPFS). The app opens instantly, works offline, syncs across devices and tabs, and searches on the device.
An installable app
A PWA with Web Push notifications, an app badge, the system share sheet and a picture-in-picture chat window.
Your identity provider
Sign in with any OpenID Connect provider through better-auth. Manage devices, contacts, aliases, blocking and invite links.
One Worker. Two kinds of Durable Objects.
The whole backend fits in a single Cloudflare Worker. State lives in SQLite-backed Durable Objects, so there are no servers, queues or caches to run.
- React app
- Sync worker
- SQLite in OPFS
- Presigned uploads from the browser
- Downloads from the bucket’s custom domain
One hibernating WebSocket
Each device keeps a single connection to its UserDO. Idle connections hibernate and cost nothing.
Write fan-out for small groups
A ChatDO appends each message once and fans it out to the members’ UserDOs, so syncing a dialog list is a single read.
Media never touches the Worker
Uploads go to R2 with presigned URLs and downloads come straight from the bucket’s custom domain. Thumbnails and video transcoding happen in the browser.
Designed around the free plan
Every hot path is measured in Durable Object requests and SQLite row writes, the tightest free-plan limits, and tested to stay within them.
- to run a small community on the Workers Free plan
- $0
- row writes to send a private message
- 4
- Worker requests to load media, served straight from R2
- 0
- members per group, so fan-out stays bounded
- 20
Deploy your own in minutes
All you need is a Cloudflare account, a domain on Cloudflare for media, and an OpenID Connect provider.
- 1
Click Deploy to Cloudflare
Cloudflare copies the repository into your account, creates the D1 database, the R2 bucket and the Durable Objects, and deploys to workers.dev.
- 2
Connect your identity provider and R2
Register a client with your provider, then give the media bucket a custom domain, CORS rules and an API token.
- 3
Fill in the vars and secrets
Add the values to wrangler.jsonc and the secrets, push, and check /api/auth/ok. Calls and notifications are optional extras.
Frequently asked questions
What is Web Chat?
Web Chat is an open-source, Telegram-style chat app for the web. It runs entirely on the Cloudflare developer platform (Workers, Durable Objects, D1 and R2) and is released under the Apache-2.0 license.
Is it really free to run?
Web Chat is designed to fit the Cloudflare Workers Free plan for a small community, such as a family, a team or a group of friends. Static assets are free and unlimited, idle WebSockets hibernate, and media is served from R2 without invoking the Worker. The same code runs unchanged on the paid plan when a community outgrows it.
How do I host my own instance?
Click Deploy to Cloudflare on GitHub, register a client with your OpenID Connect provider, set up the R2 bucket’s custom domain, CORS and API token, then fill in the vars and secrets. The README walks through every step, including a manual deployment with Wrangler.
Are messages end-to-end encrypted?
Secret chats are end-to-end encrypted with MLS across all of both people’s devices, media included, and the server only stores ciphertext. Regular private chats and groups are encrypted in transit and stored in the Cloudflare account of whoever runs the instance, so search, multi-device sync and history work without extra steps.
Does it work offline?
Yes. Messages are stored in SQLite in the browser, so the app opens without a network, shows your history, queues messages you send and delivers them when you reconnect. Search also runs on the device.
Is Web Chat affiliated with Telegram?
No. Web Chat is an independent open-source project inspired by the Telegram user experience. It does not use Telegram’s servers or accounts.
How do people sign in?
Through an OpenID Connect provider that you choose, such as your own identity server. Web Chat stores no passwords. Each browser you sign in on becomes a device that you can remove from the settings.