Start a website at $0 a month with GitHub Pages, Cloudflare and a free database
On this page
Plan for the day your free allowance runs out. A build limit can delay a release, while an API or database limit can leave users unsure whether their data was saved. Decide how the app will report a failed save, which usage meters to watch, and when to export a backup you can restore. The examples use the host’s included address, so buying a domain is optional.
| Setup | What to check first |
|---|---|
| GitHub Pages or Cloudflare Pages | Build count and terms of use |
| Cloudflare Pages + Workers Free + D1 Free | Daily API requests and rows read or written |
| Cloudflare Pages + Workers Free + Neon Free | Daily API requests and monthly database compute and transfer |
Plan details checked on December 1, 2026. The usage figures below are worked examples. No new cloud deployment or load test was performed.
1. Use static hosting for blogs and docs
Publish the HTML, CSS and JavaScript generated by Astro or Hugo. To add a post, commit it to Git and deploy again. This setup needs no database. The hosts provide addresses such as username.github.io and project.pages.dev. The Cloudflare Pages Free build service allows 500 builds per month. About GitHub Pages · Cloudflare Pages limits · Deploying with Git integration
GitHub Pages prohibits hosting an online business or an e-commerce site. The restriction also covers sites whose primary purpose is to facilitate commercial transactions or provide commercial SaaS. GitHub Pages usage limits
2. Store notes with Workers and D1
Pages serves the static interface. The Worker handles GET /api/notes to list notes and POST /api/notes to save them in D1, which uses SQLite. Keep the interface available during an API outage and show distinct messages for a failed list request and a save you cannot confirm. About D1
Workers Free allows 100,000 requests per account per day. Pages Functions requests count toward the same quota, which resets at midnight UTC (9 a.m. KST). A Worker that exceeds the limit returns error 1027. Workers limits · Pages Functions pricing
D1 Free allows 5 million rows read and 100,000 rows written per account per day. Storage is capped at 500 MB per database and 5 GB per account. Reaching either daily row limit causes D1 queries to return errors. At the storage limit, free up space before inserting new data. D1 pricing · D1 limits
If the app lists notes 1,000 times a day and each query reads 5,000 rows on average, it reads 5 million rows a day. A query can return just 20 rows and still scan many more. Compare meta.rows_read for the same query before and after indexing the filter column, then check meta.rows_written for the extra writes that maintain the index. D1 usage metrics
The example covers the interface’s response handling. It assumes the API returns HTTP 201 only after committing the save. Save the code as save-note.mjs and run node save-note.mjs with Node.js 24. It supplies HTTP 201 and 503 responses and a network error in place of a live API.
async function saveNote(text, request = fetch) {
try {
const response = await request('/api/notes', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text }),
});
return response.status === 201 ? 'saved' : 'unconfirmed';
} catch {
return 'unconfirmed';
}
}
for (const status of [201, 503]) {
console.log(await saveNote('Read the limits', async () => new Response(null, { status })));
}
console.log(await saveNote('Read the limits', async () => {
throw new TypeError('Network error');
}));
The observed local output is saved, unconfirmed, unconfirmed, in that order.
3. Keep PostgreSQL with Workers and Neon
If you need to keep existing PostgreSQL migrations, queries and features specific to PostgreSQL, host the database on Neon and connect from Workers. Store the connection string in a Worker secret. Workers secrets
Neon Free includes 100 CU-hours of compute per month, 1 GB of PostgreSQL storage and 5 GB of public network transfer per month, all per project. PostgreSQL storage also has a 20 GB account-wide cap. Postgres, Object Storage and Neon Functions share the project’s transfer allowance. Running at 0.25 CU for 4 hours uses 1 CU-hour. Compute suspends after 5 minutes of inactivity, so check the response time of the first request that wakes it. If compute is suspended for reaching the compute or transfer limit, pg_dump can fail to connect as well. Neon plans and limits · Neon pricing
Before deploying
- Check the provided address and the chosen Free plan. Check pricing for any domains, email or storage you use separately.
- Track Workers requests and either D1 rows read and written or Neon compute and transfer. Show success only when the save is confirmed.
- Before you hit a limit, export D1 with
wrangler d1 exportor PostgreSQL withpg_dump. Restore in a separate environment and check the tables and representative queries. Use actual usage and acceptable downtime to decide when to migrate or upgrade. Exporting and importing D1 · Neon export conditions
Discussion