Get started

    Deploy Node.js, Python, PHP, WordPress, and more on infrastructure built for density, fast cold starts, and affordable scaling.

    Your user

    Creates an app

    Your backend

    Publishes the site using the StackMachine SDK

    StackMachine

    Hosts the app

    Live URL

    Shown in your UI

    1

    Install StackMachine

    Add the SDK to the backend that will create, deploy, and manage apps for your users.
    Shell
    $ npm install stackmachine
    2

    Call the StackMachine SDK from your backend

    Think of the SDK like Stripe for hosting: your backend makes one call, StackMachine runs the app, and you get back a URL.
    deploy-express.js
    import StackMachine from "stackmachine";
    
    const client = new StackMachine(process.env.STACKMACHINE_API_KEY);
    
    const deployment = await client.deployments.create({
      appName: "my-express-app",
      files: {
        "package.json": JSON.stringify({
          type: "module",
          dependencies: { express: "^4.18.3" },
        }),
        "server.js": `import express from "express";
    
    const app = express();
    const port = process.env.PORT || 3000;
    
    app.get("/", (_req, res) => {
      res.send("<h1>Hello from Express on StackMachine!</h1>");
    });
    
    app.listen(port, () => {
      console.log("Express app listening on " + port);
    });
    `,
      },
    });
    
    const appVersion = await deployment.wait({
      onProgress: ({ message, datetime }) => {
        if (message) console.log(datetime, message);
      },
    });
    
    const app = await client.apps.retrieve(appVersion.app.id);
    console.log("App deployed!", app.url);