Docs13 sections, 20 commands, one page

Four commands to a live URL.

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.

Step 1
$ curl -fsSL https://k64.dev/install.sh | sh
4commands from an empty terminal to a URL
~40 smedian build of a typical Node app
20CLI commands, each with --help
€0for builds, they are never billed

01Getting started

Quickstart. From zero to a URL.

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.

~/cat-cafe · zshStep 1 of 4
# Press Enter to run the first command, or type it yourself.

↵ runs the next command · Tab completes it · or type it yourself

  1. Install the CLI

    One binary called k64, the same build on every system. Pick the installer you already use.

    Install the CLI
    $ curl -fsSL https://k64.dev/install.sh | sh
    

    macOS, Linux and WSL. Installs to ~/.k64/bin.

  2. Log in

    Opens your browser so you can approve this machine. The token lands in ~/.k64. On a server over SSH, add --device and type the code you get on any other device.

    shell
    $ k64 login
    Opening the browser to approve this device...
    [ok] Logged in as you@example.com
    
  3. Create a project

    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.

    shell
    $ 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
    
  4. Deploy

    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.

    shell
    $ 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 started

Install the CLI. One binary, three ways.

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.

Install methods

Your system

  • Install scriptmacOS, Linux, WSLRecommendedInside WSLNot on Windows
    curl -fsSL https://k64.dev/install.sh | sh

    UpdateRun the script again

  • HomebrewmacOS, LinuxRecommendedInside WSLNot on Windows
    brew install <org>/tap/k64

    Updatebrew upgrade k64

  • npmAny system with Node.jsRecommendedInside WSLNot on Windows
    npm i -g @k64/cli

    Updatenpm 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.

shell
# read the script first
$ curl -fsSL https://k64.dev/install.sh | less

Update and remove

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 --version
k64 2.15.0 (darwin-arm64)
k64 2.16.0 is available.
Update with: brew upgrade k64
shell
# remove, the way you installed it
$ rm -rf ~/.k64
$ brew uninstall k64
$ npm rm -g @k64/cli

Use it in CI

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.

.github/workflows/deploy.ymlyaml
# 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 started

Deploy from GitHub. Every push ships.

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.

cat-cafe · push to deploy

mainpr #128
productionLive
deployment #42cat-cafe.k64.app
PreviewLive
pr-128pr-128.cat-cafe.k64.appDatabase: copy of main
  1. #41 live7c2e91b · Add a /health endpoint for auto-restart
  2. #42 livea1f9c3e · Cache /menu responses for 60 s
  3. Preview livepr-128.cat-cafe.k64.app · New loyalty stamps

Connect a repo

  1. In the dashboard, open the service on your project's canvas, then Settings, Source. For a new project, pick From a Git repo under New project.
  2. Install the k64 app on GitHub when it asks, and pick the repos it can read. GitLab and Bitbucket work the same way. Team settings, Integrations lists every connection.
  3. Choose the production branch. It is main unless source.branch says otherwise.

Push to deploy

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.

k64.tomltoml
[source]
branch = "main"

Preview environments for pull requests

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.

URL
pr-<n>.<project>.k64.app
Database
Its own copy of each Postgres or MySQL database
Lifetime
Until the pull request merges or closes
Plans
Pro and Enterprise
Opt out
previews.enabled = false

Preview environments are deleted when the pull request merges or closes.

04Configure

k64.toml. Config as code.

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.

Annotated example

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.tomltoml
# 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"]

Regions

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 · default
  • fraFrankfurtGermanySoon
  • mxpMilanItalySoon
  • zazZaragozaSpainSoon
  • arnStockholmSwedenSoon
  • dubDublinIrelandSoon

On 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.

Key reference

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.

40 keys in 13 tables
k64.toml keys, grouped by table
KeyTypeDefaultWhat it does
[project]2 keys
namestringfolder nameProject name, used in <name>.k64.app.
regionregion 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
branchstring"main"Branch that deploys to production.
[build]3 keys
builder"auto" | "dockerfile""auto"Detect the language, or build ./Dockerfile.
commandstringdetectedBuild command. Skipped with the dockerfile builder.
cachelistdetectedPaths 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.
startstringdetectedCommand that starts the process.
portinteger$PORTPort your process listens on. k64 also sets PORT.
cpunumber1vCPU per replica.
memorysize"1GB"RAM per replica.
regionslistproject regionSpread replicas across these regions. Needs Pro and Enterprise. Regions marked soon are not open yet.
replicasinteger | table1A fixed count, or a table with min, max and target_cpu to autoscale.
dockerfilepathnoneBuild this service from its own Dockerfile instead of [build].
releasestringnoneRuns once before the new deployment takes traffic, for migrations. A failure stops the deploy.
healthstringnoneShort form of [services.<name>.health] with only a path.
tcp_proxyportoffExpose this port on a public TCP address, for traffic that is not HTTP.
scale_to_zerodurationoffScale 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
pathstringTCP checkHTTP path that must answer 2xx.
intervalduration"10s"Time between checks.
timeoutduration"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_restartsinteger9Restarts allowed inside the window before the service is marked crashed.
windowduration"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
schedulecronrequiredFive fields, in UTC.
commandstringrequiredWhat runs on each tick, in a fresh microVM with the project variables.
[databases.<name>]2 keys
engine"postgres" | "mysql" | "valkey" | "ferretdb"requiredManaged database engine.
versionstringlatestPostgreSQL 17 or MySQL 8.4. Valkey and FerretDB run the version k64 sets.
[volumes.<name>]3 keys
servicestringthe only serviceService the disk is mounted into. Needed once the project has more than one.
mountpathrequiredWhere the disk appears inside the service.
sizesize"1GB"Disk size. You can grow it later, never shrink it.
[networking]1 key
static_outbound_ipsbooleanfalseConnect out from fixed IPv4 addresses, for partners that allowlist. Available on Enterprise. k64 status --egress prints them.
[previews]2 keys
enabledbooleantrueOne preview environment per pull request. Available on Pro and Enterprise.
branch_databaseslistPostgres and MySQLDatabases each preview environment gets its own copy of, made from a snapshot. [] gives preview environments no database.
[usage]3 keys
budgetnumbernoneMonthly budget for this project, in euros excluding VAT. Available on Pro and Enterprise.
alertslist[50, 80, 100]Percentages of the budget that alert the project owners, by email or through your Slack, Discord or webhook alerts.
on_limit"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
endpointURLnoneOTLP over HTTP collector that receives the data. A collector on <name>.k64.internal keeps it on the private network.
signalslist["traces", "metrics", "logs"]Which signals to forward. Every span and log line carries the service, region and deployment number.

Check the file

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.tomltomlChecking

k64 upchecks k64.toml first

    05Configure

    Environment variables. Shared, scoped, sealed.

    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.

    k64 env list --env production
    Variables in the selected environment
    KeyValueFrom
    DATABASE_URLpostgres://app@main.k64.internal/cat_cafedatabases.main
    LOG_LEVELinfoproduction
    MENU_CACHE_TTL300shared
    SESSION_SECRET••••••••••sealed · production
    PORT3000k64

    Pick an environment, or set a variable as KEY=value.

    One set per environment

    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.

    shell
    $ k64 env set LOG_LEVEL=info --env production
    $ k64 env set LOG_LEVEL=debug --env staging
    $ k64 env list --env staging
    

    Shared variables

    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.

    shell
    $ k64 env set MENU_CACHE_TTL=300 --shared
    $ k64 env set MENU_CACHE_TTL=0 --env pr-128
    

    Sealed secrets

    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.

    shell
    $ k64 env set SESSION_SECRET --sealed
    Value (hidden):
    [ok] Sealed SESSION_SECRET in production
    

    06Configure

    Custom domains. HTTPS on its own.

    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

    DNS records for the hostname
    TypeNameValue
    CNAMEwwwcat-cafe.k64.app
    TXT_k64-challenge.wwwk64-verify=aabb95
    1. DNSRecords found0.8 s
    2. VerifiedTXT record matches3.1 s
    3. IssuedUsually within a minute41 s
    4. LiveRenews 30 days before expiry42 s

    https://www.catcafe.exampleis live over HTTP/2 and HTTP/3

    Add a domain

    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.

    1. Run k64 domains add with the full hostname.
    2. Create the records at your DNS provider.
    3. Wait for the certificate. The command exits once the domain is live.

    DNS records

    DNS records for a custom domain
    TypeNameValueUse it for
    CNAMEwwwcat-cafe.k64.appAny subdomain, like www or app
    A@203.0.113.10The apex domain, IPv4
    AAAA@2001:db8::10The apex domain, IPv6
    TXT_k64-challenge.wwwk64-verify=aabb95Proves 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

    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.

    07Data

    Databases. Managed and private.

    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
    Host
    main.k64.internal
    Port
    5432
    Variable
    DATABASE_URL
    Shell
    psql

    Add a database

    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.

    shell
    $ k64 db add postgres --name main
    

    Connect

    Opens the right shell for the engine (psql, mysql, valkey-cli or mongosh) through an encrypted tunnel.

    shell
    $ k64 db connect main
    psql (17) · main.k64.internal
    cat_cafe=>
    

    Copies

    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.

    shell
    $ k64 db branch try-index --from main
    [ok] Copied main to try-index in 3m 12s
    [ok] try-index.k64.internal:5432
    

    Backups

    Hobby
    Daily backups
    Pro
    Daily backups and 30 days of point-in-time recovery
    Enterprise
    Daily backups and 35 days of point-in-time recovery

    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.

    08Data

    Volumes. Disks that outlive deploys.

    A volume is a persistent disk mounted into one service. Files on it survive deploys, restarts and rewinds.

    volumes.media

    worker · /data
    10 GB
    €1.50a month for the disk
    €18.00a year at this size, excl. VAT
    • Hobbyup to 1 GBToo big
    • Proup to 1 TBFits
    • EnterpriseCustomFits

    Volumes 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.

    Mount a volume

    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.

    k64.tomltoml
    [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.

    Sizes and pricing

    Hobby
    Up to 1 GB per volume
    Pro
    Up to 1 TB per volume
    Enterprise
    Custom per volume

    09Operate

    Rewind. Any deployment, in seconds.

    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.

    Taking traffic#42a1f9c3e · Cache /menu responses for 60 s · deployed 3 min ago
    From #33 to #42, or empty for the list
    ❯ 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

    Deployment 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.

    Rewind from the CLI

    shell
    # 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.

    History per plan

    Each square below is one past deployment you can rewind to.

    HobbyLast 10 deployments
    ProLast 90 deployments
    EnterpriseEvery deployment

    When the history is full, the oldest deployment is cleared to make room. The deployment taking traffic is never removed.

    10Operate

    Auto-restart. Crashes restart on their own.

    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.

    webcat-cafe · deployment #42 · cdg
    Healthy

    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

    Health checks

    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.

    k64.tomltoml
    [services.web.health]
    path = "/healthz"     # must answer 2xx
    interval = "10s"
    timeout = "3s"
    

    Restart policy

    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.

    k64.tomltoml
    [services.worker.restart]
    policy = "on-failure"
    max_restarts = 3      # default 9
    window = "5m"         # default "10m"
    backoff = "exponential"
    
    Restart policies
    PolicyRestarts whenUse it for
    on-failureThe process exits with an error or fails 3 health checks in a row.Default. Web services and workers.
    alwaysAlso after a clean exit.Workers that must never stop.
    neverNever. The exit is recorded and that is it.One-off jobs. Cron services use it.

    Zero-downtime deploys

    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.

    11Operate

    Logs. Live and searchable.

    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.

    1. webINFOGET /menu 200 14ms
    2. workerINFOjob receipts.render done in 220ms
    3. webINFOPOST /orders 201 48ms
    4. webWARNslow query orders_by_table 812ms
    5. webINFOGET /menu 200 9ms
    6. workerINFOjob stamps.sync done in 95ms
    7. webERRORPOST /checkout 502 upstream timeout after 3000ms
    8. webINFOGET /healthz 200 2ms
    9. workerINFOjob email.send done in 130ms
    k64 logs --follow

    Tail logs

    shell
    # 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
    

    Filters

    --follow
    Keep streaming new lines. Without it, logs prints the last 100 and exits.
    --level warn
    This level and above: debug, info, warn, error.
    --since 30m
    Start from a duration ago or a timestamp.
    --search "timeout"
    Only lines containing the text. Case-insensitive, across the whole retention window.
    --region cdg
    Only lines from replicas in one region.
    --deploy 42
    Only lines written by deployment #42. Handy right after a deploy.

    Lines that start with whitespace join the entry above them, so a stack trace stays one entry and --search finds all of it.

    Retention and export

    Hobby7 days
    Pro30 days
    Enterprise90 days

    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.

    12Reference

    CLI reference. Every command, every flag.

    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.

    Global flags

    --project <name>
    Run against this project instead of the one linked to the folder.
    --env <name>
    Pick the environment. Defaults to production.
    --json
    Print machine-readable output.
    --help
    Show usage for any command, for example k64 env set --help.
    --version
    Print the CLI version.

    Commands

    Filter by name or flag. Pick flags on a card to build the command, then copy it with its placeholders.

    20 commands

    StartFrom an empty folder to a deployment01 · 4

    k64 login

    Authorize this machine in your browser. --device prints a code for machines without a browser.

    k64 init

    Create a project from the current folder and write k64.toml. --template copies a starter from /templates first.

    k64 up

    Upload the folder, build it and ship it as the next numbered deployment.

    Ship and operateLogs, rewinds, size and status02 · 5

    k64 logs [service]

    Print or stream logs from every service, or one.

    k64 rewind [deploy]

    Switch traffic back to an earlier deployment in a few seconds, with no rebuild. Without a number, pick one from a list.

    k64 scale <service>

    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.

    k64 status [service]

    Show services, the deployment each one runs, health and regions. --egress prints the static outbound IPs (Enterprise).

    k64 open

    Open the project dashboard. --app opens the live URL instead.

    ConfigVariables and domains03 · 6

    k64 env set KEY=value

    Create or change a variable. --sealed encrypts it, and asks for the value without echoing it when you leave it out.

    k64 env get KEY

    Print one value. Sealed values print as ********.

    k64 env list

    List variables and where each value comes from.

    k64 env unset KEY

    Delete a variable.

    k64 domains add <domain>

    Attach a custom domain and print the DNS records to create.

    k64 domains list

    Show each domain with its DNS and certificate status.

    DataManaged databases and copies04 · 3

    k64 db add postgres|mysql|valkey|ferretdb

    Create a managed PostgreSQL, MySQL, Valkey (Redis-compatible) or FerretDB (MongoDB-compatible) database.

    k64 db connect [name]

    Open psql, mysql, valkey-cli or mongosh against a database.

    k64 db branch <name>

    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

    k64 run -- <command>

    Run a one-off command in a fresh microVM with the service's variables.

    k64 ssh <service>

    Open a shell inside a running replica.

    13Reference

    API and automation. Tokens, REST, Terraform, CI.

    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.

    • Personal token

      Acts as you, with what your role allows, in every team you belong to or in one of them.

      Create it inAccount, Tokens

      Open Account
    • Team token

      Belongs to the team, so it keeps working when the person who made it leaves.

      Create it inTeam settings, Tokens

      Open Team settings
    • Project token

      One 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 projects

    Tokens

    A 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.

    shell
    # keep it out of your shell history and your repo
    $ export K64_TOKEN=k64_live_…
    $ k64 status
    

    REST API

    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.

    shell
    # your projects
    $ curl https://api.k64.dev/v1/projects \
        -H "Authorization: Bearer $K64_TOKEN"
    
    shell
    # 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.

    Terraform provider

    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.

    main.tftext
    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.

    GitHub Action

    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.

    .github/workflows/deploy.ymlyaml
    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 }}
    

    Was this page helpful?

    One click, and a line on what to fix if it was not.

    Support

    Still stuck? Ask a person.

    Write to support@k64.dev with the project name and the deployment number. Who answers depends on your plan.

    Hobby
    Community
    Pro
    Email, 1 business day
    Enterprise
    Dedicated engineer, 1-hour P1 response
    k64 statusAll healthy
    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

    Search the docs

      ↑↓to move↵to jumpEscto close