โก Quick Start
Alpaca Cloud is an open-source backend platform โ your own Supabase, on your own infrastructure. Get a full Postgres database, REST API, auth, storage, edge functions, and realtime in seconds.
1. Create an account
Sign up at app.alpaca-cloud.com.
2. Choose your project type
- Backend โ Postgres database with Auth, Storage, Edge Functions, Realtime. Choose Shared (instant) or Dedicated VM.
- Frontend โ Static site / SPA hosting. Connect GitHub, deploy on every push.
- Apps โ Persistent Docker containers. Any language, any framework.
3. Get your credentials (Backend projects)
Open your project โ Easy Connect:
- Project URL โ e.g.
https://my-project.alpaca-cloud.com - Anon key โ safe for frontend code
- Service role key โ admin access, server-side only
4. Query your database
npm install @alpacacloud/js
import { createClient } from '@alpacacloud/js'
const alp = createClient(
'https://my-project.alpaca-cloud.com',
'your-anon-key'
)
const { data, error } = await alp
.from('posts')
.select('id, title, author')
.eq('published', true)
.order('created_at', { ascending: false })
.limit(10)
๐๏ธ Project Types
Alpaca Cloud has three distinct project types, each for a different workload:
๐๏ธ Backend โ Shared Cluster
Instant provisioning. Your Postgres database runs on a shared, managed cluster. Best for development, small apps, and getting started quickly.
- Ready in seconds โ no VM to spin up
- Full Postgres 16, PostgREST REST API, Auth, Storage, Edge Functions, Realtime
- Subdomain:
yourproject.alpaca-cloud.com - Starts free; upgrade for more storage and connections
// Create via API
POST /projects
{ "name": "my-app", "backend_type": "shared" }
๐ฅ๏ธ Backend โ Dedicated VM
Your own Hetzner cloud server. Complete isolation โ no shared resources, no noisy neighbours. Best for production workloads requiring guaranteed performance or data residency.
- Takes 3โ8 minutes to provision (spins up a real VM)
- Full Postgres on your own server with root-level access available
- Same services: Auth, Storage, Edge Functions, Realtime
- Choose your server size (cpx11 โ cpx41)
- Higher cost โ you pay for the VM
POST /projects
{ "name": "prod-db", "backend_type": "dedicated", "plan": "pro" }
๐ Frontend Hosting
Static site and SPA hosting with GitHub auto-deploy. Like Vercel or Netlify, on Alpaca Cloud infrastructure.
- Connect a GitHub repo โ deploys automatically on every push
- Works with React, Vue, Next.js (static export), Svelte, Astro, plain HTML
- Subdomain:
yoursite.alpaca-cloud.com - Auto-SSL, instant global delivery
POST /projects
{ "name": "my-site", "backend_type": "frontend" }
๐ App Hosting (Docker containers)
Persistent Docker containers for any language or framework. Like Fly.io, on Alpaca Cloud infrastructure.
- Add a
Dockerfileto your project โ any language works - Your app must read
process.env.PORTโ Alpaca assigns the port - Subdomain:
yourapp.alpaca-cloud.com - Auto-SSL, live logs, env vars, health checks
- Shared compute tier: 0.5 vCPU, 512MB RAM
POST /projects
{ "name": "my-api", "backend_type": "app" }
๐ Authentication
All Management API requests require a Bearer token. Project API keys (anon/service_role) are separate โ used to access the PostgREST database REST API directly.
User JWT (session token)
POST https://app.alpaca-cloud.com/auth/login
Content-Type: application/json
{ "email": "you@example.com", "password": "yourpassword" }
โ { "token": "eyJ...", "user": { ... } }
Authorization: Bearer eyJ...
Personal Access Token (PAT)
Go to Dashboard โ Settings โ API Tokens โ create a token. PATs don't expire โ good for CI/CD and scripts.
Authorization: Bearer pat_...
Project API Keys (anon / service_role)
Each backend project has two keys for accessing its PostgREST API:
- anon key โ respects Row Level Security. Safe for frontend.
- service_role key โ bypasses RLS. Server-side only โ never expose to clients.
๐ฆ JavaScript SDK
npm install @alpacacloud/js
Initialize
import { createClient } from '@alpacacloud/js'
const alp = createClient('https://your-project.alpaca-cloud.com', 'your-anon-key')
Database
const { data } = await alp.from('users').select('*').eq('active', true)
await alp.from('posts').insert({ title: 'Hello', body: '...' })
await alp.from('posts').update({ published: true }).eq('id', 42)
await alp.from('posts').delete().eq('id', 42)
// Filters: eq, neq, gt, gte, lt, lte, like, ilike, in, is, not
Auth
const { user } = await alp.auth.signUp({ email, password })
const { user, token } = await alp.auth.signIn({ email, password })
await alp.auth.signOut()
const user = alp.auth.user()
Storage
await alp.storage.from('avatars').upload('user.png', file, { contentType: 'image/png' })
const url = alp.storage.from('avatars').getPublicUrl('user.png')
const { data } = await alp.storage.from('avatars').download('user.png')
Realtime
const channel = alp.realtime.channel('room:chat')
.on('broadcast', { event: 'message' }, ({ payload }) => console.log(payload))
.subscribe()
channel.send({ type: 'broadcast', event: 'message', payload: { text: 'hello' } })
Edge Functions
const { data } = await alp.functions.invoke('my-function', { body: { name: 'world' } })
Python SDK
pip install alpaca-cloud
from alpaca_cloud import create_client
alp = create_client("https://your-project.alpaca-cloud.com", "your-anon-key")
response = alp.table('posts').select('id, title').eq('published', True).execute()
Flutter SDK
flutter pub add alpaca_cloud_flutter
import 'package:alpaca_cloud_flutter/alpaca_cloud.dart';
AlpacaCloud.initialize(url: 'https://your-project.alpaca-cloud.com', anonKey: 'your-anon-key');
final data = await AlpacaCloud.instance.client.from('posts').select('id, title').eq('published', true);
๐ Frontend Hosting
Deploy static sites and single-page apps (SPAs) with GitHub auto-deploy. Every push to your main branch goes live automatically.
Supported Frameworks
- React โ build command:
npm run build, output:dist/ - Vue โ build command:
npm run build, output:dist/ - Next.js โ static export only (
next export), output:out/ - Svelte / SvelteKit โ adapter-static, output:
build/ - Astro โ output:
dist/ - Plain HTML / Vanilla JS โ no build step needed
Setup
- Create a Frontend project in the dashboard (Frontend tab โ New Project)
- Connect your GitHub repo via the Integrations tab
- Set your build command (e.g.
npm run build) and output directory (e.g.dist) - Every push to your production branch triggers an automatic build and deploy
Build Flow
git push origin main
โ Alpaca clones your repo
โ runs install_command (e.g. npm install)
โ runs build_command (e.g. npm run build)
โ deploys output_dir (e.g. dist/) to static hosting
โ live at yoursite.alpaca-cloud.com
Manual Deploy (via API)
POST /projects/:id/frontend/deploy
Content-Type: application/json
{ "branch": "main" }
Custom Domains
Your site is always available at yoursite.alpaca-cloud.com. Custom domain support is on the roadmap.
๐ App Hosting (Docker containers)
Run any Dockerized application as a persistent container with a public HTTPS URL. Node.js, Python, Go, Ruby, anything โ if it has a Dockerfile, it deploys.
Requirements
- A
Dockerfilein your project root - Your app must listen on the port from
process.env.PORT(Alpaca assigns this โ do not hardcode a port)
Quick Start
- Create an App project in the dashboard (Apps tab โ New App)
- Open the project โ click Deploy
- Your app is live at
yourapp.alpaca-cloud.com
Dockerfile Example
FROM node:20-alpine
WORKDIR /app
COPY . .
RUN npm install
EXPOSE 8080
CMD ["node", "server.js"]
// Your server must read PORT from the environment:
const port = process.env.PORT || 8080;
app.listen(port);
Environment Variables
Set env vars in the project dashboard โ Settings tab. They're injected at container start.
Resource Limits (Shared Tier)
- CPU: 0.5 vCPU
- Memory: 512 MB RAM
- Public URL:
yourapp.alpaca-cloud.com - Auto-SSL, live logs, health checks included
๐ GitHub Auto-Deploy
Both Frontend and App Hosting projects support GitHub auto-deploy โ connect your repo once and every push triggers a deploy.
Setup
- Connect your GitHub account: Dashboard โ Integrations tab โ GitHub
- Open your project โ Overview โ GitHub tab
- Enter your repository URL and production branch
- Click Connect & enable auto-deploy
App Hosting Webhook URL (manual)
https://api.alpaca-cloud.com/projects/YOUR_PROJECT_ID/compute/github-webhook
Events: push, ping | Content-Type: application/json
Deploy Flow (App Hosting)
git push origin main
โ GitHub webhook fires
โ Alpaca pulls latest code on compute VM
โ docker build (fresh image)
โ docker run --restart unless-stopped
โ nginx updated โ app is live
๐ก Realtime
Subscribe to live database changes and broadcast messages to connected clients via WebSocket. Powered by Postgres logical replication โ no polling required.
Use cases
- Live dashboards and analytics
- Collaborative editing (multiple users, one document)
- Chat and messaging
- Presence (who is online right now)
- Real-time notifications
JavaScript SDK
import { createClient } from '@alpacacloud/js'
const alp = createClient(url, anonKey)
// Subscribe to broadcast messages
const channel = alp.realtime.channel('room:chat')
.on('broadcast', { event: 'message' }, ({ payload }) => {
console.log('New message:', payload)
})
.subscribe()
// Send a message
channel.send({ type: 'broadcast', event: 'message', payload: { text: 'hello' } })
// Presence โ see who is online
channel.on('presence', { event: 'join' }, ({ newPresences }) => {
console.log('joined:', newPresences)
})
WebSocket endpoint
wss://your-project.alpaca-cloud.com/realtime/v1/websocket?apikey=YOUR_ANON_KEY
โก Edge Functions
Serverless functions that run alongside your database on your project. Write server-side logic, webhooks, scheduled tasks, and APIs โ deployed in seconds from the dashboard or CLI.
Runtime
- Deno runtime โ TypeScript and JavaScript natively
- NPM-compatible (
npm:specifiers) - Secrets injected via environment variables (set in dashboard โ Vault)
Write a function
// functions/hello/index.ts
Deno.serve(async (req) => {
const { name } = await req.json()
return Response.json({ hello: name })
})
Deploy from dashboard
Dashboard โ your project โ Edge Functions tab โ paste code โ Deploy.
Invoke via SDK
const { data, error } = await alp.functions.invoke('hello', {
body: { name: 'world' }
})
// โ { hello: 'world' }
Invoke via HTTP
POST https://your-project.alpaca-cloud.com/functions/v1/hello
Authorization: Bearer <anon-key>
Content-Type: application/json
{ "name": "world" }
Secrets / Environment Variables
Add secrets in Dashboard โ Vault tab. Access them in functions with Deno.env.get('KEY').
๐ Plugin Marketplace
One-click integrations with popular services. Install a plugin on a project and it injects the API keys / config as environment variables โ available in your edge functions and server-side code.
Available Plugins
- Resend โ transactional email API
- Stripe โ payments and subscriptions
- OpenAI โ GPT, embeddings, and vision APIs
- Upstash Redis โ serverless Redis (rate limiting, caching, queues)
- Cloudflare Turnstile โ bot detection and CAPTCHA
- Loops โ marketing email automation
- Sentry โ error monitoring and alerting
- Trigger.dev โ background jobs and workflows
Installing a plugin
- Open your project โ Plugins tab
- Browse the marketplace and click Install
- Enter your API key for the service
- The key is stored in your project Vault and injected into edge functions automatically
Developer OAuth โ build your own plugin
Third-party developers can build Alpaca Cloud plugins using OAuth:
- Register your app at Dashboard โ Developers tab
- Get a
client_idandclient_secret - Users authorize your app via a consent screen at
/plugins/authorize - Exchange the code for a token and use the Plugin API to manage env vars and keys
๐ค MCP / AI Connect
Every Alpaca Cloud backend project includes a built-in MCP (Model Context Protocol) server โ letting AI assistants like Claude, Cursor, or any MCP-compatible tool interact with your database directly.
What the MCP server can do
- Run SQL queries against your database
- List tables and get schema information
- List, create, and delete auth users
- Get project info (URL, keys, status)
Claude Desktop config
// Get the config from your project โ Easy Connect โ MCP tab
// It will look like:
{
"mcpServers": {
"my-project": {
"command": "npx",
"args": ["-y", "@alpacacloud/mcp"],
"env": {
"ALPACA_PROJECT_URL": "https://my-project.alpaca-cloud.com",
"ALPACA_SERVICE_KEY": "your-service-role-key"
}
}
}
}
Easy Connect (any AI assistant)
Dashboard โ your project โ Easy Connect tab. Copy the prompt โ it includes your project URL, keys, and a description of your schema. Paste it into any AI assistant's system prompt and it can query, insert, and manage your database immediately.
MCP endpoint
GET /projects/:id/mcp โ returns endpoint info and Claude config
POST /projects/:id/mcp โ JSON-RPC 2.0 endpoint
Tools: run_sql, list_tables, get_table_schema,
list_auth_users, create_auth_user, delete_auth_user,
get_project_info
API Reference
Manage AlpacaBase projects, databases, auth, storage, and edge functions. Authenticate with: Authorization: Bearer <token> Get a token: POST /auth/login โ use the token โ or POST /tokens to create a PAT. Quick start: 1. POST /auth/login to get a token 2. POST /projects to create a project (backend_type: shared = instant) 3. Poll GET /projects/:id/status until status is healthy 4. Use postgrest_url from the project for your database REST API
Base URL: https://app.alpaca-cloud.com ยท Version: 1.4.0
System
/healthHealth check| Status | Description |
|---|---|
200 | {ok:true} |
/openapi.jsonThis OpenAPI spec| Status | Description |
|---|---|
200 | OpenAPI 3.0 JSON |
Auth
/auth/registerCreate account| Field | Type | Required | Description |
|---|---|---|---|
email | string | โ | |
password | string | โ | |
full_name | string |
| Status | Description |
|---|---|
201 | User created + JWT token |
/auth/loginLogin and get JWT| Field | Type | Required | Description |
|---|---|---|---|
email | string | โ | |
password | string | โ |
| Status | Description |
|---|---|
200 | {token:...,user:{...}} |
/auth/meGet current user| Status | Description |
|---|---|
200 | User profile |
/tokensList personal access tokens| Status | Description |
|---|---|
200 | Token list |
/tokensCreate a PAT| Field | Type | Required | Description |
|---|---|---|---|
name | string | ||
scopes | array |
| Status | Description |
|---|---|
201 | New PAT (shown once) |
Projects
/projectsList your projects| Status | Description |
|---|---|
200 | Array of project objects |
/projectsCreate a projectCreates a new AlpacaBase project.
Valid regions: eu-central, eu-west, eu-north, us-east, us-west, ap-south
Valid plans: free, starter, pro, team, enterprise
| Field | Type | Required | Description |
|---|---|---|---|
name | string | โ | 3-30 chars, lowercase letters, numbers, hyphens only |
region | string (eu-central, eu-west, eu-north, us-east, us-west, ap-south) | default: eu-central | |
plan | string (free, starter, pro, team, enterprise) | default: free | |
backend_type | string (shared, dedicated, frontend) | shared=instant; dedicated=private VM 3-6 min; frontend=static site default: shared |
| Status | Description |
|---|---|
201 | Project object. If dedicated, poll /projects/:id/status until status=healthy |
/projects/{id}Get project details| Status | Description |
|---|---|
200 | Full project object with db_url, api keys, etc. |
/projects/{id}Update project settingsUpdate: repo_url, build_command, output_dir, install_command, production_branch, env_vars, email_notifications, slack_webhook, forms_enabled, webhook_secret
| Field | Type | Required | Description |
|---|---|---|---|
repo_url | string | ||
build_command | string | default: npm run build | |
output_dir | string | default: dist | |
install_command | string | default: npm install | |
production_branch | string | default: main | |
env_vars | Environment variables as {KEY: value} object (preferred) or [{key, value}] array. Both are accepted. | ||
email_notifications | boolean | ||
slack_webhook | string | ||
forms_enabled | boolean | ||
github_token | string | GitHub Personal Access Token (PAT) with `repo` scope. Required to deploy private repositories. Stored encrypted. Set to null to remove. Never returned in API responses โ only `has_github_token: true/false` is exposed. |
| Status | Description |
|---|---|
200 | Updated fields |
400 | No updatable fields or invalid request |
/projects/{id}Delete project and all resources| Status | Description |
|---|---|
200 | {ok:true} |
/projects/{id}/statusPoll provisioning status + service healthReturns status (provisioning|healthy|error) and per-service health.
For dedicated projects, probes each service and returns:
For shared projects, returns availability flags (storage: not available on shared).
For frontend, returns hosting status only.
| Status | Description |
|---|---|
200 | { status, services: { auth: { up, status, endpoint }, ... } } |
/projects/{id}/reprovisionRetry provisioning (dedicated, errored only)Re-creates the VM for a dedicated project that failed provisioning. Only works if no VM exists yet. For live projects, use /services/:service/restart instead.
| Status | Description |
|---|---|
200 | { ok: true, server_type, location } |
400 | Already has a running server, or not a dedicated project |
Database
/projects/{id}/queryExecute raw SQL| Field | Type | Required | Description |
|---|---|---|---|
sql | string | โ |
| Status | Description |
|---|---|
200 | Query results |
MCP
/projects/{id}/mcpMCP server infoGet Model Context Protocol endpoint info and Claude Desktop config for this project.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | โ | Project ID |
| Status | Description |
|---|---|
200 | MCP endpoint details and Claude config |
/projects/{id}/mcpMCP JSON-RPC endpointModel Context Protocol endpoint. Send JSON-RPC 2.0 messages. Auth: apikey header (service_role key). Tools: run_sql, list_tables, get_table_schema, list_auth_users, create_auth_user, delete_auth_user, get_project_info.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | โ |
| Field | Type | Required | Description |
|---|---|---|---|
jsonrpc | string | โ | |
id | integer | ||
method | string (initialize, tools/list, tools/call, ping) | โ | |
params | object |
| Status | Description |
|---|---|
200 | JSON-RPC response |
Frontend Hosting
/projects/{id}/deployTrigger a frontend build/deployTriggers a build and deploy for a frontend project.
Repository access:
repo_url via PATCH /projects/:idgithub_token (GitHub PAT with repo scope) set via PATCH /projects/:id. Without it, the clone step will fail with a 128 exit code (auth error). Set it once and it persists across deploys.Two ways to call:
1. Authenticated: Authorization: Bearer <token> header
2. GitHub webhook: POST /projects/:id/deploy?token=<webhook_secret> โ configure this URL in your GitHub repo Settings โ Webhooks โ Payload URL
Get your webhook_secret and webhook_url from GET /projects/:id.
Build flow: clone โ install (install_command) โ build (build_command) โ deploy output_dir to static hosting.
Track progress: Poll GET /projects/:id/status โ provision_message shows current step (Cloning, Installing, Building, Deployed).
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | query | string | Webhook secret for unauthenticated GitHub webhook calls |
| Status | Description |
|---|---|
200 | { ok: true, message: "Build triggered" } |
400 | Not a frontend project or no repo_url set |
401 | Unauthorized |
/projects/{id}/build-logsGet full build log for a frontend projectReturns the full stderr/stdout from the last failed build. The provision_message field on the project is limited to 500 chars; this endpoint returns the complete output.
For successful builds, has_logs will be false (logs are cleared on success).
Poll this endpoint after triggering a deploy to see live build progress.
| Status | Description |
|---|---|
200 | { has_logs: bool, raw: string, sections: [{section, content}] } |
404 | Project not found |
/projects/{id}/deploy-keyGenerate an SSH deploy key for private repos (alternative to github_token)Generates an SSH key pair for this project. Returns the public key to add to your GitHub repo under Settings โ Deploy Keys. The private key is stored server-side and used automatically during clones.
Use this as an alternative to github_token when you prefer not to store a PAT. Only one deploy key is active per project at a time.
| Status | Description |
|---|---|
200 | { public_key: "ssh-ed25519 AAAA...", fingerprint: "SHA256:...", note: "Add this public key to your repo deploy keys" } |
400 | Not a frontend project |
Discovery
/regionsList valid region IDsValid values: eu-central, eu-west, eu-north, us-east, us-west, ap-south
| Status | Description |
|---|---|
200 | Region list with names and datacenter locations |
/plansList plans with pricing and server specs| Status | Description |
|---|---|
200 | Plan list |
/backend-typesList backend types with provisioning timesshared=instant, dedicated=3-6min VM, frontend=static hosting
| Status | Description |
|---|---|
200 | Backend type descriptions |
Functions
/projects/{id}/functionsList edge functions/projects/{id}/functionsCreate edge function| Field | Type | Required | Description |
|---|---|---|---|
name | string | โ | |
code | string | โ | JavaScript/TypeScript function code |
/projects/{id}/functions/{funcId}/deployDeploy an edge function| Status | Description |
|---|---|
200 | Deployment status |
Services
/projects/{id}/servicesList service statuses (dedicated only)Returns systemd status for all services on a dedicated project VM: auth, postgrest, storage, realtime, nginx, postgres, pgbouncer.
| Status | Description |
|---|---|
200 | { services: { auth: { status, unit }, ... } } |
/projects/{id}/services/{service}/restartRestart a service on the VM (dedicated only)Restarts a named systemd service on the project VM via SSH.
Use this when a service returns 502 (e.g. auth, storage). Valid services: auth, postgrest, storage, realtime, nginx.
Dedicated projects only.
| Status | Description |
|---|---|
200 | { ok: true, service, systemd_unit, status } |
400 | Invalid service name or not a dedicated project |
500 | SSH failed or restart failed |