Skip to content

Deployments

Run apps and backend services on StackMachine Edge compute.

Deploy web apps, APIs, agents, and backend workers directly from source. StackMachine automatically detects the project language and framework, installs dependencies, builds the app, and runs it for you. Upload a project folder as a ZIP or pass inline source files; StackMachine handles app versions, runtime logs, and request traffic.

Features

App processes

Deploy any HTTP service that listens on the provided PORT. StackMachine treats each deployment as an app version that can be observed and replaced.

Regional placement

Pass region when you want a workload close to users, databases, or third-party APIs.

Environment variables

Attach plain or sensitive environment variables at deploy time. Sensitive values are hidden in the dashboard after creation.

Logs and versions

Use app versions and logs to inspect runtime behavior after deploys. The same app identity can receive new versions over time.

Common workflow

  1. Package your app source with its dependency manifests and lockfiles; StackMachine detects the build and start commands.
  2. Deploy it with client.deployments.create and wait for the version.
  3. Use the app URL for traffic and the app version ID for log queries.

SDK examples

Deploy an API worker

Deploy a Hono-based API from source. StackMachine detects its Node.js dependencies and start script from package.json.

serverless-compute.jsserverless_compute.py
const deployment = await client.deployments.create({
  appName: "api-worker",
  owner: "stackmachine",
  region: "iad",
  files: {
    "package.json": JSON.stringify({
      type: "module",
      scripts: { start: "node server.js" },
      dependencies: { "@hono/node-server": "latest", hono: "latest" },
    }),
    "server.js": [
      'import { serve } from "@hono/node-server";',
      'import { Hono } from "hono";',
      "",
      "const app = new Hono();",
      'app.get("/health", (c) => c.json({ ok: true }));',
      'app.post("/tasks/process", async (c) => {',
      "  const payload = await c.req.json();",
      "  return c.json({ accepted: true, payload });",
      "});",
      "",
      "serve({ fetch: app.fetch, port: Number(process.env.PORT || 3000) });",
    ].join("\n"),
  },
  envVars: [{ name: "NODE_ENV", value: "production", sensitive: false }],
});

const appVersion = await deployment.wait({
  onProgress: ({ stream, message }) => console.log(stream, message),
});
console.log(appVersion.app.url);
import json

deployment = client.deployments.create(
    app_name="api-worker",
    owner="stackmachine",
    region="iad",
    files={
        "package.json": json.dumps({
            "type": "module",
            "scripts": {"start": "node server.js"},
            "dependencies": {"@hono/node-server": "latest", "hono": "latest"},
        }),
        "server.js": '\n'.join([
            'import { serve } from "@hono/node-server";',
            'import { Hono } from "hono";',
            'const app = new Hono();',
            'app.get("/health", (c) => c.json({ ok: true }));',
            'app.post("/tasks/process", async (c) => {',
            '  const payload = await c.req.json();',
            '  return c.json({ accepted: true, payload });',
            '});',
            'serve({ fetch: app.fetch, port: Number(process.env.PORT || 3000) });',
        ]),
    },
    env_vars=[{"name": "NODE_ENV", "value": "production", "sensitive": False}],
)
app_version = deployment.wait(
    on_progress=lambda event: print(event.stream, event.message),
)
print(app_version.app.url)

Source: stackmachine/sdks JavaScript examples.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close