Docs

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:

The fastest path is your coding agent. From the repository, it finds how the product ships today and starts from there:

Bring this app to Alien
Install the Alien skills: npx skills add alienplatform/skills Use the alien-integration skill to bring this app to Alien as a whole-product deployment in the customer's environment. Find how it installs today (Helm chart, Docker Compose, ECS task definitions, Terraform) and start from that, following https://alien.dev/docs/guide/existing-app.md. Inventory every workload, image, config file, secret, job, init container, and sidecar, and map each one to alien.ts. Show me the mapping before writing alien.ts. Give every stateful service and setup step a health check that proves it's ready. Verify with alien dev, including a real login and the product's main action. Don't publish a release, create a customer deployment, or apply any infrastructure change without asking.

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:

alien.ts
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:

TodayIn alien.ts
A service built from an imageA Container with .code({ type: "image", image }), .cpu(), .memory(), .replicas()
A service with a volumeA Container with .persistentStorage(size, { mountPath })
A bundled Postgres, or one in your cloudalien.Postgres, or the customer's own database on Kubernetes
A bundled Redis, RabbitMQ, ClickHouse, or TemporalA stateful Container with the stock image and a health check that proves it's ready
A one-shot setup jobA Container with commands that runs idempotent setup when called, or idempotent steps at the start of one service's command
Schema migrationsYour app's own migration command, run before the process starts
A scheduled jobA 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 customeralien.secret({ providedBy: "developer", generate: { length } })
A credential the customer suppliesalien.secret({ providedBy: "deployer" }). See Inputs and secrets.
A service account or task roleOne permission profile per service
Machine sizesA 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 release reaches every deployment. Nobody runs helm 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:

  1. Log in to your registry on the machine that runs the release, with docker login.
  2. Run alien release. Alien pulls each image with your credentials and copies it into your project's registry.
  3. 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-x64

Images 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:

  1. It resolves the binding.
  2. It sets the variables your app expects.
  3. It starts your original process.
launch.ts
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

  1. alien dev runs every service locally. Check the product's main action, not only that services are running.
  2. Release, create a setup link (the URL that opens the setup page), and run initial setup in a cloud account you control.
  3. Release again and check that the update reaches the deployment and data survives a restart.

Next

On this page