docs
Tezz Documentation  /  Deployment

Deployment Guide

Take your Tezz applications to production seamlessly.

Tezz compiles directly to highly optimized JavaScript. Because it handles the server abstraction at the compilation phase, you can compile for different target environments using a simple flag.

Deploying to Node.js (Default)

By default, Tezz compiles to a standard Node.js HTTP server. This is perfect for deploying on VPS (DigitalOcean, Linode), AWS EC2, Heroku, or Render.

  1. Compile your code:
    tezz build app.tezz --target node --output dist/server.js
  2. Run it in production:
    node dist/server.js

Deploying to Cloudflare Workers

Tezz has first-class support for Cloudflare Workers, allowing you to run your backend on the edge with 0ms cold starts globally.

  1. Compile targeting the Worker runtime (this generates an ES Module with a fetch handler instead of a Node HTTP server):
    tezz build app.tezz --target worker --output dist/worker.js
  2. Use Wrangler to deploy the compiled file:
    npx wrangler deploy dist/worker.js --name tezz-api --compatibility-date 2024-01-01

Why Target-Based Compilation?

When you write a service block in Tezz, the language doesn't just evaluate it—it fundamentally transforms it. If you target node, the codegen outputs http.createServer. If you target worker, it outputs an export default { fetch() } object. Your source code never changes.