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

gb connect

SSH into a Genbox environment.

Synopsis

gb connect [name] [options]

Description

Opens an SSH connection to your Genbox environment. Connects as the dev user with full access to your code and services.

Arguments

ArgumentDescription
nameOptional. Environment name. If not provided, connects to current/default environment or prompts for selection.

Options

OptionDescription
-c, --command <cmd>Execute command and exit
--rootConnect as root user

Examples

Interactive Session

# Connect to specific environment gb connect feature-auth # Connect to current environment gb connect

Execute Command

# Run a single command gb connect feature-auth -c "pm2 status" # Check logs gb connect feature-auth -c "pm2 logs api --lines 50" # Run tests gb connect feature-auth -c "cd api && pnpm test"

Root Access

# Connect as root (for system tasks) gb connect feature-auth --root

Environment Details

When connected, you’ll find:

/home/dev/ ├── <project>/ │ ├── admin/ # Admin app │ ├── api/ # API services │ └── web/ # Web app └── .pm2/ # PM2 process manager

Useful Commands Inside

# View running processes pm2 status # View logs pm2 logs pm2 logs api # Restart a service pm2 restart api # Monitor resources pm2 monit # Check MongoDB mongosh # Check Redis redis-cli ping

SSH Configuration

Genbox automatically configures your SSH for easy access:

# You can also connect directly via SSH ssh feature-auth.genbox.dev # Or with explicit user ssh dev@feature-auth.genbox.dev

Notes

  • SSH keys are set up automatically during gb login
  • Connection uses port 22 on the Genbox domain
  • Sessions don’t timeout while active
  • Use gb forward for port forwarding instead of SSH tunnels

See Also

Last updated on