# Step 4 - Deploy to the Edge

In this guide we'll deploy your locally-developed gateway to the edge, at over
300 data-centers around the world. Zuplo deploys from Git source control — once
your project is connected to a GitHub repository, every push deploys
automatically, with no CI/CD configuration required.

The act of deployment creates new [environments](./environments.mdx), so it's
worth familiarizing yourself with [how environments work](./environments.mdx).

To follow this tutorial you'll need a GitHub account (it's free, sign up at
[github.com](https://github.com)).

<Stepper>

1. **Check your project status**

   From your project directory, run `zuplo info` to see how your local project
   maps to Zuplo:

   ```bash
   npx zuplo info
   ```

   ```bash
   Project: example-project
   Account: your-account
   Portal: https://portal.zuplo.com/your-account/example-project
   Environment Type: working-copy
   Source Control: none, connect at https://portal.zuplo.com/your-account/example-project/settings/source-control-settings
   ```

   Notice the **Source Control** line shows `none` — your project isn't
   connected to a repository yet. The next steps walk through connecting one so
   your changes deploy automatically.

1. **Create a GitHub repository**

   In GitHub, [create a new repository](https://github.com/new). Leave it
   **empty** — don't add a README, `.gitignore`, or license — since your project
   already contains those files.

1. **Push your project to GitHub**

   `create-zuplo-api` already initialized your project as a Git repository.
   Stage and commit your work (if you haven't already), then point your local
   repo at the new GitHub repository and push:

   ```bash
   git add .
   git commit -m "Initial commit"
   git remote add origin https://github.com/your-account/example-project.git
   git branch -M main
   git push -u origin main
   ```

1. **Connect the repository in Zuplo**

   Open the source-control settings link from the `zuplo info` output, or in the
   Zuplo Portal open **Settings → Source Control**.

   If this is your first time, click **Connect to GitHub** and authorize the
   Zuplo GitHub app — see [GitHub Setup](./source-control-setup-github.mdx) for
   a detailed walkthrough of the authorization flow and permissions.

   Once the app has access to your repositories, find the repository you just
   pushed to in the list and click **Connect**.

   :::note{title="Non-empty repository warning"}

   Because you already pushed your project, the portal will show a dialog
   warning that the repository isn't empty and that connecting will only create
   an association — no changes will be pushed or pulled automatically. That's
   exactly what we want here, so click **Connect** to proceed.

   :::

1. **Verify your deployment**

   As soon as the repository is connected, Zuplo deploys your `main` branch. In
   GitHub you'll see a status check next to your commit; when it succeeds, the
   deployment links to your new environment.

   Run `zuplo info` again to confirm your project is now connected to source
   control:

   ```bash
   npx zuplo info
   ```

   :::tip{title="Branch environments"}

   Every branch you push gets its own isolated environment. Create a
   `development` branch, push it, and Zuplo deploys a matching environment
   automatically. See [Branch-Based Deployments](./branch-based-deployments.mdx)
   to learn how branches map to environments.

   :::

</Stepper>

**NEXT** Try
[Step 5 - Add Dynamic Rate Limiting](./step-5-dynamic-rate-limiting-local.mdx).
