Self-Hosting Overview
Deploy the complete Scry stack on your own infrastructure.
Why Self-Host?
- Data Control - Keep your Storybook builds on your infrastructure
- Custom Domain - Use your own domain for deployments
- Integration - Connect to your existing auth and storage systems
- Compliance - Meet internal security requirements
Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ Self-Hosted Scry Stack │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │
│ │ Dashboard │ │ Upload Service │ │ CDN Service │ │
│ │ (Vercel) │ │ (Workers) │ │ (Workers) │ │
│ └───────┬────────┘ └───────┬────────┘ └───────┬────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ Firebase (Firestore) │ │
│ │ • User authentication │ │
│ │ • Project data │ │
│ │ • API keys │ │
│ │ • Build metadata │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ Cloudflare (R2 + KV) │ │
│ │ • R2: ZIP file storage │ │
│ │ • KV: Central directory cache │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘Components
| Component | Deployment | Purpose |
|---|---|---|
| Dashboard | Vercel / Any Node.js host | Project management, API keys |
| Upload Service | Cloudflare Workers | File uploads, build tracking |
| CDN Service | Cloudflare Workers | File serving |
| Firebase | Google Cloud | Authentication, database |
| Cloudflare R2 | Cloudflare | ZIP file storage |
| Cloudflare KV | Cloudflare | Metadata caching |
Prerequisites
Before starting, you'll need:
- [ ] Cloudflare account with Workers, R2, and KV enabled
- [ ] Firebase project with Firestore and Authentication enabled
- [ ] GitHub OAuth app (for dashboard authentication)
- [ ] Domain name (for custom URLs)
- [ ] Node.js 18+ and pnpm installed locally
Deployment Order
Deploy components in this order:
- Firebase - Set up authentication and database
- Cloudflare R2 & KV - Create storage resources
- Upload Service - Deploy to Cloudflare Workers
- CDN Service - Deploy to Cloudflare Workers
- Dashboard - Deploy to Vercel
- DNS - Configure custom domains
Quick Links
- Prerequisites - Detailed requirements
- Complete Setup - Step-by-step guide
- Cloudflare Setup - R2, KV, Workers
- Firebase Setup - Auth, Firestore
- Vercel Deployment - Dashboard hosting
- Monitoring - Observability setup
Cost Estimation
| Service | Free Tier | Typical Usage |
|---|---|---|
| Cloudflare Workers | 100K requests/day | Usually free |
| Cloudflare R2 | 10 GB storage, 1M requests | ~$0.015/GB |
| Cloudflare KV | 100K reads/day | Usually free |
| Firebase Firestore | 50K reads/day | Usually free |
| Firebase Auth | 50K MAU | Usually free |
| Vercel | Hobby plan | Usually free |
Total for small team: $0-5/month
Alternative Setups
Minimal Setup (Workers Only)
Skip the Dashboard; manage API keys manually:
- Deploy Upload Service
- Deploy CDN Service
- Create API keys in Firebase Console
- Use CLI directly
Docker Setup
Run services as containers:
- Build Docker images
- Deploy to Kubernetes/ECS/etc.
- Use R2 via S3 SDK
- Same Firebase backend
On-Premises
Use MinIO instead of R2:
- Deploy MinIO cluster
- Configure Upload Service for S3 endpoint
- Configure CDN Service for MinIO
- Deploy everything on-prem
Next Steps
Start with Prerequisites to gather everything you need.