gb restart
Restart services in a Genbox environment.
Synopsis
gb restart [name] [options]Description
Restarts application services without restarting the entire server. Useful after code changes or to recover from stuck processes.
Arguments
| Argument | Description |
|---|---|
name | Optional. Environment name. |
Options
| Option | Description |
|---|---|
--app <name> | Restart specific app only |
--infra | Also restart infrastructure (MongoDB, Redis) |
-w, --watch | Watch restart progress |
Examples
Restart All Apps
gb restart feature-authRestart Specific App
# Restart only the API
gb restart feature-auth --app api
# Restart only admin
gb restart feature-auth --app adminInclude Infrastructure
# Restart everything including MongoDB and Redis
gb restart feature-auth --infraWhat Gets Restarted
By default:
- All PM2-managed application processes
With --infra:
- MongoDB
- Redis
- RabbitMQ
- Other infrastructure services
Use Cases
- After code changes: Restart to pick up changes
- Memory issues: Clear memory by restarting
- Stuck processes: Recover from hangs
- Config changes: Apply new environment variables
Notes
- Faster than
gb rebuild(no reinstallation) - Database data is preserved
- Brief downtime during restart
- Use
--appfor zero-downtime partial restarts
See Also
gb rebuild- Full rebuild with reinstallationgb push- Push code changesgb status- Check service status
Last updated on