A lightweight self-hosted real-time clipboard built on Cloudflare Workers, Durable Objects, and D1.
cf2paste lets you share text between your own devices in real time. Open the same room on two browsers and edits are synchronized automatically.
It also provides:
- Multiple rooms
- Searchable history
- Pin, preserve, delete, New, and restore
- Markdown preview
- Login protection
It is designed for personal use or a small trusted team.
- Open your deployed Worker URL.
- On first use, create the first account at
/setup. /is the default room.- Add a room name to the URL to create or open another room, for example
/workor/notes. - Open the same room on another device and start typing. Text will synchronize automatically.
- Use History to search or restore previous content, and New to start a fresh entry.
This is the easiest option for most users. You only need GitHub and Cloudflare in the browser; no local terminal is required.
Open this repository on GitHub and click Fork to create your own copy.
If GitHub Actions is disabled in the fork, open Actions and enable workflows first.
- Open the Cloudflare Dashboard.
- Go to Storage & databases → D1 SQL Database.
- Click Create Database.
- Use
cf2past-dbas the database name. - Open the database after it is created.
- In your GitHub fork, open
schema.sqland copy all of its contents. - In Cloudflare, open the D1 database and select Console.
- Paste the contents of
schema.sqland click Execute.
The database is now ready; no local wrangler d1 execute command is required.
You need three values for GitHub Actions:
CLOUDFLARE_D1_DATABASE_ID
Open the D1 database you just created and copy its Database ID / UUID.
CLOUDFLARE_ACCOUNT_ID
In the Cloudflare Dashboard, press Ctrl/Cmd + K, search for Copy account ID, and copy it. You can also find it under Workers & Pages → Account Details.
CLOUDFLARE_API_TOKEN
- In Cloudflare, go to Manage Account → API Tokens.
- Click Create Token.
- Choose the Edit Cloudflare Workers template.
- Select the Cloudflare account you want to deploy to.
- Create the token and copy the token value.
The token value is normally shown only once. Paste the token itself into GitHub; do not add Bearer before it.
In your fork, open:
Settings → Secrets and variables → Actions → New repository secret
Add these three secrets with the exact names below:
CLOUDFLARE_API_TOKEN
CLOUDFLARE_ACCOUNT_ID
CLOUDFLARE_D1_DATABASE_ID
You do not need to create a Worker manually in Cloudflare first. The first successful GitHub Actions deployment will create it automatically.
In your GitHub fork:
- Open
wrangler.example.toml. - Click the pencil icon to edit it in the browser.
- Change the first line, for example:
name = "cf2paste-yourname"- Click Commit changes and commit directly to
main.
That commit triggers Actions → CI and Deploy. After the verify job passes, GitHub will run the Cloudflare deployment automatically.
If you already have an Actions run from an earlier attempt, you can also open that run and choose Re-run all jobs after fixing the Secrets.
After GitHub Actions is green:
- Open Cloudflare Dashboard → Workers & Pages.
- Open the Worker name you set in
wrangler.example.toml. - The Worker page shows its deployment status and
workers.devURL. - Open that URL and visit
/setupto create the first account.
GitHub Actions will update the same Worker on later pushes to main.
For users who prefer Wrangler locally, Node.js 24+ is required.
git clone https://github.com/mumu-140/cf2paste.git
cd cf2paste
npm install
npx wrangler login
npx wrangler d1 create cf2past-db
cp wrangler.example.toml wrangler.tomlReplace YOUR_D1_DATABASE_ID in wrangler.toml with the D1 database ID returned by Cloudflare. You may also change the name field to your preferred Worker name. Then initialize and deploy:
npx wrangler d1 execute cf2past-db --remote --file=schema.sql
npm run deployOpen the Worker URL and create your account.
cf2paste stores clipboard text on the server and in D1 history. It is not end-to-end encrypted.
MIT
Special thanks to the Linux.do community for your support and feedback.