One-Click Deploy
Deploy to Railway
Click to deploy tinykit to Railway in under 5 minutes.
What You’ll Need
- A Railway account (free tier available)
- An AI API key from one of:
- Anthropic (Claude)
- OpenAI (GPT-4)
- Google AI Studio (Gemini)
Step-by-Step Setup
1
Click Deploy Button
Click the “Deploy to Railway” button above, or go to the tinykit Railway template.
2
Configure Environment Variables
Railway will prompt you to set environment variables:
Example configuration:
| Variable | Required | Description |
|---|---|---|
LLM_PROVIDER | Yes | anthropic, openai, or gemini |
LLM_API_KEY | Yes | Your API key |
LLM_MODEL | No | Model name (defaults to provider’s best) |
POCKETBASE_ADMIN_EMAIL | Yes | Admin email for database |
POCKETBASE_ADMIN_PASSWORD | Yes | Admin password (min 8 chars) |
3
Deploy
Click “Deploy” and wait 2-3 minutes for the build to complete.
4
Access Your Instance
Once deployed, Railway provides a URL like
your-app.railway.app.- Builder:
your-app.railway.app/tinykit - Production apps:
your-app.railway.app/
Adding Custom Domains
1
Open Railway Settings
Go to your Railway project → Settings → Domains
2
Add Domain
Click “Add Domain” and enter your domain (e.g.,
app.yourdomain.com)3
Configure DNS
Add a CNAME record pointing to your Railway URL:
4
Wait for SSL
Railway automatically provisions SSL certificates. This takes 1-5 minutes.
Persistent Storage
Railway automatically persists thepocketbase/pb_data directory. Your data survives:
- Redeploys
- Restarts
- Sleep/wake cycles
Costs
| Plan | Monthly Cost | Includes |
|---|---|---|
| Hobby | ~$5 | 500 hours, 1GB storage |
| Pro | $20 base | Unlimited hours, more resources |
Updating Your Deployment
Automatic Updates
Fork the tinykit repository and connect it to Railway for automatic deployments on push.Manual Updates
- Go to your Railway project
- Click “Redeploy” to pull the latest changes
Environment Variables Reference
| Variable | Default | Description |
|---|---|---|
LLM_PROVIDER | - | AI provider: anthropic, openai, gemini, ollama, zai |
LLM_API_KEY | - | Your AI API key |
LLM_MODEL | varies | Model to use (e.g., claude-sonnet-4-20250514) |
LLM_BASE_URL | - | Custom API endpoint (for OpenAI-compatible providers) |
POCKETBASE_ADMIN_EMAIL | - | Pocketbase admin email |
POCKETBASE_ADMIN_PASSWORD | - | Pocketbase admin password |
PORT | 3000 | Server port (Railway sets this automatically) |
HOST | 0.0.0.0 | Server host |
Troubleshooting
Deploy fails with 'Pocketbase failed to start'
Deploy fails with 'Pocketbase failed to start'
Check that your
POCKETBASE_ADMIN_EMAIL and POCKETBASE_ADMIN_PASSWORD are set. The password must be at least 8 characters.AI responses return errors
AI responses return errors
Verify your
LLM_API_KEY is correct and has credits. Check the Railway logs for specific error messages.Custom domain shows SSL error
Custom domain shows SSL error
Wait 5-10 minutes for SSL provisioning. If it persists, verify your DNS records are correct.
Data disappeared after redeploy
Data disappeared after redeploy
Railway should persist
/pocketbase/pb_data. If data is lost, check that you haven’t accidentally removed the volume in Railway settings.App is slow to respond
App is slow to respond
Railway’s free tier sleeps after inactivity. The first request after sleep takes 10-20 seconds. Upgrade to a paid plan for always-on performance.
Logs and Monitoring
Access logs from the Railway dashboard:- Go to your project
- Click on the service
- View “Deployments” for build logs
- View “Logs” for runtime logs
Starting Pocketbase...→ Database startupPocketbase is ready!→ Database readyStarting SvelteKit server...→ App startup