Quick Start
Prerequisites
Section titled “Prerequisites”- Node.js 22 LTS — WollyCMS uses
better-sqlite3which requires native compilation. Node 22 LTS is tested and recommended. If you hit build errors on newer Node versions (e.g. v25), switch to Node 22 or use PostgreSQL instead (DATABASE_URL=postgresql://...in your.env).
Create a new project
Section titled “Create a new project”npx create-wolly my-sitecd my-siteThis scaffolds a new WollyCMS project with:
package.jsonwith@wollycms/serverdependency.envwith a generated JWT secret.gitignore,.env.example,docker-compose.ymldata/anduploads/directories
Install and run
Section titled “Install and run”npm installnpm run migratenpm run seednpm run devYour CMS is now running:
- API: http://localhost:4321
- Admin UI: http://localhost:4321/admin
Default login: admin@wollycms.local / admin123
Create your Astro frontend
Section titled “Create your Astro frontend”In a separate directory, create an Astro project:
npm create astro@latest my-frontendcd my-frontendnpm install @wollycms/astroConnect to WollyCMS
Section titled “Connect to WollyCMS”Create src/lib/wolly.ts:
import { createClient } from '@wollycms/astro';
export const wolly = createClient({ apiUrl: 'http://localhost:4321/api/content',});Create the block mapping
Section titled “Create the block mapping”Create src/lib/blocks.ts:
// Map CMS block type slugs to Astro componentsexport { default as hero } from '../blocks/Hero.astro';export { default as rich_text } from '../blocks/RichText.astro';export { default as image } from '../blocks/ImageBlock.astro';// Add more as you create block componentsCreate a catch-all route
Section titled “Create a catch-all route”Create src/pages/[...slug].astro:
---import Layout from '../layouts/Default.astro';import BlockRenderer from '@wollycms/astro/components/BlockRenderer.astro';import { wolly } from '../lib/wolly';import * as blocks from '../lib/blocks';
const slug = Astro.params.slug || 'home';const page = await wolly.pages.getBySlug(slug);---
<Layout title={page.title}> <BlockRenderer blocks={page.regions.hero ?? []} components={blocks} /> <BlockRenderer blocks={page.regions.content ?? []} components={blocks} /></Layout>Create your first block component
Section titled “Create your first block component”Create src/blocks/Hero.astro:
---const { fields } = Astro.props;---
<section> <h1>{fields.heading}</h1> {fields.description && <p>{fields.description}</p>}</section>Troubleshooting
Section titled “Troubleshooting”npm install fails with better-sqlite3 errors
Section titled “npm install fails with better-sqlite3 errors”WollyCMS uses better-sqlite3, a native Node.js module that requires compilation. If the prebuilt binary isn’t available for your platform, it falls back to compiling from source.
Fix: Use Node.js 22 LTS (the tested and recommended version):
nvm install 22nvm use 22npm install # retryFix: Install build tools (if compilation is needed):
# Ubuntu / Debiansudo apt install build-essential python3
# macOSxcode-select --install
# Windowsnpm install -g windows-build-toolsFix: Rebuild native modules (if npm install succeeded but commands still fail):
npm rebuild better-sqlite3Alternative: Use PostgreSQL instead (no native modules required):
Edit .env and change DATABASE_URL:
DATABASE_URL=postgresql://user:password@localhost:5432/wollycmsPostgreSQL support is built in — no additional packages needed.
npm run migrate fails with “Can’t find meta/_journal.json” or “migrations folder not found”
Section titled “npm run migrate fails with “Can’t find meta/_journal.json” or “migrations folder not found””This means the migration files inside @wollycms/server weren’t extracted correctly during install. This can happen on Windows, especially with spaces in the project path.
Fix: Reinstall from scratch:
rm -rf node_modules package-lock.jsonnpm installnpm run migrateFix: Move your project to a path without spaces (if reinstall doesn’t help):
# Instead of C:\Web Dev\Projects\my-siteVerify the file exists:
# The journal file should be at:node_modules/@wollycms/server/drizzle/meta/_journal.jsonCommands fail with MODULE_NOT_FOUND or Cannot find module
Section titled “Commands fail with MODULE_NOT_FOUND or Cannot find module”Check your Node.js version:
node -v # Should be v22.x.xWollyCMS requires Node.js 22 LTS. Other versions may have incompatible native module binaries.
Server starts but admin UI shows a blank page
Section titled “Server starts but admin UI shows a blank page”Clear your browser cache or try an incognito window. The admin UI is a SvelteKit SPA bundled with the server — it should load at http://localhost:4321/admin.
Next steps
Section titled “Next steps”- Core Concepts — Learn about pages, blocks, and regions
- Astro Integration — Full setup guide for the
@wollycms/astropackage - Deployment — Deploy to Cloudflare Workers, Docker, or Node.js