gb forward
Set up port forwarding to a Genbox environment.
Synopsis
gb forward [name] [options]Description
Creates SSH tunnels to forward local ports to services running in your Genbox. Enables local tools to connect to remote databases and services.
Arguments
| Argument | Description |
|---|---|
name | Optional. Environment name. |
Options
| Option | Description |
|---|---|
--ports <list> | Specific ports to forward (comma-separated) |
--all | Forward all configured ports |
-b, --background | Run in background |
Examples
Forward All Ports
gb forward feature-authOutput:
Port forwarding active for 'feature-auth':
Local → Remote
localhost:27017 → mongodb:27017
localhost:6379 → redis:6379
localhost:3050 → api:3050
localhost:3001 → admin:3001
Press Ctrl+C to stop forwarding.Forward Specific Ports
# Only database ports
gb forward feature-auth --ports 27017,6379
# Only app ports
gb forward feature-auth --ports 3050,3001Background Mode
# Run in background
gb forward feature-auth -b
# Check running forwards
gb forward --list
# Stop forwarding
gb forward --stopUse Cases
Local Database Tools
Connect MongoDB Compass or TablePlus to your remote database:
gb forward feature-auth --ports 27017
# Then connect with:
# mongodb://localhost:27017/mydbLocal Debugging
Debug remote API with local IDE:
gb forward feature-auth --ports 3050
# API now accessible at localhost:3050Redis CLI
gb forward feature-auth --ports 6379
# Then use local redis-cli:
redis-cli -h localhost -p 6379Port Mapping
By default, ports map 1:1 (local:remote). All configured service ports are forwarded:
| Service | Default Port |
|---|---|
| MongoDB | 27017 |
| Redis | 6379 |
| RabbitMQ | 5672 |
| API Gateway | 3050 |
| Admin | 3001 |
| Web | 3000 |
Notes
- Requires SSH access (set up via
gb login) - Forwarding uses SSH tunnels
- Stops when terminal closes (unless
-b) - Only one forward session per environment
See Also
gb connect- SSH accessgb urls- View remote URLsgb status- Check environment status
Last updated on