Skip to content

feat(coolify): add the Coolify provider - #3740

Draft
jensdev wants to merge 2 commits into
alchemy-run:mainfrom
jensdev:feat/coolify-provider
Draft

jensdev wants to merge 2 commits into
alchemy-run:mainfrom
jensdev:feat/coolify-provider

Conversation

@jensdev

@jensdev jensdev commented Nov 24, 2026

Copy link
Copy Markdown

Adds @alchemy.run/coolify: deploy to a self-hosted Coolify (or Coolify Cloud) from an Alchemy stack, on the existing @distilled.cloud/coolify SDK.

Projects and environments

Every project starts with a production environment; declare others with Environment.

const project = yield* Coolify.Project("app", {});

const staging = yield* Coolify.Environment("staging", {
  project: project.projectUuid,
  name: "staging",
});

Applications

The image comes from image or dockerfile (path or Dockerfile.inline), like every other Alchemy container resource; a public git repository is the Coolify-specific third source. reconcile queues a deploy and waits for it, failing with the build log tail.

const api = yield* Coolify.Application("api", {
  project: project.projectUuid,
  environment: staging.environmentUuid,
  server: "<server-uuid>",
  image: "ghcr.io/acme/api@sha256:4f5c…",
  ports: [3000],
  domains: ["https://api.example.com"],
  env: { DATABASE_URL: db.internalUrl },
});

Postgres

const db = yield* Coolify.Database.Postgres("db", {
  project: project.projectUuid,
  environmentName: "production",
  server: "<server-uuid>",
});

Env vars

EnvVar manages one variable on an application, database or compose service, apart from the resource.

yield* Coolify.EnvVar("stripe-key", {
  application: api.applicationUuid,
  key: "STRIPE_SECRET_KEY",
  value: yield* Config.Redacted("STRIPE_SECRET_KEY"),
  shownOnce: true,
});

Ownership is the generated physical name: projects and environments have no tags, and Coolify tags are team-wide names that POST /deploy?tag= deploys together, so stamping one per resource would widen tag deploys.

Live results (Coolify v4.7.6, token limited to one test project)

Test Result
Environment create / rename / delete, drift recreate pass
Project.lookup feeding a managed environment (destroy leaves the project) pass
Scoped token gets typed ActionNotAuthorized / TokenScopeForbidden pass
Non-admin token on the Coolify host gets CoolifyHostRequiresAdmin pass
Project create / delete / drift gated: POST /projects → 403 "You are not authorized to perform this action."
Application (image, Dockerfile), Postgres, EnvVar lifecycles gated: the only server runs Coolify, and a non-admin token gets 403 "Only an admin can place resources on the server that runs Coolify."

🤖 Generated with Claude Code

jensdev and others added 2 commits November 24, 2026 09:42
…ications, Postgres, env vars)

New `@alchemy.run/coolify` package on `@distilled.cloud/coolify`:

- Coolify.Project, Coolify.Environment
- Coolify.Application from `image`, `dockerfile` or a public `git` repo; deploys and waits for the deployment
- Coolify.Database.Postgres
- Coolify.EnvVar on applications, databases and services
- Credentials via COOLIFY_TOKEN + COOLIFY_API_BASE_URL or an Alchemy profile

Live tests in packages/integration-tests/test/Coolify run only with COOLIFY_TEST=1 against a dedicated instance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests take the project and servers from config, create their own environment,
and probe the typed 403s a scoped or non-admin token gets. Docs note the
delete permission and the scoped-token limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant