Skip to Content
New to Genbox? Check out our Getting Started guide
Commandscreate

gb create

Create a new Genbox development environment.

Synopsis

gb create [name] [options]

Description

Creates a new cloud development environment with your configured apps, infrastructure, and database settings. If no name is provided, a random name is generated.

Arguments

ArgumentDescription
nameOptional. Name for the environment. Must be URL-safe (lowercase, hyphens allowed).

Options

OptionDescription
-p, --profile <name>Use a specific profile from genbox.yaml
--apps <list>Comma-separated list of apps to include
--add-apps <list>Add apps to the profile’s default list
--size <size>Server size: small, medium, large, xl
--db <mode>Database mode: none, local, copy, snapshot, remote
--db-source <env>Source environment for database copy
--branch <name>Git branch to checkout
--new-branch <name>Create a new branch from source
--source-branch <name>Source branch for new branch creation
-y, --yesSkip confirmation prompts
--dry-runShow what would be created without creating

Examples

Basic Creation

# Create with random name gb create # Create with specific name gb create feature-auth

Using Profiles

# Use a specific profile gb create my-feature --profile admin-quick # Use full-stack profile with database copy gb create my-feature --profile full-stack

Customizing Apps

# Only include specific apps gb create my-feature --apps admin,api # Add apps to profile defaults gb create my-feature --profile admin-quick --add-apps api

Server Size

# Small: 2 vCPU, 4GB RAM (1 credit/hour) gb create my-feature --size small # Medium: 4 vCPU, 8GB RAM (2 credits/hour) gb create my-feature --size medium # Large: 8 vCPU, 16GB RAM (4 credits/hour) gb create my-feature --size large # XL: 16 vCPU, 32GB RAM (8 credits/hour) gb create my-feature --size xl

Database Options

# No database gb create my-feature --db none # Local empty database gb create my-feature --db local # Copy from staging gb create my-feature --db copy --db-source staging # Copy from production (read-only snapshot) gb create my-feature --db copy --db-source production # Use existing snapshot gb create my-feature --db snapshot

Branch Management

# Use specific branch gb create my-feature --branch develop # Create new branch from main gb create my-feature --new-branch feature/auth --source-branch main # Create new branch from current gb create my-feature --new-branch feature/auth

Automation

# Skip all prompts gb create my-feature --profile full-stack -y # Preview without creating gb create my-feature --profile full-stack --dry-run

Workflow

  1. Configuration Loading: Reads genbox.yaml and resolves profile
  2. Validation: Checks configuration and SSH setup
  3. Confirmation: Shows summary (unless -y flag)
  4. Server Provisioning: Allocates cloud resources
  5. Repository Cloning: Clones specified repos and branches
  6. Infrastructure Setup: Starts MongoDB, Redis, etc.
  7. Database Sync: Copies data if configured
  8. Dependency Installation: Runs install commands
  9. Service Startup: Starts apps with PM2
  10. Health Checks: Verifies services are running

Output

On success, shows:

  • Environment name and status
  • Service URLs
  • SSH connection command
  • Estimated hourly cost
âś“ Environment 'feature-auth' created successfully! Services: admin https://admin.feature-auth.genbox.dev api https://api.feature-auth.genbox.dev Connect: gb connect feature-auth Status: gb status feature-auth Cost: 2 credits/hour (medium)

Notes

  • Environments auto-destroy after 58 minutes of inactivity
  • Use gb extend to disable auto-destroy
  • Use gb status -w to watch creation progress
  • Database copy may take several minutes for large datasets

See Also

Last updated on