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

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

ArgumentDescription
nameOptional. Environment name.

Options

OptionDescription
--ports <list>Specific ports to forward (comma-separated)
--allForward all configured ports
-b, --backgroundRun in background

Examples

Forward All Ports

gb forward feature-auth

Output:

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,3001

Background Mode

# Run in background gb forward feature-auth -b # Check running forwards gb forward --list # Stop forwarding gb forward --stop

Use 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/mydb

Local Debugging

Debug remote API with local IDE:

gb forward feature-auth --ports 3050 # API now accessible at localhost:3050

Redis CLI

gb forward feature-auth --ports 6379 # Then use local redis-cli: redis-cli -h localhost -p 6379

Port Mapping

By default, ports map 1:1 (local:remote). All configured service ports are forwarded:

ServiceDefault Port
MongoDB27017
Redis6379
RabbitMQ5672
API Gateway3050
Admin3001
Web3000

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

Last updated on