Authorize this machine in your browser. --device prints a code for machines without a browser.
Install the CLI, log in, run k64 init, then k64 up. Everything after that, from k64.toml to rewinds, is on this page. Every heading and command is one search away.
$ curl -fsSL https://k64.dev/install.sh | sh
$ brew install <org>/tap/k64
$ npm i -g @k64/cli
--help01Getting started01 / 13
Four steps from an empty terminal to a URL. A typical Node app builds in about 40 seconds, and builds are never billed. Try them right here first.
# Press Enter to run the first command, or type it yourself.↵ runs the next command · Tab completes it · or type it yourself
One binary called k64, the same build on every system. Pick the installer you already use.
$ curl -fsSL https://k64.dev/install.sh | sh
macOS, Linux and WSL. Installs to ~/.k64/bin.
$ brew install <org>/tap/k64
macOS and Linux with Homebrew.
$ npm i -g @k64/cli
Any system with Node.js, Windows included.
Run it in your app's folder. It detects the language, asks for a name and a region, and writes k64.toml. Already have a project? Use k64 link cat-cafe.
$ cd cat-cafe
$ k64 init
? Project name cat-cafe
? Region cdg Paris (default)
Detected Node 22 (package.json)
[ok] Created project cat-cafe
[ok] Wrote k64.toml
k64 up uploads the folder, builds it and records the build, k64.toml and variables as deployment #1. Traffic moves to it once its health check passes.
$ k64 up
Uploading 214 files (3.1 MB)
Detected Node 22 · npm · build cache: none yet
Building deployment #1 ...
[ok] Build finished in 41s
Starting 1 replica in cdg ...
[ok] Health check passed: GET /healthz 200
[ok] Deployment #1 is taking traffic
Live at https://cat-cafe.k64.app
Every later deploy gets the next number, #2, #3 and so on. Rewind puts an earlier one back in front.
02Getting started02 / 13
Pick the installer that matches how you manage your other tools. Each one puts the same k64 binary on your PATH and only differs in how you update it.
Your system
curl -fsSL https://k64.dev/install.sh | shUpdateRun the script again
brew install <org>/tap/k64Updatebrew upgrade k64
npm i -g @k64/cliUpdatenpm i -g @k64/cli@latest
The script puts the binary in ~/.k64/bin and adds that folder to your PATH. It is plain shell, so you can read it before you run it.
# read the script first
$ curl -fsSL https://k64.dev/install.sh | less
The CLI never updates itself. When a newer version exists it prints one line after the command you ran, with the update command for the way you installed it.
$ k64 --version
k64 2.15.0 (darwin-arm64)
k64 2.16.0 is available.
Update with: brew upgrade k64
# remove, the way you installed it
$ rm -rf ~/.k64
$ brew uninstall k64
$ npm rm -g @k64/cli
Create a token under Project settings, API tokens, and store it as K64_TOKEN. Every command reads it, so CI never needs k64 login. API and automation has a full GitHub workflow.
# deploy on every push to main
- run: npm i -g @k64/cli
- run: k64 up --detach --message "$GITHUB_SHA"
env:
K64_TOKEN: ${{ secrets.K64_TOKEN }}
03Getting started03 / 13
Connect a repo once. Every push to the production branch ships a new deployment, and every pull request gets a preview environment with its own URL and its own copy of your database.
main unless source.branch says otherwise.Each push builds with the cache from the last build and ships as the next numbered deployment. A failed build never takes traffic, so production keeps serving the last good deployment.
[source]
branch = "main"
Open a pull request and k64 comments with a URL like pr-128.cat-cafe.k64.app. The preview environment runs the same services as production with its own variables, and each Postgres or MySQL database gets its own copy, made from a snapshot, so you can test migrations on real data shapes without touching production.
Preview environments are deleted when the pull request merges or closes.
04Configure04 / 13
k64.toml sits in the repo root and travels with your code, so every deployment records the exact config it ran with. The dashboard and the CLI write to the same file.
A web app with a worker, a nightly cron job, Postgres and a disk. Point at a note or at the code to light up the other.
[project]lines 2–4The name becomes cat-cafe.k64.app. The region is where services and databases run unless they say otherwise.
# k64.toml, in the repo root
[project]
name = "cat-cafe"
region = "cdg"
[source]
branch = "main"
[build]
builder = "auto"
command = "npm run build"
cache = ["node_modules", ".next/cache"]
[services.web]
start = "npm start"
port = 3000
cpu = 1
memory = "1GB"
[services.web.replicas]
min = 2
max = 8
target_cpu = 70
[services.web.health]
path = "/healthz"
interval = "10s"
timeout = "3s"
[services.web.restart]
policy = "on-failure"
max_restarts = 9
window = "10m"
[services.worker]
type = "worker"
start = "node jobs/worker.js"
[cron.cleanup]
schedule = "0 3 * * *"
command = "node jobs/cleanup.js"
[databases.main]
engine = "postgres"
version = "17"
[volumes.media]
service = "worker"
mount = "/data"
size = "10GB"
[previews]
enabled = true
branch_databases = ["main"]
k64 is hosted in Paris today, with cdg as the default region. New projects start there. More EU regions are coming soon, and your apps, databases, backups and logs stay in the EU wherever you deploy.
cdgParisFranceLive · defaultfraFrankfurtGermanySoonmxpMilanItalySoonzazZaragozaSpainSoonarnStockholmSwedenSoondubDublinIrelandSoonOn Pro and Enterprise, a service can spread its replicas over several regions with regions, once more regions open. On Hobby, a project runs in one region.
Durations look like "10s" or "15m", sizes like "512MB" or "10GB". Anything you leave out falls back to the default below, and k64 up checks the file before it uploads anything, pointing at the line it cannot read. Try the checker below.
| Key | Type | Default | What it does |
|---|---|---|---|
[project]2 keys | |||
name | string | folder name | Project name, used in <name>.k64.app. |
region | region slug | "cdg" | Where services and databases run unless they say otherwise. Open today: cdg. The other slugs under Regions are coming soon. |
[source]1 key | |||
branch | string | "main" | Branch that deploys to production. |
[build]3 keys | |||
builder | "auto" | "dockerfile" | "auto" | Detect the language, or build ./Dockerfile. |
command | string | detected | Build command. Skipped with the dockerfile builder. |
cache | list | detected | Paths kept between builds. |
[services.<name>]12 keys | |||
type | "web" | "private" | "worker" | "static" | "web" | What the service is. Private services answer only on <name>.k64.internal. |
start | string | detected | Command that starts the process. |
port | integer | $PORT | Port your process listens on. k64 also sets PORT. |
cpu | number | 1 | vCPU per replica. |
memory | size | "1GB" | RAM per replica. |
regions | list | project region | Spread replicas across these regions. Needs Pro and Enterprise. Regions marked soon are not open yet. |
replicas | integer | table | 1 | A fixed count, or a table with min, max and target_cpu to autoscale. |
dockerfile | path | none | Build this service from its own Dockerfile instead of [build]. |
release | string | none | Runs once before the new deployment takes traffic, for migrations. A failure stops the deploy. |
health | string | none | Short form of [services.<name>.health] with only a path. |
tcp_ | port | off | Expose this port on a public TCP address, for traffic that is not HTTP. |
scale_ | duration | off | Scale to zero after this much idle time, like "15m". The next request wakes it in a few seconds. While scaled to zero, it pays only for storage. |
[services.<name>.health]3 keys | |||
path | string | TCP check | HTTP path that must answer 2xx. |
interval | duration | "10s" | Time between checks. |
timeout | duration | "3s" | A slower answer counts as a failure. |
[services.<name>.restart]4 keys | |||
policy | "on-failure" | "always" | "never" | "on-failure" | When k64 restarts the process. |
max_ | integer | 9 | Restarts allowed inside the window before the service is marked crashed. |
window | duration | "10m" | How far back restarts are counted. |
backoff | "exponential" | "fixed" | "exponential" | Double the wait after each restart, or keep it at 1 second. |
[cron.<name>]2 keys | |||
schedule | cron | required | Five fields, in UTC. |
command | string | required | What runs on each tick, in a fresh microVM with the project variables. |
[databases.<name>]2 keys | |||
engine | "postgres" | "mysql" | "valkey" | "ferretdb" | required | Managed database engine. |
version | string | latest | PostgreSQL 17 or MySQL 8.4. Valkey and FerretDB run the version k64 sets. |
[volumes.<name>]3 keys | |||
service | string | the only service | Service the disk is mounted into. Needed once the project has more than one. |
mount | path | required | Where the disk appears inside the service. |
size | size | "1GB" | Disk size. You can grow it later, never shrink it. |
[networking]1 key | |||
static_ | boolean | false | Connect out from fixed IPv4 addresses, for partners that allowlist. Available on Enterprise. k64 status --egress prints them. |
[previews]2 keys | |||
enabled | boolean | true | One preview environment per pull request. Available on Pro and Enterprise. |
branch_ | list | Postgres and MySQL | Databases each preview environment gets its own copy of, made from a snapshot. [] gives preview environments no database. |
[usage]3 keys | |||
budget | number | none | Monthly budget for this project, in euros excluding VAT. Available on Pro and Enterprise. |
alerts | list | [50, 80, 100] | Percentages of the budget that alert the project owners, by email or through your Slack, Discord or webhook alerts. |
on_ | "continue" | "scale_to_zero" | "continue" | At 100%: keep running and billing, or scale every service outside production to zero until the next billing period. Production keeps running either way. |
[observability.otel]2 keys | |||
endpoint | URL | none | OTLP over HTTP collector that receives the data. A collector on <name>.k64.internal keeps it on the private network. |
signals | list | ["traces", "metrics", "logs"] | Which signals to forward. Every span and log line carries the service, region and deployment number. |
No key matches that. Try replicas, scale_to_zero or budget.
The file below has four mistakes. The checker runs the same rules as k64 up: known tables and keys, types, units, regions and plan limits. Edit it, pick a problem to jump to its line, or apply the fix.
k64 upchecks k64.toml first
05Configure05 / 13
Each environment has its own variables. Shared variables apply to all of them, and sealed secrets can be read by your running app and by nobody else, you included.
| Key | Value | From |
|---|---|---|
| DATABASE_URL | postgres://app@main.k64.internal/cat_cafe | databases.main |
| LOG_LEVEL | info | production |
| MENU_CACHE_TTL | 300 | shared |
| SESSION_SECRET | •••••••••• | sealed · production |
| PORT | 3000 | k64 |
Pick an environment, or set a variable as KEY=value.
Projects start with production. Add staging by setting a variable in it. Preview environments copy staging when it exists and production when it does not. Changing a variable restarts the service with the new value and does not rebuild.
$ k64 env set LOG_LEVEL=info --env production
$ k64 env set LOG_LEVEL=debug --env staging
$ k64 env list --env staging
Set a value once for every environment with --shared. An environment that sets the same key wins over the shared value, which is how the preview environment above turns the menu cache off.
$ k64 env set MENU_CACHE_TTL=300 --shared
$ k64 env set MENU_CACHE_TTL=0 --env pr-128
A sealed value is encrypted when you set it and decrypted only inside your replicas. The dashboard, the API and k64 env get show ********. To change one, set it again.
$ k64 env set SESSION_SECRET --sealed
Value (hidden):
[ok] Sealed SESSION_SECRET in production
06Configure06 / 13
Every service gets <name>.k64.app with HTTPS from its first deploy. Add your own domain and k64 issues and renews its certificate.
Create these records
| Type | Name | Value |
|---|---|---|
| CNAME | www | cat-cafe.k64.app |
| TXT | _k64-challenge.www | k64-verify=aabb95 |
https://www.catcafe.exampleis live over HTTP/2 and HTTP/3
Attach the domain to a service, create the records it prints, and leave the command running. It waits for DNS, then requests the certificate. Check progress any time with k64 domains list.
k64 domains add with the full hostname.| Type | Name | Value | Use it for |
|---|---|---|---|
| CNAME | www | cat-cafe.k64.app | Any subdomain, like www or app |
| A | @ | 203.0.113.10 | The apex domain, IPv4 |
| AAAA | @ | 2001:db8::10 | The apex domain, IPv6 |
| TXT | _k64-challenge.www | k64-verify=aabb95 | Proves you own www. For the apex, the name is _k64-challenge. |
The addresses and the TXT value above are examples. Use the ones k64 domains add prints for your project. If your DNS provider supports CNAME flattening (ALIAS or ANAME), use it for the apex instead of A and AAAA.
Certificates last 90 days and renew 30 days before they expire, with no action from you. HTTP redirects to HTTPS, and HTTP/2, HTTP/3 and WebSockets work without settings.
A certificate covers the exact hostname you add, so add www and the apex separately if you want both. Moving from another host? Lower the TTL on your old records a day before the switch and the cutover takes minutes.
07Data07 / 13
Managed PostgreSQL, MySQL, Valkey (Redis-compatible) and FerretDB (MongoDB-compatible) on the project's private network, with daily backups. One command adds one.
❯ k64 db add postgres Creating PostgreSQL 17 in cdg ... [ok] main is ready on main.k64.internal:5432 [ok] Injected DATABASE_URL into web, worker, cleanup Daily backups on · private network only k64 db connect main opens psql
The database joins the private network and every service in the project gets its connection string as a variable. Nothing is exposed to the internet unless you turn on the TCP proxy.
$ k64 db add postgres --name main
Opens the right shell for the engine (psql, mysql, valkey-cli or mongosh) through an encrypted tunnel.
$ k64 db connect main
psql (17) · main.k64.internal
cat_cafe=>
A copy is a new Postgres or MySQL database, made from a snapshot of an existing one. Preview environments get their own copy each, so a migration runs against real data while production stays as it was. Make your own to try a risky change. A copy is ready in a few minutes.
$ k64 db branch try-index --from main
[ok] Copied main to try-index in 3m 12s
[ok] try-index.k64.internal:5432
Backup storage costs €0.05 per GB-month on every plan, excluding VAT. Restore from the dashboard into a new database, then swap it in.
08Data08 / 13
A volume is a persistent disk mounted into one service. Files on it survive deploys, restarts and rewinds.
volumes.media
worker · /dataVolumes cost €0.15 per GB-month for the size you set, prorated hourly, so a disk you grow during the month is billed at each size for the hours it had it. Prices exclude VAT.
Declare it in k64.toml and run k64 up. The disk appears at the mount path from the next deploy on. A service with a volume runs one replica, so two processes never write to the same disk.
[volumes.media]
service = "worker"
mount = "/data"
size = "10GB"
You can grow a volume at any time without downtime. You cannot shrink one. Move the data to a smaller volume instead.
09Operate09 / 13
Every deployment is an immutable, numbered build. A rewind switches traffic back to any deployment still in your deployment history in a few seconds, with no rebuild.
❯ k64 rewind --list ● #42 a1f9c3e Cache /menu responses for 60 s live #41 7c2e91b Add a /health endpoint for auto-restart #40 e04b7d2 Bump Node to 22 … 7 older deployments in the history
The deployment history above belongs to the sample project, cat-cafe. Each deployment holds the build, thek64.toml and the variables it shipped with. The one taking traffic is marked in ember. Pick another, or type its number after k64 rewind.
# pick a deployment from the list
$ k64 rewind
# back to deployment #41
$ k64 rewind 41
# and forward again
$ k64 rewind 42
A rewind switches the build and the k64.toml of that deployment. Variables keep their current values, so a rotated secret stays rotated. Newer deployments stay in the history, so you can go forward again.
Each square below is one past deployment you can rewind to.
When the history is full, the oldest deployment is cleared to make room. The deployment taking traffic is never removed.
10Operate10 / 13
Health checks gate every deploy. A crashing service restarts itself with exponential backoff, up to 9 times in 10 minutes, then it is marked crashed and you get an alert.
Wait before each restart, doubling from 1 second. All nine fit in 8m 31s, inside the 10-minute window. The demo runs 40 times faster.
12:04:21 GET /healthz 200 in 3ms12:04:31 GET /healthz 200 in 4ms12:04:41 GET /healthz 200 in 3ms
k64 calls the path on every replica at each interval. A replica that fails 3 checks in a row is restarted. Without a path, the check only confirms the port accepts connections.
[services.web.health]
path = "/healthz" # must answer 2xx
interval = "10s"
timeout = "3s"
The defaults are 9 restarts in 10 minutes with exponential backoff. You can tune them per service. A queue worker that should fail fast can stop after 3 tries and alert you sooner.
[services.worker.restart]
policy = "on-failure"
max_restarts = 3 # default 9
window = "5m" # default "10m"
backoff = "exponential"
| Policy | Restarts when | Use it for |
|---|---|---|
on-failure | The process exits with an error or fails 3 health checks in a row. | Default. Web services and workers. |
always | Also after a clean exit. | Workers that must never stop. |
never | Never. The exit is recorded and that is it. | One-off jobs. Cron services use it. |
A new deployment starts next to the old one. Traffic moves only after its health check passes. If it never passes, the old deployment keeps serving and the new one is marked failed, so a bad build costs you a notification and nothing else.
11Operate11 / 13
k64 logs reads every service in the project, live or from the past, with filters for service, level, time and text. How far back you can go depends on your plan.
No line matches these filters yet. New lines appear as they arrive.
k64 logs --follow# the last 100 lines, every service
$ k64 logs
# stream one service as it runs
$ k64 logs web --follow
# two hours as JSON, ready for jq or a file
$ k64 logs --since 2h --json
--follow--level warn--since 30m--search "timeout"--region cdg--deploy 42Lines that start with whitespace join the entry above them, so a stack trace stays one entry and --search finds all of it.
Older lines are deleted at the end of the window. To keep them longer, export logs, metrics and traces to any OpenTelemetry collector from Export, the last section of an environment's Observability page, or the [observability.otel] table of k64.toml. Alerts on log patterns can go to email, Slack, Discord or a webhook.
12Reference12 / 13
Every command the CLI has, with its flags. Commands act on the project linked to the current folder unless you pass --project, and every one of them accepts --help.
--project <name>--env <name>--json--helpk64 env set --help.--versionFilter by name or flag. Pick flags on a card to build the command, then copy it with its placeholders.
StartFrom an empty folder to a deployment01 · 4
Authorize this machine in your browser. --device prints a code for machines without a browser.
Create a project from the current folder and write k64.toml. --template copies a starter from /templates first.
Link the current folder to an existing project.
Upload the folder, build it and ship it as the next numbered deployment.
Ship and operateLogs, rewinds, size and status02 · 5
Print or stream logs from every service, or one.
Switch traffic back to an earlier deployment in a few seconds, with no rebuild. Without a number, pick one from a list.
Change size, replica count, autoscaling or regions. --target picks what autoscaling follows: cpu, memory or rps. With --scale-to-zero 15m, the service scales to zero after 15 minutes idle and wakes on the next request in a few seconds.
Show services, the deployment each one runs, health and regions. --egress prints the static outbound IPs (Enterprise).
Open the project dashboard. --app opens the live URL instead.
ConfigVariables and domains03 · 6
Create or change a variable. --sealed encrypts it, and asks for the value without echoing it when you leave it out.
Print one value. Sealed values print as ********.
List variables and where each value comes from.
Delete a variable.
Attach a custom domain and print the DNS records to create.
Show each domain with its DNS and certificate status.
DataManaged databases and copies04 · 3
Create a managed PostgreSQL, MySQL, Valkey (Redis-compatible) or FerretDB (MongoDB-compatible) database.
Open psql, mysql, valkey-cli or mongosh against a database.
Create or delete a copy of a Postgres or MySQL database, to test a migration or an upgrade. --version tries an engine upgrade on the copy only.
AccessInside your services05 · 2
Run a one-off command in a fresh microVM with the service's variables.
Open a shell inside a running replica.
No command matches that. Try db, --follow or scale.
13Reference13 / 13
Everything the dashboard does goes through the same API. Script it with a token and curl, describe it with Terraform, or deploy from a pipeline with the CLI.
Acts as you, with what your role allows, in every team you belong to or in one of them.
Create it inAccount, Tokens
Open AccountBelongs to the team, so it keeps working when the person who made it leaves.
Create it inTeam settings, Tokens
Open Team settingsOne project, or a single environment of it: a CI token that can deploy staging and nothing else.
Create it inProject settings, API tokens
Open your projectsA token is shown once, when you create it, and starts with k64_. Pick what it may do and when it expires, from 1 to 365 days. Rolling a token gives you a new secret, and the old one can keep working for 24 hours while you swap it. The CLI, the API and Terraform all read it from K64_TOKEN.
# keep it out of your shell history and your repo
$ export K64_TOKEN=k64_live_…
$ k64 status
The API lives at https://api.k64.dev/v1. Send the token as a bearer token. Requests and answers are JSON, and the API covers projects, deploys and variables, the same calls the dashboard makes.
# your projects
$ curl https://api.k64.dev/v1/projects \
-H "Authorization: Bearer $K64_TOKEN"
# deploy main to the web service: the answer carries the deployment number
$ curl -X POST https://api.k64.dev/v1/projects/cat-cafe/deploys \
-H "Authorization: Bearer $K64_TOKEN" \
-d '{"service": "web", "ref": "main"}'
# {"deploy": 44, "status": "building"}
A token only reaches what its scope allows: a project token for cat-cafe cannot read another project.
The Terraform provider manages everything k64.toml covers, plus projects, team members and domains. Version 1.0 keeps its resource names and attributes stable until 2.0. It reads K64_TOKEN too.
resource "k64_project" "cat_cafe" {
name = "cat-cafe"
region = "cdg"
}
resource "k64_service" "web" {
project = k64_project.cat_cafe.id
name = "web"
region = "cdg"
replicas = 2
}
resource "k64_variable" "app_name" {
project = k64_project.cat_cafe.id
key = "APP_NAME"
value = "cat-cafe"
}
Coming from 0.9? Rename k64_env resources to k64_variable. The changelog has the details.
Store a project token as the K64_TOKEN secret of the repository, then install the CLI and runk64 up. The ready-made GitHub Action runs these same two steps.
name: deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm i -g @k64/cli
- run: k64 up --detach --message "$GITHUB_SHA"
env:
K64_TOKEN: ${{ secrets.K64_TOKEN }}
One click, and a line on what to fix if it was not.
This is a demo form, so nothing was sent.
Support
Write to support@k64.dev with the project name and the deployment number. Who answers depends on your plan.
cat-cafe · production · deployment #42 · cdg SERVICE KIND STATE NOW web 2 replicas healthy p95 41 ms worker 1 replica healthy queue 3 cleanup cron waiting next in 14h 55m 26s main postgres 17 healthy 18 connections media volume mounted 4.1 of 10 GB