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
| Argument | Description |
|---|---|
name | Optional. Environment name. If not provided, connects to current/default environment or prompts for selection. |
Options
| Option | Description |
|---|---|
-c, --command <cmd> | Execute command and exit |
--root | Connect as root user |
Examples
Interactive Session
# Connect to specific environment
gb connect feature-auth
# Connect to current environment
gb connectExecute 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 --rootEnvironment Details
When connected, you’ll find:
/home/dev/
├── <project>/
│ ├── admin/ # Admin app
│ ├── api/ # API services
│ └── web/ # Web app
└── .pm2/ # PM2 process managerUseful 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 pingSSH 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.devNotes
- 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 forwardfor port forwarding instead of SSH tunnels
See Also
gb forward- Port forwardinggb urls- View service URLsgb status- Check environment status
Last updated on