Skip to content

Quickstart

Deploy your first app on Flect in under 5 minutes.

  • Docker — to build and push your image
  • A container registry (GitHub Container Registry, Docker Hub, etc.)
  • Flect CLI installed
Terminal window
npm install -g @flect/cli
Terminal window
flect login

This opens a browser window. Sign in with your account and the CLI saves your token locally.

Terminal window
# create or select an org
flect org create --name my-org
flect org use my-org
# create a workspace and project
flect ws create --name default
flect ws use default
flect proj create --name myproject
flect proj use myproject
# create a production environment
flect env create --name production
flect env use production
Terminal window
# database (SQLite, isolated per app)
flect db create --name myapp-db
# run migrations
flect db migrate myapp-db --dir ./migrations
# KV store (Redis-compatible cache)
flect kv create --name myapp-cache
Terminal window
flect app create --name myapp
# → myapp-abc123.up.flect.run

In your project root:

name = "myapp"
port = 3000
[[databases]]
binding = "DB"
name = "myapp-db"
[[kv]]
binding = "CACHE"
name = "myapp-cache"

The binding is the env var prefix your app uses. The name is the resource name in Flect.

Terminal window
npm install @flect/sdk
import { createEnv } from '@flect/sdk'
const env = createEnv()
const db = env.db('DB') // reads DB_URL, DB_NAMESPACE, FLECT_TOKEN
const cache = env.kv('CACHE') // reads CACHE_URL, FLECT_TOKEN

Build and push your image, then deploy from the directory containing flect.toml:

Terminal window
docker build -t ghcr.io/you/myapp:1.0.0 .
docker push ghcr.io/you/myapp:1.0.0
flect app deploy myapp --image ghcr.io/you/myapp:1.0.0
✓ Deployed: abc123
id abc123
status running
url https://myapp-abc123.up.flect.run
image ghcr.io/you/myapp:1.0.0

Your app is live. All env vars (DB_URL, CACHE_URL, FLECT_TOKEN) are injected automatically — your code needs no configuration.