# How to Vibe Code Your Own Ghost (and Stop Paying for It)

> The best open source blog & newsletter platform

- Site: https://ghost.org
- Category: Publishing & Newsletter SaaS
- Platforms: Web app, Electron app, VS Code extension
- Verdict: **Serious undertaking** (38/100 vibecodeable)
- Estimated effort: 4-6 weeks of intensive development

## Verdict

Build a simplified self-hosted blogging subset with local SQLite and basic auth, but keep paying for Ghost if you need reliable bulk email deliverability and Stripe billing.

Ghost is a mature, decade-old CMS spanning a Node backend, custom templating engine, block editor, Stripe subscription machinery, and production email delivery. While an AI coding agent can scaffold the Next.js frontend, database schemas, and basic CRUD routes rapidly, engineering reliable email deliverability, handling tricky Stripe subscription edge cases, and building a secure theme sandboxing layer will consume weeks of frustrating debugging.

### What you can't replicate

- Ghost's 13-year open-source contributor ecosystem and theme marketplace
- Established sender reputation across millions of daily outgoing newsletter emails
- Legal non-profit foundation structure guaranteeing independence

## What it does

A full-featured open-source content management system and publishing platform with built-in email newsletters, audience segmentation, member management, and native paid subscriptions.

### Core features

- Rich block-style post editor with dynamic cards
- Handlebars-based theme templating engine
- Member database and audience segmentation with tags
- Email newsletter dispatch and bounce management
- Stripe integration for tiered recurring memberships
- Content API and Admin API for headless implementations
- ActivityPub / Fediverse social web distribution
- Member referral program and custom discount offers

## The business

### Pricing

- Starter: $18/mo — For solo blogs & newsletters (billed yearly)
- Publisher: $29/mo — For custom publications (billed yearly)
- Business: $199/mo — For teams scaling up (billed yearly)

Founded 2013.
Team size: ~35-40.

## The hard parts

- Email deliverability infrastructure: managing bulk sending, SPF/DKIM/DMARC alignment, and reputation monitoring without burning sender domains
- Theme sandboxing and rendering: executing custom Handlebars templates safely against the Content API without allowing server exploits
- Billing sync: reconciling complex Stripe recurring webhooks with local member states, upgrades, cancellations, and trials
- ActivityPub federation: implementing decentralized follow/inbox/outbox protocols to sync posts across Mastodon and Threads

## How to vibe code Ghost

### Prerequisites

- Node.js (free): Required runtime for executing the core server application and building frontend assets.
- GitHub (free): Version control and repository hosting for your codebase.
- Stripe account (free): Required for testing webhook events and recurring membership billing.

### Recommended AI tools

- Claude Code: Best-in-class multi-file agentic coding tool for scaffolding full-stack Node.js and Next.js features directly from your terminal.
- Cursor: Ideal AI-native editor for reviewing complex database schemas, UI components, and debugging template rendering edge cases.

### Stack

- Frontend: Next.js with Tailwind CSS
- Backend: Node.js with Express or Next.js API routes
- Database: Turso (SQLite at the edge for lightweight storage)
- Auth: better-auth
- Payments: Stripe API
- Other: Resend for transactional emails, PostHog for analytics

### Hosting

- Fly.io (Hosting the Node.js backend and persistent SQLite database volume): $5/mo
- Vercel (Hosting the Next.js publication frontend and creator admin dashboard): $0-20/mo

### Build guide

1. **Project Scaffolding & Database Schema** — Initialize a full-stack Next.js project with Tailwind CSS, configure Turso or local SQLite with Drizzle ORM, and set up the core data models for posts, members, tags, and settings.

```
Initialize a Next.js project with TypeScript and Tailwind CSS. Configure Drizzle ORM connected to SQLite. Create database schemas for users, posts (title, slug, markdown/lexical content, status, published_at), members (email, status, name), tags, and settings. Ensure proper foreign key constraints, indexes on post slugs, and a seed script with sample publishing data. Verify the setup runs locally without errors.
```

2. **Authentication & Staff Roles** — Implement authentication using better-auth to manage administrator, editor, and author roles for secure access to the publishing dashboard.

```
Integrate better-auth into the Next.js application supporting email/password sign-in. Set up database tables for sessions and accounts. Implement role-based access control middleware ensuring only users with 'Administrator' or 'Editor' roles can access the /ghost admin dashboard routes, while 'Authors' can only manage their own posts.
```

3. **Creator Admin Dashboard & Editor** — Build a clean publishing interface equipped with post management, metadata settings, and a rich markdown/block editor.

```
Build a creator admin dashboard with a post list view (draft, scheduled, published tabs), a post creation screen with a title input, markdown editor workspace, excerpt field, and SEO metadata settings. Implement autosave functionality using React hooks and debounced API calls to persist drafts.
```

4. **Public Frontend & Theme Layout** — Create the public-facing publication theme rendering published posts, tag archives, and author pages with responsive styling.

```
Build the public-facing theme routes in Next.js: a homepage displaying a paginated grid of published posts with featured hero items, dynamic individual post pages rendering rich markdown content with syntax highlighting, tag archive pages, and clean typography matching professional publishing standards.
```

5. **Membership Signups & Audience Tags** — Add native member subscription forms to capture reader emails and segment audiences using tags.

```
Build a newsletter subscription card component that captures reader emails on public post pages. Create an API route that stores new members in the database, sends a magic link or confirmation email via Resend, and supports tagging members for audience segmentation in the admin members view.
```

6. **Stripe Subscriptions & Webhooks** — Integrate Stripe Checkout to handle paid recurring membership tiers and sync subscription states via secure webhooks.

```
Implement Stripe Checkout integration for monthly and yearly premium membership tiers. Create API endpoints to generate checkout sessions for logged-in members. Build a robust Stripe webhook handler to process customer.subscription.created, updated, and deleted events, updating member tier and status fields in the database accordingly.
```

7. **Email Newsletter Dispatch Engine** — Develop a newsletter sending pipeline that converts published posts into responsive email templates and dispatches them to segmented members.

```
Build an email newsletter dispatch workflow. When an administrator publishes a post, provide an option to send it as an email newsletter. Create an HTML email template converter using React Email or Handlebars, and implement a background batch-sending mechanism using Resend API that tracks delivery status and records open/click metrics.
```

### Cost vs paying

**Starting costs (one-time):**

- Custom domain registration: $12
- Total: ~$12 one-time

**Ongoing costs (monthly):**

- Fly.io backend hosting: $5/mo
- Resend email overages (if exceeding free tier): $0-20/mo
- Total: ~$5-25/mo

- Paying for the SaaS instead: $29/mo (Publisher plan)
- Build time: 60-80 hours
- AI tool credits: $20 (Claude Pro)
- Break-even: Not financially sensible; build strictly for open-source learning and control

## Sources

- [Ghost Official Website](https://ghost.org)
- [Ghost Pricing Page](https://ghost.org/pricing/)
- [Ghost About & Foundation Page](https://ghost.org/about/)