ZuploZuplo
LoginSign Up
  • Documentation
  • API Reference
Introduction
Getting Started
    Develop using the Portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingMCP - Quick start
    Develop Locally
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth
Concepts
Development
    CORSEnvironment VariablesBranch-Based DeploymentsTestingTroubleshootingGitOps vs TerraformCustom Code
    Local Development
    Guides
Policies
Handlers
API Keys
MCP Server
MCP Gateway
AI Gateway
Developer Portal
Monetization
Deploying & Source Control
Observability
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsSecuritySupportTrust & ComplianceChangelog
powered by Zudoku
Development

Branch-Based Deployments

Zuplo uses a branch-based deployment model that automatically maps Git branches to environments. This GitOps approach allows teams to manage API deployments using familiar version control workflows.

How Branch-Based Deployments Work

When you connect your Zuplo project to a Git repository (GitHub, GitLab, Bitbucket, or Azure DevOps), Zuplo automatically deploys your API whenever changes are pushed to a branch. The deployment model follows these rules:

  1. One branch = One environment: Each Git branch creates a corresponding Zuplo environment
  2. Default branch = Production: The repository's default branch (typically main or master) deploys to the Production environment
  3. All other branches = Preview: Any branch that's not the default branch deploys to a Preview environment
Code
Git Repository Zuplo Environments ───────────────── ────────────────── main ─────────────────► Production (main) staging ─────────────────► Preview (staging) feature/auth ─────────────────► Preview (feature/auth) bugfix/123 ─────────────────► Preview (bugfix/123)

Environment Names and URLs

When Zuplo deploys an environment from a branch, the environment name matches the branch name. For example:

Branch NameEnvironment NameExample URL
mainmainhttps://my-project-main-abc1234.zuplo.app
stagingstaginghttps://my-project-staging-def5678.zuplo.app
feature/authfeature/authhttps://my-project-feature-auth-ghi9012.zuplo.app

The environment URL includes a unique identifier to ensure each deployment has a distinct address. Configure custom domains for your environments.

Production vs Preview Environments

What Determines the Production Environment

The Production environment is determined by your repository's default branch setting. This is configured in your Git provider (GitHub, GitLab, etc.), not in Zuplo. When you change your repository's default branch, Zuplo automatically treats the new default branch as Production.

To change which branch is your Production environment:

  1. Go to your Git repository settings (for example, GitHub > Settings > General > Default branch)
  2. Change the default branch to your desired branch
  3. Zuplo will now treat deployments from this branch as Production

Technical Differences

There is no technical difference between Production and Preview environments. Both:

  • Have identical performance characteristics
  • Support all Zuplo features
  • Run on the same infrastructure

The distinction is primarily for:

  • Environment variable management: You can set different values for Production vs Preview environments
  • API key buckets: Production and Preview environments use separate API key buckets by default
  • Organization: Helps teams distinguish between live and test deployments

Using Preview Environments as Production

Some customers choose to use Preview environments as additional "production" deployments. For example, you might have:

  • main → Production (US customers)
  • eu-production → Preview, but serving EU customers
  • staging → Preview for testing

This works because Preview environments have identical capabilities to Production. You can override environment variables and API key buckets for specific Preview environments to support this pattern.

Creating New Environments

Creating a new environment is as simple as creating a new Git branch:

TerminalCode
# Create and push a new branch git checkout -b my-new-feature git push -u origin my-new-feature

Within seconds, Zuplo deploys a new environment named my-new-feature. You can see the new environment in the Zuplo Portal's environment selector or on the Environments tab of your project.

Deleting Environments

When you delete a branch in your Git repository, the corresponding Zuplo environment is not automatically deleted. To delete an environment:

  1. In your project, open the Environments tab
  2. Select the environment and delete it

Alternatively, use the Zuplo CLI:

TerminalCode
npx zuplo delete --url https://your-environment-url.zuplo.app --api-key $ZUPLO_API_KEY

Automatic Deployments on Push

With the Git integration enabled, every push to a branch triggers an automatic deployment:

  1. Push to default branch: Updates the Production environment
  2. Push to other branches: Updates the corresponding Preview environment
  3. Create new branch: Creates a new Preview environment
  4. Merge pull request: Updates the target branch's environment

This enables powerful GitOps workflows:

  • Feature branches: Each feature gets its own testable environment
  • Pull request previews: Review changes in a live environment before merging
  • Protected branches: Use branch protection rules to gate Production deployments

Environment Variables Per Branch

Environment variables can be scoped to specific environments:

ScopeDescription
ProductionOnly applies to the Production environment
PreviewApplies to all Preview environments
Specific PreviewApplies to a specific Preview environment (by branch name)
Working CopyOnly applies to development environments

See Environment Variables for configuration details.

Switching the Production Branch

If you need to change which branch serves as Production:

  1. Update your Git repository's default branch:

    • GitHub: Settings > General > Default branch
    • GitLab: Settings > Repository > Branch defaults
    • Bitbucket: Repository settings > Branching model
    • Azure DevOps: Project settings > Repositories > Default branch
  2. Verify the change in Zuplo: The environment deployed from your new default branch will now be labeled as Production

Changing the default branch affects which environment receives Production environment variables and uses the Production API key bucket. Plan this change carefully to avoid service disruption.

Next Steps

  • Environments Overview - Learn about environment types
  • Source Control Integration - Set up Git integration
  • Custom CI/CD Pipelines - Build custom deployment workflows
Edit this page
Last modified on May 10, 2026
Environment VariablesTesting
On this page
  • How Branch-Based Deployments Work
  • Environment Names and URLs
  • Production vs Preview Environments
    • What Determines the Production Environment
    • Technical Differences
    • Using Preview Environments as Production
  • Creating New Environments
  • Deleting Environments
  • Automatic Deployments on Push
  • Environment Variables Per Branch
  • Switching the Production Branch
  • Next Steps