Skip to main content
Kleap provides built-in hosting by default (your site goes live automatically at https://your-app.kleap.io). But you own your code — it’s a standard Astro project, so you can build it and host it anywhere that serves static or edge sites.
Self-hosting means hosting the static Astro build. Features backed by Kleap services — Kleap Database, KleapForm submissions, and built-in user accounts — are provided by Kleap. If your site uses them, keeping the site on Kleap Hosting is simplest; self-hosted copies would need those services to stay reachable.

Getting Your Code

Export to GitHub

  1. Connect GitHub in settings
  2. Push your code to a repository
  3. Clone the repository locally

Download ZIP

  1. Go to Settings > Export
  2. Click Download ZIP
  3. Extract and open in your editor

Running Locally

Prerequisites

  • Node.js 18.20.8+ (or 20+/22+)
  • npm or pnpm

Setup

Visit http://localhost:4321 (Astro’s default dev port).

Build for Production

Astro outputs a static site to the dist/ folder:

Hosting Options

Any static or edge host works. Point it at the dist/ output.

Cloudflare Pages

  1. Connect your GitHub repo
  2. Build command: npm run build
  3. Output directory: dist

Netlify

Vercel

  1. Import the GitHub repo
  2. Vercel auto-detects Astro
  3. Output directory: dist

Static Host / VPS

dist/ is plain static files — serve it with Nginx, Caddy, an S3 bucket + CDN, GitHub Pages, or any static host.

Environment Variables

Astro exposes variables prefixed with PUBLIC_ to the browser via import.meta.env. If your site calls any external service, set its variables in your hosting platform:
Never commit .env files. Add them to .gitignore and configure secrets in your hosting platform.

Custom Domains

On Kleap Hosting

If you stay on Kleap, point your domain with an A record to Kleap’s proxy:
Use an A record on the root/apex domain (root domains can’t use CNAME), keep Cloudflare DNS in DNS-only mode if you use Cloudflare, and Kleap issues SSL automatically. You can also buy a domain directly in-app.

On Your Own Host

Most platforms support custom domains from their dashboard:
  1. Add the domain in your host’s dashboard
  2. Configure DNS per that host’s instructions (A record for root, CNAME for subdomains)
  3. SSL is usually automatic

CI/CD Setup

GitHub Actions

Monitoring

Analytics

Add analytics by including their script in your base layout:
  • Plausible - Privacy-focused
  • Google Analytics - Comprehensive
  • PostHog - Product analytics

Uptime Monitoring

  • UptimeRobot - Free monitoring
  • Pingdom - Professional monitoring
  • Better Uptime - Status pages

Performance

A static Astro build is already fast — it ships HTML with minimal JavaScript (React only hydrates the interactive islands). To go further:
  • Put a CDN in front of your static host (Cloudflare, CloudFront, Fastly)
  • Keep images optimized and lazy-loaded
  • Limit interactive islands to what actually needs them

Comparison

PlatformEaseCostControl
Kleap Hosting⭐⭐⭐IncludedLow
Cloudflare Pages⭐⭐⭐Free tierMedium
Netlify⭐⭐⭐Free tierMedium
Static host / VPS$Full

Troubleshooting

  • Check the Node.js version (18.20.8+, or 20+/22+)
  • Verify all dependencies install (npm ci)
  • Check any required environment variables are set
  • Review build logs for the specific error
  • Make sure the publish/output directory is set to dist
  • Serve dist/ at the site root, not a subfolder
  • Check your host supports clean URLs for static files
  • Forms, Kleap Database, and accounts are Kleap-backed services
  • Self-hosted copies need those services to remain reachable, or you’ll need to replace them
  • Keeping the site on Kleap Hosting avoids this entirely

Publishing with Kleap

The easiest deployment option