Why I Built My Own Blog Instead of Using WordPress: The Whole Setup on One Home Mac
This blog runs on a single Mac at home: a Spring Boot API, a Next.js web app, and PostgreSQL in Docker, exposed through Cloudflare Tunnel. I did not open any router ports.
I originally set out to test publishing to WordPress. While looking into hosting it myself, I decided to build the blog instead. This series follows the work—and the fixes—over the next four months.
Why not WordPress
Three things made me choose to build the blog instead of setting up WordPress.
- The backend was familiar ground. I could build the API and database with Spring right away. That gave me a familiar place to start.
- I wanted hands-on practice with my weak spots. Frontend work like Next.js, and infrastructure like Docker, Cloudflare, and deployment, were less familiar to me. Running a service that real visitors use means you can't avoid those parts.
- I didn't need another editor at the time. I was already writing and editing posts in a separate publishing tool I had built. That overlapped with a big part of what WordPress offers, so building my own blog cost less than it otherwise would have.
Initially the external publishing tool seemed sufficient, but I later built an admin app for editing and operations. The diagram below shows that expanded architecture, not only the first day's setup.
Building it myself also meant taking on more work.
With WordPress
- Themes, an editor, comments, and plugins from day one
- Built-in features and plugins for sitemaps, RSS, and SEO
- A steady stream of security updates to keep up with
- A site configured around the behavior of its themes and plugins
Building it myself
- I built lists, tags, search, RSS, and sitemaps one by one
- I ran into caching, time zone, and encoding problems firsthand
- I choose the post storage format and page structure
- When something breaks, I can dig all the way down to the cause
When I connected traffic analytics in July, the most requested path that day was /wp-admin/install.php, with 40 hits. Those requests looked like automated scans for the WordPress installation page. This blog had no such page, and the notes from that day recorded no related incident.
The whole architecture in one picture
Preparing diagram.
Diagram source
flowchart TB
R[Reader's browser] -->|HTTPS| E[Cloudflare edge]
E -->|Encrypted tunnel| T
subgraph M[One Mac at home]
T[cloudflared] --> W[blog-web · Next.js]
W -->|Docker internal network| A[blog-api · Spring Boot]
A --> D[(PostgreSQL)]
P[Publishing tool] -->|Bearer token| A
AD[Admin app] --> A
endRequests from the internet follow exactly one path. The browser connects to the Cloudflare edge over HTTPS. The edge forwards the request through an encrypted tunnel to cloudflared on the Mac, and cloudflared passes it only to the web app (blog-web). The web app calls the API over Docker's internal network, and only the API can reach the database.
Writing posts takes a different path. The publishing tool and the admin app call the API from inside the same Mac, and that path is not exposed to the internet.
Four design principles
1. The web app is the only door to the internet
blog-web is the only component reachable from the internet. The API binds only to the host's local address, and PostgreSQL publishes no host port at all, so it is visible only inside Docker's internal network. This keeps the API and database from being directly exposed to the internet. Requests can still reach the API through the web app, so API authentication and input validation remain necessary.
I didn't get this perfect from day one, though. At first, the API port was open to my entire home network, and I only restricted it to the local address during a review in September. For security reasons, this series doesn't cover the details of the access paths.
2. Connect outward instead of opening ports
Exposing a home server directly means taking care of router port forwarding, domain routing, and HTTPS. Nginx and Let's Encrypt are one option; I chose Cloudflare Tunnel for this blog.
Instead, cloudflared opens connections outward to Cloudflare. There is no path from the outside directly to my home IP, so there is no need to poke holes in the router. [S1] The logs from the first boot show it connecting to several Seoul edge locations at once for redundancy.
INF Registered tunnel connection connIndex=0 ... location=icn06 protocol=quicINF Registered tunnel connection connIndex=1 ... location=icn05 protocol=quic... (4 in total)I didn't issue an HTTPS certificate myself either. Cloudflare's Universal SSL issues and renews the domain certificate. [S2] Traffic between the browser and the edge is encrypted with that certificate, and traffic between the edge and my home is encrypted by the tunnel itself, so along this public request path, the plain HTTP hops stay inside the Docker network on the Mac.
3. Tokens for writes, a gate for public reads
Every API that creates or edits posts checks a Bearer token. The public read API returns only posts that are published and whose publish time has passed. Drafts and scheduled posts stay hidden even if you know their URLs. Later I discovered that this gate applied to the post lists but was missing from single-post lookups, so when I introduced draft status, I applied the same condition to single-post lookups too.
4. Store raw Markdown and let the web app render it
The API doesn't convert posts to HTML. It stores the raw Markdown, and the web app decides how to draw it. Because of that, when I later added highlighted lines in code blocks, tables, math, and diagrams, I only had to change the renderer without touching a single stored post. The architecture diagram in this post is drawn the same way.
The first goal: a single "hello"
I didn't start with a writing feature. The first goal was this: open https://forge-fate.com from the internet and see one line of text returned by the Spring API.
Preparing diagram.
Diagram source
sequenceDiagram
participant B as Browser
participant C as Cloudflare
participant W as blog-web
participant A as blog-api
B->>C: GET https://forge-fate.com
C->>W: Forward through tunnel
W->>A: GET /api/hello
A-->>W: hello from blog-api
W-->>B: Render on screenI deliberately left out the database and the post entity. The most uncertain part wasn't a feature. It was whether a container running at my home would actually show up on the internet under a public domain. If that path was blocked, no other feature would be visible anyway. So I pushed a single request all the way from the outermost layer to the innermost one first. After that, I added features one slice at a time and checked each one through the public URL.
Getting that single line to appear meant checking the connectors, container addresses, DNS, and the certificate. Two connectors attached to the same tunnel, leaving requests open to occasional failure. I got confused about what localhost means inside a container. And I created the tunnel, but no DNS record appeared. I also had to check that the certificate was ready. The next post covers that process.
The price of building it myself
I added the following over the next four months. Had I chosen WordPress, I would have looked at its built-in features and plugins for these first.
- Categories, tags, series, search, and pagination
- Two sites, Korean and English, with per-language publishing
- Sitemaps, RSS, structured data, and search indexing settings
- An admin app, image uploads, revision history, and a trash bin
- Backups and restore rehearsals
Alongside building features, I spent time finding out why they behaved differently after deployment. This series records the causes I could establish and the changes I made.
What this series covers
This series is organized by topic rather than as a chronological diary. Each post distinguishes the incident date from later changes; when an incident returns, the focus is the new question it helps answer.
| Part | Topic | Example incidents |
|---|---|---|
| Part 1 | Building the skeleton | Pitfalls on the tunnel's first boot, the day I moved to Flyway, "passing tests ≠ a booting app" |
| Part 2 | Fighting the Next.js cache | The cache getting overwritten with "no posts" when the API stopped, builds baking empty pages |
| Part 3 | Search engines and two languages | An error Search Console caught before I did, why only Korean tag pages broke |
| Part 4 | The admin app and protecting data | A bug that pushed scheduled posts back by 9 hours until they disappeared |
| Part 5 | Things that broke in production | HTTP 530 persisting after rollback, a backup pipeline hiding failure, security patches that drifted per app, a retrospective |
The next post covers the four pitfalls I hit on the first day while putting a home Mac on public HTTPS without port forwarding.
Sources
- [S1] Cloudflare Tunnel | Cloudflare Docs | Checked 2026-10-19 | https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/ ↩
- [S2] Universal SSL | Cloudflare Docs | Checked 2026-10-19 | https://developers.cloudflare.com/ssl/edge-certificates/universal-ssl/ ↩
About these records
This post is based on the work notes, logs, and measurements I kept while building and running this blog since June 2026. Numbers are as of the date they were recorded and may differ today. For security reasons, I leave out admin paths, access-control details, and values such as tokens.
Report an error or share feedback
Open a draft with this article’s title and URL. Review the message and recipient before sending.
Open email draftIf no email app opens, copy these details into your usual email service.
Related posts
Backend & Infrastructure Spring Boot 4.1 Jackson Settings: Comparing Duplicate JSON Keys and BigDecimal Output
Compare two Jackson settings in the same Spring Boot 4.1.0 app using the recorded six tests and six HTTP requests for duplicate JSON keys and BigDecimal notation.
Backend & Infrastructure A Spring Backend Learning Roadmap: Seven Skills to Demonstrate with a Small Service
A fictional reading-log service connects practice tasks and completion criteria for business rules, HTTP, transactions, permissions, queries, tests, and operations.