DEV Community

Alex Spinov
Alex Spinov

Posted on

Keystatic Has a Free Git-Based CMS — Here's How to Use It

Headless CMS platforms charge per seat. WordPress needs a server. Keystatic stores content in your Git repo — edit with a beautiful admin UI, deploy anywhere, pay nothing.

What Is Keystatic?

Keystatic is a CMS that stores content as files (Markdown, JSON, YAML) in your Git repository. It provides a polished admin interface for editing — but all data lives in your repo.

Quick Start

npm create @keystatic@latest
Enter fullscreen mode Exit fullscreen mode
// keystatic.config.tsx
import { config, fields, collection } from '@keystatic/core';

export default config({
  storage: { kind: 'local' }, // or 'github' for direct GitHub editing

  collections: {
    posts: collection({
      label: 'Blog Posts',
      slugField: 'title',
      path: 'content/posts/*',
      format: { contentField: 'content' },
      schema: {
        title: fields.slug({ name: { label: 'Title' } }),
        date: fields.date({ label: 'Date' }),
        author: fields.text({ label: 'Author' }),
        tags: fields.array(fields.text({ label: 'Tag' }), {
          label: 'Tags',
          itemLabel: (props) => props.value,
        }),
        featured: fields.checkbox({ label: 'Featured post' }),
        cover: fields.image({
          label: 'Cover image',
          directory: 'public/images/posts',
        }),
        content: fields.markdoc({ label: 'Content' }),
      },
    }),
  },
});
Enter fullscreen mode Exit fullscreen mode

How It Works

  1. Define your content schema in TypeScript
  2. Run Keystatic — get a beautiful admin UI
  3. Editors create/edit content through the UI
  4. Content saves as Markdown/JSON/YAML files in your repo
  5. Your framework reads these files at build time

GitHub Mode

export default config({
  storage: {
    kind: 'github',
    repo: 'owner/repo',
  },
  // ...
});
Enter fullscreen mode Exit fullscreen mode

Editors can manage content through the admin UI, and changes are committed directly to GitHub — even without local dev setup.

Why Keystatic

Feature Keystatic Contentful WordPress
Cost Free $$$ Hosting
Storage Git repo Cloud Database
Version control Git history Built-in Plugin
Offline editing Yes No No
Admin UI Beautiful Beautiful Classic
Lock-in None (files) API dependency Platform
Deploy Anywhere N/A PHP host

Framework Integration

Works with Astro, Next.js, Remix — any framework that reads files.

Get Started


Managing content from web sources? My Apify scrapers extract content for your CMS. Custom solutions: spinov001@gmail.com

Top comments (0)