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
| Argument | Description |
|---|---|
name | Optional. Name for the environment. Must be URL-safe (lowercase, hyphens allowed). |
Options
| Option | Description |
|---|---|
-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, --yes | Skip confirmation prompts |
--dry-run | Show what would be created without creating |
Examples
Basic Creation
# Create with random name
gb create
# Create with specific name
gb create feature-authUsing 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-stackCustomizing 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 apiServer 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 xlDatabase 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 snapshotBranch 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/authAutomation
# Skip all prompts
gb create my-feature --profile full-stack -y
# Preview without creating
gb create my-feature --profile full-stack --dry-runWorkflow
- Configuration Loading: Reads
genbox.yamland resolves profile - Validation: Checks configuration and SSH setup
- Confirmation: Shows summary (unless
-yflag) - Server Provisioning: Allocates cloud resources
- Repository Cloning: Clones specified repos and branches
- Infrastructure Setup: Starts MongoDB, Redis, etc.
- Database Sync: Copies data if configured
- Dependency Installation: Runs install commands
- Service Startup: Starts apps with PM2
- 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 extendto disable auto-destroy - Use
gb status -wto watch creation progress - Database copy may take several minutes for large datasets
See Also
gb status- Monitor environment statusgb connect- SSH into environmentgb destroy- Delete environment
Last updated on