Appearance

Language

Build a personal website from 0

Choosing a Stack for a Personal Website: Astro + Cloudflare vs Next.js vs WordPress

For a personal website built around writing and projects, I use Astro on Cloudflare Workers: pages ship as static HTML, the free plan covers it, and server features are there when you need them. Comparison with Next.js and WordPress, plus the real config files.

Kelvin Wang · · 7 min read

For a personal website that is mostly writing, projects and an about page, Astro deployed on Cloudflare is the stack I’d pick. Astro builds your pages into static HTML and ships no JavaScript by default, so the site is fast and needs almost nothing from a server. Cloudflare’s free plan is hard for a personal site to outgrow, and requests served straight from static assets are free and unlimited. When you later want a login or a private dashboard, the same Astro project adds server-side code through the official Cloudflare adapter, so you never have to switch frameworks. My own site, kelvinwang.info, runs on exactly this. The first commit, on June 10, 2026, was “scaffold Astro project with Cloudflare and React adapters”, and it has been running for five months since.

One idea makes the rest of this easier: a stack has two layers. The framework decides how the site gets built (what you write, how pages are generated). The host decides where the built site lives and what answers each visitor’s request. Astro is the first layer and Cloudflare is the second. Keeping them apart stops you from mixing up “is Next.js good” with “is Vercel expensive”.

Astro vs Next.js vs WordPress at a glance

QuestionAstro + CloudflareNext.jsWordPress (self-hosted)
What it isA content-first web framework; pages are generated at build time by defaultA full-stack React framework, aimed at interactive web appsA PHP content management system with an admin editor
JavaScript sent to the browserNone by default; only components you mark as interactive (islands) load JSAlways ships the React runtimeDepends on the theme and plugins
Where posts liveMarkdown/MDX files in your repo, or a databaseYour choice: files, a database or a headless CMSA MySQL/MariaDB database
What the host needsStatic files; server features run on WorkersAnything beyond a static export needs Node or a compatible runtimePHP 8.3+, MySQL 8.0+ or MariaDB 10.11+
Deploying to CloudflareOfficial adapter, @astrojs/cloudflareCloudflare recommends vinext (in beta); existing apps can use OpenNextCan't run on Workers; rent a separate server
What you maintainPackage upgradesPackage upgrades, plus whether the adapter keeps up with new versionsCore, theme and plugin updates and security patches
Best forBlogs, portfolios, personal brand sitesHighly interactive apps, or people who already know ReactPeople who want a point-and-click editor and no code

Host requirements: WordPress.org [7]. Next.js on Cloudflare: Cloudflare docs [4] (checked 2026-11-07).

If you’re still deciding whether to write code at all, or want to weigh hosted builders like Wix and Framer and AI site builders too, the broader comparison covers those.

Go deeper AI Website Builder vs Building with AI vs WordPress: Which One Fits You Hosted builders, AI builders, WordPress and writing your own, compared by what you need.

Why Astro over Next.js

My earlier sites ran on Next.js. On one of them, in 2023, before I used AI coding tools, we upgraded from Next.js 13 to 14 to get new features. Deploying to Cloudflare Pages depended on an adapter called @cloudflare/next-on-pages, which didn’t support the new version yet, so the upgrade got stuck. The adapter was later deprecated, and its repository was archived in October 2026. The upgrade took real effort and the deploy setup had to be rebuilt along with it. Over time deploys broke, merges broke, and CI/CD broke itself. The lesson I took: pick the wrong framework and it drags the whole system down with it.

So for this site, my fourth, I checked how the framework and the host fit together before I checked how nice the framework felt to write. Astro maintains an official Cloudflare adapter that plugs any server-side code into Cloudflare’s runtime. On January 16, 2026, Cloudflare acquired The Astro Technology Company; Astro stays MIT-licensed open source and has said it will keep supporting hosts other than Cloudflare.

Astro has two more practical advantages for a personal site:

  • Posts are files. You write Markdown or MDX, the files sit in your repo and go through version control with the code. AI coding tools can read and edit them directly.
  • JavaScript only where it’s needed. My home page has two React components (the work section and the identity switcher). Islands load React for those two blocks only, and article pages stay plain HTML.

Why Cloudflare for hosting

My previous sites were already on Cloudflare. I picked it then for cost and technical reasons, and it’s still generous. The Workers Free plan includes:

  • 100,000 Worker requests a day, with 10 ms of CPU time per request
  • Requests served directly from static assets, free and unlimited
  • 200,000 Workers Logs events a day, kept for 3 days

Most pages on a personal site are prebuilt static files, so 200k events is really hard to hit. This site is still on the free plan and pays Cloudflare US$0 a month. If you ever need more, the paid plan starts at US$5 per account per month.

The other reason is familiarity. What I learned deploying earlier sites carried straight over. Once build and deploy are wired up, every change I push to GitHub goes live on its own.

What the setup looks like

These are the real files from kelvinwang.info, trimmed to the lines that matter for the stack. Read what each line does before you copy it.

1. Create the project. The official command is npm create astro@latest, and it needs Node.js v22.23.4 or newer (odd-numbered versions like 23 aren’t supported). Then add the Cloudflare adapter:

npm create astro@latest my-site
cd my-site
npx astro add cloudflare

2. astro.config.mjs. My site has a private dashboard at /app, so every page runs on the server by default and public pages opt back into being built ahead of time:

import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';

export default defineConfig({
  // SSR by default so middleware always runs for /app routes.
  // Public pages opt back into prerendering with `export const prerender = true`.
  output: 'server',
  site: 'https://kelvinwang.info',
  adapter: cloudflare({ imageService: 'compile' }),
});

If your site is only writing and projects, skip output: 'server' and keep Astro’s default static output. Less to configure.

3. wrangler.jsonc. Cloudflare’s config file. It says where the built files are (dist) and where the Worker code starts:

{
  "compatibility_date": "2026-06-10",
  "name": "personal-website",
  "main": "./src/worker.ts",
  "assets": { "directory": "./dist", "binding": "ASSETS" }
}

main points to my own Worker entry, which handles a redirect from an old domain. A new project doesn’t need it: with no wrangler.jsonc, Astro generates a default config, and if you write one yourself, the docs use @astrojs/cloudflare/entrypoints/server for main.

4. Deploy on push. Since September 29, 2026, every push to main is built and deployed by Cloudflare Workers Builds. The manual fallback is one line; the first time, run npx wrangler login to sign in to your Cloudflare account in the browser:

npm run build && npx wrangler deploy
Go deeper Cloudflare Workers Tutorial 2026: Astro SSR and Wrangler First deploy, environment variables, deploy on push, and fixing failed builds.

Pitfalls I hit

The stack is pleasant, but five months in, these are worth knowing before you start:

  • Astro 6 removed Astro.locals.runtime.env. On Cloudflare you read environment variables with import { env } from 'cloudflare:workers'. My login check stopped seeing its config after the upgrade for exactly this reason (commit 75ba367).
  • EMFILE on Workers Builds. Rollup opens up to 1000 files at once by default, and Workers Builds has a lower open-file limit, so before the fix 5 of the last 7 pushes failed to build. The fix was maxParallelFileOps: 64 under vite.build.rollupOptions in astro.config.mjs (commit 44ec11e), plus a test so nobody removes it.
  • Page requests can still hit the Worker. My wrangler.jsonc sets run_worker_first so page requests go through the Worker first (for the old-domain redirect). Those count against the 100,000 daily requests; only hashed bundles like /_astro/* are served as plain static assets. Work out your traffic before adding a setting like that.
  • Node built-ins. Some npm packages import Node built-in modules that Cloudflare’s runtime can’t load. With twitter-text I had to alias punycode to the npm package of the same name.
  • Versions keep moving. My site runs Astro 6.4.5; on November 7, 2026 the latest on npm was 7.4.7. Read the official upgrade guide before a major version, and don’t let an AI bump every package to latest in one go.

Which AI I use

This site has been written with AI since the first commit. I pay for both Claude Max x20 and GPT Pro. Bought the lot. The stack isn’t tied to either: Astro’s and Cloudflare’s docs are clear enough that any AI coding tool can follow them. How the tools differ gets its own neutral comparison.

Go deeper Claude Code vs Codex vs Grok Build in 2026: Which AI Coding Agent Fits You Each tool judged on the same points: who it suits, how you use it, price and limits. No winner picked.

When this stack is the wrong choice

  • You never want to touch code and want to edit in an admin panel: use WordPress or a hosted builder.
  • The site is really an interaction-heavy app and you already know React and Next.js well: stay on Next.js and evaluate hosts separately.
  • You need lots of ready-made plugins (shop, memberships, translation) and don’t want to build them: WordPress has the bigger ecosystem.

Outside those cases, for a site built around writing and projects, Astro on Cloudflare costs little to start and leaves little to maintain. It’s the stack I recommend to beginners today.

Sources

  1. 1. Astro Cloudflare adapter · Astro
  2. 2. Install Astro · Astro · 2026-11-07
  3. 3. Workers pricing · Cloudflare · 2026-11-07
  4. 4. Next.js on Cloudflare Workers · Cloudflare · 2026-11-07
  5. 5. next-on-pages (deprecated) · GitHub
  6. 6. Cloudflare Acquires Astro · Business Wire · 2026-01-16
  7. 7. WordPress requirements · WordPress.org · 2026-11-07

About the author

Kelvin Wang

Electrical engineer building tools with AI agents, sharing hands-on notes on engineering and investing.

More about me