Commands Reference
This guide covers all available Suthep commands and their options.
Command Overview
Suthep provides the following commands:
suthep init- Initialize configuration filesuthep setup- Setup prerequisitessuthep deploy- Deploy servicessuthep down- Stop servicessuthep up- Start servicessuthep restart- Restart servicessuthep list- List all services and their statussuthep logs- View service logssuthep self-update- Update suthep to the latest version from npm
suthep init
Initialize a new deployment configuration file with interactive prompts.
Usage
suthep init [options]Options
| Option | Short | Description | Default |
|---|---|---|---|
--file | -f | Configuration file path | suthep.yml |
Examples
# Create default configuration file
suthep init
# Create custom configuration file
suthep init -f my-config.ymlInteractive Prompts
The init command will prompt you for:
-
Project Information
- Project name
- Project version
-
Service Configuration (for each service)
- Service name
- Service port
- Domain names (comma-separated)
- Docker usage
- Docker image (if using Docker)
- Container name
- Container port
- Health check configuration
- Health check path
- Health check interval
-
SSL Certificate
- Email for Let's Encrypt
- Staging environment (for testing)
suthep setup
Install and configure Nginx and Certbot on your system.
Usage
suthep setup [options]Options
| Option | Description |
|---|---|
--nginx-only | Only install and configure Nginx |
--certbot-only | Only install and configure Certbot |
Examples
# Setup both Nginx and Certbot
suthep setup
# Setup only Nginx
suthep setup --nginx-only
# Setup only Certbot
suthep setup --certbot-onlyWhat It Does
- Checks for existing installations
- Installs missing components:
- Nginx (via apt-get, yum, or Homebrew)
- Certbot (via apt-get, yum, or Homebrew)
- Starts and enables services
Note: Requires sudo privileges.
suthep deploy
Deploy your project using the configuration file.
Usage
suthep deploy [service-name] [options]Arguments
| Argument | Description |
|---|---|
service-name | Name or index (1-based) of the service to deploy (optional, deploys all services if not specified). Use suthep list to see available services with indices. |
Options
| Option | Short | Description | Default |
|---|---|---|---|
--file | -f | Configuration file path | suthep.yml |
--no-https | - | Skip HTTPS/SSL certificate setup | false |
--no-nginx | - | Skip Nginx configuration | false |
--env | -e | Set environment variables (can be used multiple times, e.g., -e KEY1=value1 -e KEY2=value2) | - |
Examples
# Deploy all services with default configuration
suthep deploy
# Deploy a specific service by name
suthep deploy api
# Deploy a specific service by index (see indices with `suthep list`)
suthep deploy 1
# Deploy with custom config file
suthep deploy -f production.yml
# Deploy a specific service without HTTPS (for testing)
suthep deploy api --no-https
# Deploy without Nginx (for testing)
suthep deploy --no-nginx
# Deploy without both
suthep deploy --no-https --no-nginx
# Deploy with environment variables
suthep deploy api -e NODE_ENV=production -e API_KEY=secret123
# Deploy with environment variables and custom config
suthep deploy -f production.yml -e DATABASE_URL=postgres://localhost/db -e REDIS_URL=redis://localhostWhat It Does
- Loads configuration from
suthep.yml - Starts Docker containers (if configured)
- Configures Nginx reverse proxy
- Obtains SSL certificates (if enabled)
- Updates Nginx with HTTPS configuration
- Reloads Nginx to apply changes
- Performs health checks (if configured)
suthep down
Bring down services (stop containers and disable Nginx configs).
Usage
suthep down [service-name] [options]Arguments
| Argument | Description |
|---|---|
service-name | Name or index (1-based) of the service to bring down (optional). Use suthep list to see available services with indices. |
Options
| Option | Short | Description | Default |
|---|---|---|---|
--file | -f | Configuration file path | suthep.yml |
--all | - | Bring down all services | false |
Examples
# Bring down a specific service by name
suthep down api
# Bring down a specific service by index
suthep down 1
# Bring down all services
suthep down --all
# Bring down with custom config
suthep down api -f production.ymlWhat It Does
- Stops Docker containers (if configured)
- Disables Nginx configurations
- Reloads Nginx to apply changes
suthep up
Bring up services (start containers and enable Nginx configs).
Usage
suthep up [service-name] [options]Arguments
| Argument | Description |
|---|---|
service-name | Name or index (1-based) of the service to bring up (optional). Use suthep list to see available services with indices. |
Options
| Option | Short | Description | Default |
|---|---|---|---|
--file | -f | Configuration file path | suthep.yml |
--all | - | Bring up all services | false |
--no-https | - | Skip HTTPS setup | false |
--no-nginx | - | Skip Nginx configuration | false |
Examples
# Bring up a specific service by name
suthep up api
# Bring up a specific service by index
suthep up 1
# Bring up all services
suthep up --all
# Bring up without HTTPS
suthep up api --no-httpsWhat It Does
- Starts Docker containers (if configured)
- Enables Nginx configurations
- Sets up HTTPS (if enabled)
- Reloads Nginx to apply changes
suthep restart
Restart services (stop and start containers, update Nginx configs).
Usage
suthep restart [service-name] [options]Arguments
| Argument | Description |
|---|---|
service-name | Name or index (1-based) of the service to restart (optional). Use suthep list to see available services with indices. |
Options
| Option | Short | Description | Default |
|---|---|---|---|
--file | -f | Configuration file path | suthep.yml |
--all | - | Restart all services | false |
--no-https | - | Skip HTTPS setup | false |
--no-nginx | - | Skip Nginx configuration | false |
Examples
# Restart a specific service by name
suthep restart api
# Restart a specific service by index
suthep restart 1
# Restart all services
suthep restart --all
# Restart without HTTPS
suthep restart api --no-https
# Restart without Nginx updates
suthep restart api --no-nginx
# Restart with custom config
suthep restart api -f production.ymlWhat It Does
- Stops Docker containers (if running)
- Starts Docker containers again
- Waits for health checks (if configured)
- Updates Nginx configurations
- Sets up HTTPS (if enabled)
- Reloads Nginx to apply changes
suthep list
List all services and their status (running, stopped, container status, Nginx configuration).
Usage
suthep list [options]
# or
suthep ls [options]Options
| Option | Short | Description | Default |
|---|---|---|---|
--file | -f | Configuration file path | suthep.yml |
Examples
# List all services
suthep list
# Use the alias
suthep ls
# List with custom config file
suthep list -f production.ymlWhat It Does
- Loads configuration from
suthep.yml - Checks Docker container status for each service (if configured)
- Checks Nginx configuration status for each service
- Displays a formatted table showing:
- Service index number (1, 2, 3...)
- Service name
- Overall status (Running/Stopped/Partial)
- Port number
- Container name and status
- Nginx configuration status
- Domain names
- Shows summary statistics (running, stopped, total)
Notes
- Service indices: The index numbers shown in the list can be used with other commands (e.g.,
suthep restart 1instead ofsuthep restart api) - Index-based selection: All service commands (
deploy,up,down,restart,logs) support both service names and indices
Output Format
The command displays a color-coded table:
- ● Running (green) - Service is fully operational (container running + Nginx enabled)
- ○ Stopped (red) - Service is stopped (container stopped + Nginx disabled)
- ⚠ Partial (yellow) - Mixed state (e.g., container running but Nginx disabled)
Status Indicators
- Container Status: Shows if Docker containers are running or stopped
- Nginx Status: Shows if Nginx configuration is enabled, disabled, or not configured
- Overall Status: Combines container and Nginx status to show the complete service state
Notes
- Docker services: Status depends on both container and Nginx configuration
- Non-Docker services: Status depends only on Nginx configuration
- Partial status: Indicates a service that's partially configured (e.g., container running but Nginx not enabled)
- The command checks actual container and file system state, not just configuration
suthep logs
View logs for Docker services running in your project.
Usage
suthep logs [service-name] [options]Arguments
| Argument | Description |
|---|---|
service-name | Name or index (1-based) of the service to show logs for (optional, shows all services if not specified). Use suthep list to see available services with indices. |
Options
| Option | Short | Description | Default |
|---|---|---|---|
--file | -f | Configuration file path | suthep.yml |
--follow | - | Follow log output (like tail -f) | false |
--tail | - | Number of lines to show from the end of logs | 100 |
Examples
# Show logs for all services (last 100 lines)
suthep logs
# Show logs for a specific service by name
suthep logs api
# Show logs for a specific service by index
suthep logs 1
# Follow logs for all services (real-time streaming)
suthep logs --follow
# Follow logs for a specific service
suthep logs api --follow
# Show last 50 lines for a specific service
suthep logs api --tail 50
# Follow logs with custom tail
suthep logs api --follow --tail 200What It Does
- Loads configuration from
suthep.yml - Filters Docker services (only Docker services have container logs)
- Checks container status (only shows logs for running containers)
- Displays logs:
- In non-follow mode: Shows recent logs and exits
- In follow mode: Streams logs in real-time until interrupted (Ctrl+C)
- Color-codes output by service name for easy identification
Notes
- Docker services only: Logs are only available for services with Docker configuration. Non-Docker services are skipped with a warning.
- Running containers only: Only shows logs for containers that are currently running. Stopped containers are listed separately.
- Follow mode: Use
--followto stream logs in real-time. PressCtrl+Cto stop. - Multiple services: When viewing logs for multiple services, each log line is prefixed with the service name in a unique color.
- Tail option: The
--tailoption controls how many lines to show from the end of the log file. This applies to both follow and non-follow modes.
suthep self-update
Update suthep to the latest version from npm registry.
Usage
suthep self-update [options]
# or
suthep update [options]Options
| Option | Description | Default |
|---|---|---|
--force | Force update even if current version is newer | false |
Examples
# Check for updates and update if available
suthep self-update
# Use the alias
suthep update
# Force update even if current version is newer
suthep self-update --forceWhat It Does
- Reads package information from
package.json(package name and current version) - Fetches latest version from npm registry (https://registry.npmjs.org/)
- Compares versions (current vs latest)
- Updates if needed:
- If latest version is newer: Updates to latest version
- If versions are the same: Shows message that you're up to date
- If current version is newer: Warns (unless
--forceis used)
- Installs update globally using
npm install -g
Notes
- Network connection required: The command needs internet access to fetch version information from npm registry
- Global installation: Updates the globally installed suthep package
- Terminal restart: After updating, you may need to restart your terminal for changes to take effect
- Explicit npm registry: Uses the official npm registry (registry.npmjs.org) explicitly to ensure reliable updates
- Version comparison: Uses semantic version comparison to determine if an update is needed
- Force flag: Use
--forceonly if you want to downgrade or reinstall the current version
Output
The command provides clear feedback:
- Current version number
- Latest version from npm
- Update status
- Success/error messages
Global Options
All commands support:
--helpor-h- Show help message--versionor-V- Show version number
Examples
# Show help for deploy command
suthep deploy --help
# Show version
suthep --versionCommand Workflow
Typical Deployment Workflow
# 1. Initialize configuration
suthep init
# 2. Setup prerequisites (first time only)
suthep setup
# 3. Deploy services
suthep deployUpdate Workflow
# 1. Edit suthep.yml
nano suthep.yml
# 2. Redeploy (bring down and deploy again)
suthep down api && suthep deploy api
# Or redeploy all services
suthep down --all && suthep deploy
# Or simply restart a service
suthep restart apiMaintenance Workflow
# Stop services for maintenance
suthep down --all
# ... perform maintenance ...
# Start services again
suthep up --allExit Codes
Suthep uses the following exit codes:
0- Success1- Error (configuration error, deployment failure, etc.)
Error Handling
If a command fails:
- Check the error message - It usually indicates what went wrong
- Verify configuration - Ensure
suthep.ymlis valid - Check prerequisites - Ensure Nginx and Certbot are installed
- Review logs - Check Nginx and Docker logs for details
Next Steps
- Examples - See commands in action
- Troubleshooting - Common issues and solutions
Previous: Configuration Guide | Next: Examples →