Deployment Guide
Because Kyro CMS is Astro-native and Edge-ready out-of-the-box, deploying it is virtually identical to deploying any standard Astro SSR application.
1. Environment Variables
Before deploying, ensure your target environment has the following variables configured:
# REQUIRED: Your database connection string (PostgreSQL, Neon, MongoDB, or SQLite)
KYRO_DATABASE_URL=postgresql://user:password@host:5432/kyro_cms
# OPTIONAL: Used to bootstrap your first admin user on a fresh database
KYRO_ADMIN_EMAIL=admin@yourdomain.com
KYRO_ADMIN_PASSWORD=SecurePassword123!2. Vercel (Serverless & Edge Ready)
Vercel provides seamless deployment for Astro and Kyro CMS.
Deployment Steps:
- Push your codebase to GitHub.
- Import the repository into Vercel.
- Ensure the framework preset is set to Astro.
- Add your
KYRO_DATABASE_URLunder Vercel Environment Variables. - Click Deploy.
Node.js Serverless vs Vercel Edge:
- Node.js Serverless (Default): Fully compatible out-of-the-box with all Kyro database adapters (SQLite, PostgreSQL, MongoDB).
- Vercel Edge: Use Edge-native HTTP adapters such as
createNeonAdapter()orcreateTursoAdapter()for edge-compatible database connections.
Edge Setup Example (kyro.config.ts):
import { defineKyroConfig, createTursoAdapter } from '@kyro-cms/core';
export default defineKyroConfig({
adapter: createTursoAdapter({
url: process.env.TURSO_DATABASE_URL!,
authToken: process.env.TURSO_AUTH_TOKEN,
}),
});3. Cloudflare Workers / Pages
Kyro CMS runs natively on Cloudflare Workers and Pages Edge runtimes without native Node.js binary dependencies.
- Install the Cloudflare Astro adapter:
pnpm add @astrojs/cloudflare - Configure
astro.config.mjs:javascriptimport { defineConfig } from 'astro/config'; import cloudflare from '@astrojs/cloudflare'; import kyro from '@kyro-cms/astro'; import { kyroAdmin } from '@kyro-cms/admin/integration'; export default defineConfig({ output: 'server', adapter: cloudflare(), integrations: [kyro(), kyroAdmin()], }); - Deploy with Wrangler:
pnpm dlx wrangler pages deploy
4. Railway
Railway makes it simple to provision a PostgreSQL database and host your Kyro CMS application simultaneously.
- Install Railway CLI:
npm i -g @railway/cli - Authenticate:
railway login - Provision PostgreSQL:
railway add→ Select PostgreSQL. - Deploy:
railway up
5. Docker (VPS / AWS / DigitalOcean)
For hosting on custom infrastructure, Docker provides a production-ready container setup using docker-compose.yml:
version: '3.8'
services:
web:
build: .
ports:
- "4321:4321"
environment:
- KYRO_DATABASE_URL=postgresql://kyro:kyro@db:5432/kyro
depends_on:
- db
db:
image: postgres:15-alpine
environment:
- POSTGRES_USER=kyro
- POSTGRES_PASSWORD=kyro
- POSTGRES_DB=kyro
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata:To run: docker-compose up -d
6. Database Migrations
During build or CI/CD pipelines, run the Kyro CLI migration command to keep database schemas in sync:
npx kyro db migrateIMPORTANT
This command only applies to Drizzle-based adapters. Under the hood, kyro db migrate runs drizzle-kit migrate, which requires a valid drizzle.config.ts in your project root.
Adapter Compatibility
| Adapter | Migrations Required? | kyro db migrate |
|---|---|---|
createDrizzleAdapter (PostgreSQL) | ✅ Yes | ✅ Supported |
createNeonAdapter (Neon PostgreSQL) | ✅ Yes | ✅ Supported |
createTursoAdapter (Turso / libSQL) | ✅ Yes | ✅ Supported |
createLocalAdapter (SQLite) | ❌ No — schema is managed automatically | Not needed |
createMongoDBAdapter (MongoDB) | ❌ No — MongoDB is schemaless | Not applicable |
For PostgreSQL-based adapters, you should also generate migration files whenever your collections change:
# Generate migration files from schema changes
npx kyro db generate
# Apply pending migrations
npx kyro db migrate