Docs

Overview

Run an always-on process in each customer's environment.

Daemons run an always-on process. Use Daemon for local connectors, sync loops, telemetry collectors, command handlers, and Kubernetes/on-prem helper processes that should start once and keep running.

Daemons can run anywhere Alien has a daemon controller. They are private by default and can optionally expose named HTTP public endpoints.

Platform Mapping

PlatformBacking RuntimeStatus
LocalLocal process from a container imageSupported
Kubernetes / On-PremSingle-replica Kubernetes DeploymentSupported
AWSVM-backed process behind managed load balancingSupported
GCPVM-backed process behind managed load balancingSupported
AzureVM-backed process behind managed load balancingSupported

When to Use

Use Daemon when the work is process-oriented: a connector that maintains a long-lived session, a background command executor, a local/on-prem control loop, or a helper service that should restart if it exits.

Use Worker for request-response handlers. Use Container for cloud services with ports, stateful storage, GPUs, or scaling.

Quick Start

alien.ts
import * as alien from "@alienplatform/core"

const connector = new alien.Daemon("connector")
  .code({ type: "image", image: "ghcr.io/acme/connector:2026-05-17" })
  .commandsEnabled(true)
  .environment({
    LOG_LEVEL: "info",
  })
  .permissions("execution")
  .build()

export default new alien.Stack("edge")
  .add(connector, "live")
  .platforms(["local", "kubernetes"])
  .build()

Public Endpoints

Daemons are private unless they declare a named HTTP endpoint:

const gateway = new alien.Daemon("gateway")
  .code({ type: "image", image: "ghcr.io/acme/gateway:v1" })
  .publicEndpoint("api", 8080, "http")
  .permissions("execution")
  .build()

Commands

Daemons can participate in the Commands protocol. Enable commands when the process should poll the manager for work and dispatch registered command handlers.

const executor = new alien.Daemon("executor")
  .code({ type: "image", image: "ghcr.io/acme/executor:v1" })
  .commandsEnabled(true)
  .permissions("execution")
  .build()

Configuration

MethodRequiredDescription
.code(code)YesContainer image or source build configuration. Current Local/Kubernetes controllers run image-based daemons.
.environment(vars)NoEnvironment variables injected into the daemon process.
.link(resource)NoGives the daemon binding access to another resource.
.publicEndpoint(name, port, "http")NoAdds a named HTTP public endpoint.
.permissions(profile)YesPermission profile used for linked resources and cloud access.
.commandsEnabled(boolean)NoEnables remote command polling. Default: false.

Daemons do not have triggers, direct invocation, request timeouts, replica settings, or autoscaling.

See API Reference for every builder method and Behavior & Limits for supported platforms and lifecycle behavior.

On this page