---
title: "Deploy"
description: "Describe an application in one EZGHDeploy file, and every push to an environment's branch builds, plans and rolls it out onto EZGH Cloud."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy

EZGH Deploy runs an application from one file, `EZGHDeploy`, at the root of a GitHub or EZGH Git
repository. The file names the **services** that run your code, the **resources** they use
(databases, caches, queues, buckets), **secrets**, and the **environments** that deploy it. Each
push to an environment's branch builds the services' images, makes a **plan** of the changes, and
applies it: resources first, then a rolling or canary rollout of each changed service.

A **stack** is one repository registered with Deploy. A stack has one or more environments, each
deploying one branch into one project.

## A one-service file

```yaml
version: 1
name: hello
region: us-west-1

services:
  web:
    type: web
    source: ./           # the language and framework are detected; no Dockerfile needed
    port: 3000
    public:
      domains:
        - hello.example.com

environments:
  production:
    branch: main
    project: hello-prod

ci:
  registry: hello        # where built images go in Container Registry
```

Pushing this file to `main`, once the `production` environment is registered, builds the
repository into an image, creates an autoscaling group for `web`, a load balancer with a
certificate for `hello.example.com`, and the network they need in `hello-prod`, then rolls the
service out.

## Resources stay your own

Everything Deploy creates is an ordinary resource of its product, in the environment's project:
the database is on the Databases page, the bucket in Object Storage, the instances in Compute. You
can read and use them there like any other. Their pages say the stack and environment that manage
them, because the file wins for every field it sets. Removing a resource from the file never
deletes it. See [Managed resources](/deploy/resources).

## Pricing

Deploy itself has no charge. The resources it creates are billed by their products as usual.

- [The EZGHDeploy file](/deploy/file) — Services, resources, references, environments and overrides.
- [File reference](/deploy/file-reference) — Every key, its type and the values it takes.
- [Environments](/deploy/environments) — Register a branch and a project, and what the console creates.
- [The canvas](/deploy/canvas) — See and edit a stack, then commit or open a pull request.
- [Deployments](/deploy/deployments) — Statuses, plans, approval, cancel and rollback.
- [Managed resources](/deploy/resources) — Managed, detached and missing resources; attach, forget and delete.
- [Agents](/deploy/agents) — The file's JSON Schema, llms.txt and the MCP server.
- [Deploy a Mastra app](/deploy/mastra) — Mastra agents with EZGH Sandboxes, PostgreSQL and traces in Observability.

Source: https://docs.ezghcloud.com/deploy/index.mdx
