Skip to main content

Overview

System commands provide tools for maintaining the gateway infrastructure, including backup and recovery, health monitoring, and system operations.

Health Monitoring

System Health Check

Perform a comprehensive health check of the gateway system.
Health check includes:
  • Configuration structure validation
  • Orphaned data detection (users not in projects, configs not assigned)
  • Duplicate email detection
  • Duplicate name warnings
  • Reference integrity checks (API keys → users → projects → configs)
  • Statistics summary
Run health checks regularly as part of your maintenance routine.

Backup and Recovery

Create System Backup

Create a complete backup of the entire system configuration.
string
required
Path to output backup file
Backup file structure:
Backups include all configuration but do NOT include the admin_apikey for security.

Restore from Backup

Restore system configuration from a backup file.
string
required
Path to backup file
This operation replaces the entire current configuration. Create a backup of the current state first.
Restore process:
  1. Validates backup file structure
  2. Creates automatic backup of current state
  3. Replaces configuration with backup data
  4. Verifies restored configuration

Automatic Backups

The system automatically creates backups before major operations:
  • Filename pattern: enkrypt_mcp_config.json.bkp.YYYYMMDD_HHMMSS
  • Location: Same directory as main config file
  • Triggered by:
    • System restore operations
    • Bulk modifications
    • Import operations
Automatic backups provide a safety net. Review them periodically and archive important versions.

Reset System

Reset the entire system to default configuration.
flag
required
Required flag to confirm destructive operation
DESTRUCTIVE OPERATIONThis command:
  • Deletes ALL configurations
  • Removes ALL projects
  • Deletes ALL users
  • Invalidates ALL API keys
  • Creates fresh default configuration
Use with extreme caution. Always backup first.

API Server Management

Start API Server

Launch the REST API server for programmatic access.
Default configuration:
  • Host: 0.0.0.0
  • Port: 8001
  • Docs: http://localhost:8001/docs
  • OpenAPI: http://localhost:8001/openapi.json
See API Reference for available endpoints and authentication.
Server features:
  • Authentication with Bearer tokens
  • Automatic OpenAPI documentation
  • CORS support
  • Request validation
  • Rate limiting

Configuration Management

Generate Default Config

Generate a new default configuration file.
Generates configuration at:
  • macOS/Linux: ~/.enkrypt/enkrypt_mcp_config.json
  • Windows: %USERPROFILE%\.enkrypt\enkrypt_mcp_config.json
  • Docker: /app/.enkrypt/docker/enkrypt_mcp_config.json
Generated defaults include:
  • Unique gateway API key
  • Secure admin API key (256 characters)
  • Default project and user
  • Sample echo server configuration
  • Plugin configurations (auth, guardrails, telemetry)

Version Information

Display CLI and gateway version information.

Best Practices

Daily backups:
Before major changes:
  • Always create a backup before:
    • Bulk user/project operations
    • Configuration imports
    • System updates
    • Production deployments
Storage:
  • Store backups in version control (without API keys)
  • Use encrypted storage for full backups
  • Maintain off-site backup copies
  • Test restore procedures regularly
Regular checks:
Monitoring schedule:
  • Daily: Automated health checks
  • Weekly: Manual review of reports
  • Monthly: Deep system audit
  • Quarterly: Backup restore testing
Alert conditions:
  • Orphaned data detected
  • Reference integrity failures
  • Duplicate entries found
  • Configuration structure errors
Schedule regular maintenance:
  • System health checks
  • Backup verification
  • Log rotation
  • Configuration optimization
  • Security updates
Communicate with users:
  • Announce maintenance windows
  • Provide status updates
  • Document changes made
  • Test after maintenance

Common Workflows

Daily Backup Script

Weekly Health Check

Disaster Recovery

System Migration

Troubleshooting

Error: “Invalid JSON in backup file”Solution:
Issue: Health check reports errorsActions:
  1. Review error details
  2. Fix reported issues
  3. Re-run health check
Common issues:
  • Orphaned users: Remove from system or add to projects
  • Invalid references: Fix API keys pointing to non-existent projects
  • Duplicate names: Rename conflicting entries
Error: “Port already in use”Solution:
Error: “Validation failed after restore”Solution:

Monitoring Integration

Prometheus Metrics

Export health metrics for Prometheus monitoring.

Log Monitoring

Configure log aggregation for system events.
logging.json:

Security Considerations

Backup Security
  • Encrypt backups at rest
  • Secure transmission channels
  • Restrict backup file access
  • Exclude admin API key from exports
  • Regular security audits of backup storage
Admin API KeyThe 256-character admin_apikey is used for administrative REST API operations. It is:
  • Automatically generated during generate-config
  • NOT included in system backups for security
  • Stored only in the main config file
  • Required for admin-level API access