Kapten
All guides

AI-built apps

You built it with an AI. Here is how to ship it.

A working localhost is most of an application and very little of a deployment. What is missing, in order, and where Kapten fits each step.

Cover illustration for You built it with an AI. Here is how to ship it., beginner levelAI-built appsBeginner · fa30
On this page12 sections
  1. 01The deploy gap
  2. 021. A build that does not depend on your laptop
  3. 032. Configuration that lives outside the code
  4. 043. Secrets that never touch the chat
  5. 054. Data that survives
  6. 065. An environment with a shape
  7. 076. A domain, TLS and a public edge
  8. 087. A definition of healthy
  9. 098. A way back
  10. 109. A cost boundary
  11. 11Putting it together
  12. 12What stays with you

The deploy gap

You described an application to Claude, Cursor or another coding assistant, and an afternoon later it works. The pages load, the API answers, the database fills up. Then you try to put it somewhere other people can use it, and the progress stops.

That is not a failure of the code. A coding assistant is very good at the part of the work that lives in the repository. Production is mostly the part that does not: the cloud account, the network, the database that has to survive a restart, the secret that cannot be pasted into a chat, the domain, the health check, the plan for when the deploy goes wrong. None of that is in localhost:3000, and most of it is invisible until it is missing.

This guide walks through what a working prototype is missing, in the order you will run into it, and shows where Kapten fits each step. You can read it as a checklist whatever you deploy with.

StepOn localhostIn productionWith Kapten
1. BuildOne reproducible image per servicePartialYesBuild from GitHub
2. ConfigurationValues outside the codePartialYesVariables per environment
3. SecretsNever in the repo or the chatNoYesSecrets in a vault
4. DataBackups and a tested restoreNoYesDatabase with generated secrets
5. EnvironmentA written-down shapeNoYesTyped environment
6. Domain and TLSOnly what must be publicNoYesIngress and TLS on the cluster
7. HealthTraffic gated on itNoYesReadiness and liveness
8. RollbackPrevious images keptNoYesRedeploy a previous tag
9. Cost boundaryA budget per environmentNoYesUsage per environment
Figure 1. What a working prototype has, what production needs, and how Kapten covers the gap.

1. A build that does not depend on your laptop

On your machine the app runs because your machine has the right Node version, a node_modules folder from three weeks ago and an environment variable you set once and forgot. Production has none of that.

The first thing to produce is a reproducible build: a container image per service, built from the repository alone, the same way every time.

  • One image per service. A frontend, an API and a background worker are three images, even if they live in one repository.
  • A pinned runtime and base image, so next month’s build does not quietly change.
  • A start command and a listening port that come from configuration, not from code.
  • No secrets baked into the image.

In Kapten: deploy from GitHub and Kapten builds the image from the repository with Railpack, which detects your language and framework, and can rebuild on every push to the branch. If you already build images in CI, deploy them as a container image instead. The Dockerfile checklist covers what a good image needs either way.

2. Configuration that lives outside the code

AI-written code often has configuration inlined: a database URL in a module, an API base URL in the frontend, a feature toggled by editing a constant. That works for one environment. It breaks the moment you have two.

Move every value that differs between environments into environment variables, and give each environment its own set. A good test: could you run the same image in staging and production without rebuilding it? If not, something environment-specific is still in the code. The docs show where Kapten stores variables and secrets: per project, per environment or per component.

3. Secrets that never touch the chat

The prototype probably has an .env file with a payment key, an email provider key and a database password in it. Three rules before anything ships:

  • Secrets are never committed, and never pasted into a prompt. A conversation is not a vault.
  • Each environment has its own credentials. A staging deploy should not be able to charge a real card.
  • Anything that was ever committed should be treated as leaked and rotated.

In Kapten: a secret is stored in a vault, set per project, environment or component, and never shown again once saved: you can replace it, not read it. The secrets guide explains the pattern in more depth.

4. Data that survives

Locally, the database is a file or a container you can delete and recreate. In production it is the one thing you cannot recreate.

Decide where persistent data lives (usually a managed database in your cloud account) and agree the basics before the first real user signs up: automated backups, point-in-time recovery, a restore you have actually tested, and a private network path so the database is not reachable from the internet. Migrations should run as an explicit step, not as a side effect of the app starting.

In Kapten: add a database to the environment, in the cluster or managed by your cloud provider, private by default, with backups, encryption and high availability as options. Kapten generates its credentials and adds them to the environment as secrets. The Postgres checklist lists the decisions to make first.

5. An environment with a shape

A deployment is not a single box. It is a set of services, the data stores they use, the routes between them and the endpoints that are public. Writing that shape down is the difference between “it is on a server” and “we know what is running”. In Kapten, that shape is an environment and the components it runs.

In Kapten: each environment has a type (development, staging or production), runs on one cluster you connected, and gets its own Kubernetes namespace. Its applications, jobs, databases and variables are listed in one place, so the shape is written down by construction.

6. A domain, TLS and a public edge

Decide which services are public and which stay internal. Usually only the frontend and the public API need an endpoint. Each public endpoint needs a domain, a certificate and a sensible timeout. Everything else should be reachable only from inside the environment.

Only what must be public
Users on the internet reach a load balancer that terminates TLS for the domain. It routes to the frontend and the public API. The API reaches a private Postgres database and hands jobs to a background worker; neither has a public address.InternetPublic edgePublic servicesInternal onlyUsersbrowsers, API clientsLoad balancerdomain · TLS · timeoutsFrontendapp.example.comPublic APIapi.example.comWorkerno endpointPostgresprivate addresshttpsjobsprivate
  • Users connects to Load balancer (https).
  • Load balancer connects to Frontend.
  • Load balancer connects to Public API.
  • Public API connects to Worker (jobs).
  • Public API connects to Postgres (private).
Figure 2. One public edge holds the domain and the certificate. Behind it, two services answer the internet; the worker and the database are reachable only from inside the environment.

On a cluster connected to Kapten, the agent installs an ingress gateway and cert-manager for TLS certificates. Databases are private unless you choose otherwise: keep them that way.

7. A definition of healthy

A container that started is not an application that works. Give each service a health endpoint that reflects whether it can do its job. For an API, that usually means it can reach its database. Rollouts are gated on that check, so “deployed” and “serving” mean the same thing.

In Kapten: each application has a readiness check, which decides when an instance receives traffic, and a liveness check, which restarts an instance that stopped responding. Every deployment is a run with its status, timeline and logs. The observability starter kit explains which three alerts to start with.

8. A way back

Every release needs an exit. Keep previous images addressable so a rollback re-points traffic to something that already exists rather than rebuilding it. Remember that an image rollback does not undo a schema migration. The rollbacks guide explains how to make the two compatible.

9. A cost boundary

AI-built apps are often side projects that become real overnight, and cloud bills follow the same curve. Set a budget for each environment before you provision it. Know which line items grow quietly: load balancers, NAT gateways, log retention, idle preview environments. The cost guide lists the usual suspects.

ItemValue ($/mo)
Compute120 $/mo
Managed Postgres85 $/mo
NAT gateway45 $/mo
Idle preview environments40 $/mo
Load balancer25 $/mo
Log retention20 $/mo
Figure 3. A sample monthly bill for a small production environment. The coloured bars are the line items that grow without anyone deciding they should.Illustrative · sample data

Set the budget and the alerts with your cloud provider: the clusters run in your account, so their cost is on your bill. Kapten itself bills each environment for the minutes it exists and shows usage per environment, so deleting an idle environment ends its cost on both sides.

Putting it together

You do not have to run these steps one by one. With Kapten connected to your coding agent, you can ask for the sequence in one request:

In the storefront project, create a production environment on our
prod cluster. Add a private PostgreSQL database named main, then deploy
the api from this repository's main branch with a readiness check on
/healthz. Ask me before each change.

The agent calls the same operations as the Kapten CLI, with the rights of your login, and your client shows each call before it runs.

  1. Connect
    A cluster in your account.
  2. Environment
    Project, type, cluster.
  3. Database
    Credentials as secrets.
  4. Deploy
    Built from GitHub.
    Gate: Readiness
  5. Runs
    Status, timeline, logs.
Figure 4. From repository to production with Kapten: a cluster you own, an environment on it, then the database and the application, each deployment recorded as a run.

Everything runs on your cluster, in your cloud account, on your bill.

What stays with you

Agents can do the platform work. Some decisions remain yours, and they should:

  • Which data you collect, where it is stored and who can see it.
  • Whether the application is ready for real users.
  • Who owns production and approves changes to it.
  • What happens when something breaks at night.

Kapten is in early access. Request access and tell us what you built. The more concrete, the more useful the first conversation. To see the moving parts first, the quickstart deploys a first service step by step.

Build with Kapten

Start with one service.
Build from there.

Tell us what you want to deploy. We review each request and follow up about fit and onboarding on your preferred cloud.

Free during early access. No card required. Cloud usage billed separately.