Bring an existing app
A product that already ships as a Helm chart, a Compose file, ECS services, or Terraform can move onto Alien without changing its images. You describe the same services in alien.ts, the file that declares your stack, and they deploy and update in every customer environment.
Start from what you have today:
Helm chart or Kubernetes manifests
Deployments, StatefulSets, Jobs, init containers, and sidecars, including Kustomize overlays.
Docker Compose
Services, volumes, one-shot setup services, and depends_on.
ECS
Task definitions, load balancers, secrets by ARN, and scheduled tasks, on Fargate or EC2.
Terraform
The databases, buckets, queues, and keys your Terraform creates in your own account.
The fastest path is your coding agent. From the repository, it finds how the product ships today and starts from there:
If a customer must keep running your chart or task definitions themselves, you can instead add Remote Operator beside them: see Why convert.
An example
A web app, a background worker, Postgres, Redis, and a database setup step, from any of the starting points above:
import * as alien from "@alienplatform/core"
const config = alien.inputs({
// Generated once per deployment. Replaces a password your chart or .env generated.
sessionSecret: alien.secret({
providedBy: "developer",
required: true,
label: "Session secret",
description: "Signs user sessions.",
generate: { length: 64 },
env: { name: "SESSION_SECRET", targetResources: ["web"] },
}),
// The customer's admin enters this at initial setup, into their own secret store.
llmApiKey: alien.secret({
providedBy: "deployer",
required: true,
label: "LLM API key",
description: "Calls the model provider.",
env: { name: "LLM_API_KEY", targetResources: ["worker"] },
}),
})
// Was a bundled Postgres.
const db = new alien.Postgres("db").build()
// Redis stays a container: the app speaks the Redis protocol.
const redis = new alien.Container("redis")
.code({ type: "image", image: "redis:7" })
.cpu(0.5)
.memory("1Gi")
.port(6379)
.persistentStorage("5Gi", { mountPath: "/data" })
.permissions("redis")
.build()
// Was the db-init job. Your backend runs it once with a command.
const setup = new alien.Container("setup")
.code({ type: "image", image: "ghcr.io/acme/setup:2.3.0" })
.cpu(0.25)
.memory("512Mi")
.commandsEnabled(true)
.link(db)
.permissions("setup")
.build()
// Was a web service behind a load balancer.
const web = new alien.Container("web")
.code({ type: "image", image: "ghcr.io/acme/web:2.3.0" })
.cpu(1)
.memory("2Gi")
.port(8000)
.publicEndpoint("app", 8000, "http")
.healthCheck({ path: "/ready", failureThreshold: 10 })
.link(db)
.link(redis)
.permissions("web")
.build()
const worker = new alien.Container("worker")
.code({ type: "image", image: "ghcr.io/acme/worker:2.3.0" })
.cpu(1)
.memory("2Gi")
.link(db)
.link(redis)
.permissions("worker")
.build()
export default new alien.Stack("acme")
.inputs(config)
.add(db, "frozen")
.add(redis, "live")
.add(setup, "live")
.add(web, "live")
.add(worker, "live")
.permissions({
profiles: {
web: { db: ["postgres/data-access"] },
worker: { db: ["postgres/data-access"] },
setup: { db: ["postgres/data-access"] },
redis: {},
},
})
.build()Other containers reach redis and web at the URL from container("redis").getInternalUrl(), which reads the link binding (ALIEN_REDIS_BINDING). Don't build the address from the container ID. On Kubernetes the name includes the namespace (redis.<namespace>.svc), so redis.svc doesn't resolve there. Rewrite the service names your app used before.
Every .link() also orders the start. Two services that call each other can't link both ways: link from the one that starts second, and give the other its address directly, with retries.
Give each service its own permission profile. Services that share a profile but receive different secrets fail validation.
Common mappings
Each starting point has its own mapping page. These hold for all of them:
| Today | In alien.ts |
|---|---|
| A service built from an image | A Container with .code({ type: "image", image }), .cpu(), .memory(), .replicas() |
| A service with a volume | A Container with .persistentStorage(size, { mountPath }) |
| A bundled Postgres, or one in your cloud | alien.Postgres, or the customer's own database on Kubernetes |
| A bundled Redis, RabbitMQ, ClickHouse, or Temporal | A stateful Container with the stock image and a health check that proves it's ready |
| A one-shot setup job | A Container with commands that runs idempotent setup when called, or idempotent steps at the start of one service's command |
| Schema migrations | Your app's own migration command, run before the process starts |
| A scheduled job | A periodic task inside an existing service, or a Worker with a schedule trigger. On AWS, Workers build for Arm, so an x86-only app uses the first option. |
| A password you generate per customer | alien.secret({ providedBy: "developer", generate: { length } }) |
| A credential the customer supplies | alien.secret({ providedBy: "deployer" }). See Inputs and secrets. |
| A service account or task role | One permission profile per service |
| Machine sizes | A ComputeCluster pool with requirements |
There's no Job, sidecar, or init-container resource. Each exists because the old platform needed it; the pages for each starting point show where its work moves.
Why convert
A Helm chart only runs on Kubernetes, a Compose file on one host, and ECS task definitions only on AWS. The customer runs every upgrade. With alien.ts:
- One definition for every target. The same services deploy into an AWS, Google Cloud, or Azure account, a Kubernetes cluster, or Linux servers.
- Updates without the customer.
alien releasereaches every deployment. Nobody runshelm upgrade. - Managed services where they help. Your bundled Postgres can become Aurora, Cloud SQL, or Flexible Server in the customer's account, or their own database on Kubernetes.
- Secrets stay with the customer. The admin writes credentials straight into their own cloud's secret store at initial setup, the one-time step they run.
If the customer must keep running your chart or task definitions themselves, keep them, and add Remote Operator beside them for operations instead.
Images
{ type: "image" } takes any image you already publish, including private ones:
- Log in to your registry on the machine that runs the release, with
docker login. - Run
alien release. Alien pulls each image with your credentials and copies it into your project's registry. - Customer environments pull from Alien's registry with the deployment's own token. Customers never need your registry login.
On AWS, Alien builds for linux-arm64 by default. If your images are x86 only, release for x86 and set the pool's architecture to match:
alien release --targets linux-x64Images that don't use the Alien SDK
Your app reads DATABASE_URL, not an Alien binding. Add a small launcher to a thin image built on yours:
- It resolves the binding.
- It sets the variables your app expects.
- It starts your original process.
import { postgres } from "@alienplatform/sdk"
import { spawn } from "node:child_process"
const db = await postgres("db").connection()
const password = encodeURIComponent(db.password)
const address = `${db.host}:${db.port}/${db.database}`
process.env.DATABASE_URL = `postgres://${db.username}:${password}@${address}`
const app = spawn("/app/start.sh", { stdio: "inherit", env: process.env })
app.on("exit", code => process.exit(code ?? 1))The SDK's native module ships for glibc Linux. On Alpine (musl) images, run the launcher with a glibc Node installed alongside, then start your process.
Verify
alien devruns every service locally. Check the product's main action, not only that services are running.- Release, create a setup link (the URL that opens the setup page), and run initial setup in a cloud account you control.
- Release again and check that the update reaches the deployment and data survives a restart.
Next
- Helm, Docker Compose, ECS, or Terraform: the mapping for your starting point.
- Container: every option for long-running services.
- Inputs and secrets: what the customer enters at initial setup.
- Kubernetes: deploying into a customer's cluster, and using their existing databases.