Deploy as a Website

Deploy your systemprompt template to production with user authentication, custom domains, and SSL. Ship your AI agents to real users.

Ship your systemprompt template to production. This guide walks you through deploying to systemprompt.io Cloud with user authentication and optional custom domains.

Prerequisites

  • Working local instance (just start runs successfully)
  • GitHub or Google account (for cloud authentication)
  • Optional: Custom domain with DNS access

Step 1: Register and Login

First, authenticate with systemprompt.io Cloud:

systemprompt cloud auth login

This opens your browser for GitHub or Google OAuth. Registration is free and grants you:

  • Cloud tenant hosting
  • Managed PostgreSQL database
  • Wildcard SSL on *.systemprompt.io
  • Basic usage tier

Step 2: Create a Cloud Tenant

Create your production tenant:

# Create a cloud tenant (provisions managed database)
systemprompt cloud tenant create --region iad

# Available regions:
# iad - US East (Virginia)
# sjc - US West (San Jose)
# ams - Europe (Amsterdam)

This provisions:

  • Dedicated PostgreSQL database
  • Subdomain: {tenant-id}.systemprompt.io
  • SSL certificate (automatic)

View your tenant details:

systemprompt cloud tenant show

Step 3: Create Production Profile

Set up your production profile:

systemprompt cloud profile create production

Your profile will use the cloud-managed database. No DATABASE_URL configuration needed.

Add any required secrets:

# Add AI provider API key
systemprompt cloud secrets set ANTHROPIC_API_KEY --profile production

# Add other secrets as needed
systemprompt cloud secrets set OPENAI_API_KEY --profile production

Step 4: Deploy

Deploy with a single command:

systemprompt cloud deploy --profile production

What happens:

  1. Validate - Check configuration for errors
  2. Build - Create Docker image (Rust compilation)
  3. Push - Upload to systemprompt registry
  4. Deploy - Start containers, zero-downtime
  5. Sync - Push configuration to cloud database

Watch the deployment progress in real-time. First deployment takes 3-5 minutes.

Step 5: Verify Deployment

Check your deployment status:

# View status
systemprompt cloud status

# Check logs
systemprompt cloud logs -f

# Visit your site
open https://{tenant-id}.systemprompt.io

Enable User Authentication

Your deployed site includes OAuth2 authentication. Users can:

  • Register with email/password
  • Login with GitHub or Google
  • Use WebAuthn (passkeys)

Configure authentication options in services/web/config/site.yaml:

auth:
  enabled: true
  providers:
    - github
    - google
  registration:
    enabled: true
    require_email_verification: true

To set up OAuth providers, add client credentials:

# GitHub OAuth
systemprompt cloud secrets set GITHUB_CLIENT_ID --profile production
systemprompt cloud secrets set GITHUB_CLIENT_SECRET --profile production

# Google OAuth
systemprompt cloud secrets set GOOGLE_CLIENT_ID --profile production
systemprompt cloud secrets set GOOGLE_CLIENT_SECRET --profile production

Then redeploy:

systemprompt cloud deploy --profile production --skip-build

Custom Domain Setup

Step 1: Add Domain to Cloud

systemprompt cloud domains add yourdomain.com

Step 2: Configure DNS

Add these DNS records at your domain registrar:

Type Name Value
CNAME www {tenant-id}.systemprompt.io
CNAME @ {tenant-id}.systemprompt.io

For root domains (apex), some DNS providers require an ALIAS or ANAME record instead of CNAME.

Step 3: Verify and Enable SSL

# Verify DNS propagation
systemprompt cloud domains verify yourdomain.com

# SSL is provisioned automatically after verification
systemprompt cloud certs list

DNS propagation can take up to 48 hours, though it's usually much faster.

Update and Redeploy

After making changes locally:

# Test locally first
just build
systemprompt infra services restart --all

# Deploy updates
systemprompt cloud deploy --profile production

For faster deploys when only configuration changed:

systemprompt cloud deploy --profile production --skip-build

Rollback

If something goes wrong:

# Immediate rollback to previous version
systemprompt cloud rollback

# Rollback to specific version
systemprompt cloud rollback --version v1.2.3

# View deployment history
systemprompt cloud history

CI/CD Integration

GitHub Actions

Create .github/workflows/deploy.yml:

name: Deploy to Production
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-action@stable

      - name: Install SystemPrompt CLI
        run: cargo install systemprompt

      - name: Login to Cloud
        run: systemprompt cloud auth login --token ${{ secrets.SP_CLOUD_TOKEN }}

      - name: Deploy
        run: systemprompt cloud deploy --profile production

Generate a deployment token:

systemprompt cloud tokens create --name "github-actions" --scope deploy

Add the token as a GitHub secret named SP_CLOUD_TOKEN.

Troubleshooting

Build fails

# Test build locally first
cargo build --release -p systemprompt-cli

# Check build logs in cloud
systemprompt cloud logs --build

Site unreachable

# Check deployment status
systemprompt cloud status

# View recent logs
systemprompt cloud logs --lines 100

# Check health endpoint
curl https://{tenant-id}.systemprompt.io/health

Authentication not working

  1. Verify OAuth providers are configured in site.yaml
  2. Check callback URLs match your domain
  3. Ensure client ID and secret are set correctly
systemprompt cloud secrets list --profile production

Pricing

Tier Price Includes
Free $0/mo 1 tenant, shared resources, 1GB database
Pro $29/mo 3 tenants, dedicated resources, 10GB database
Enterprise Contact Unlimited, SLA, custom domains, support

View current usage:

systemprompt cloud usage

Next Steps