Getting Started with the CLI
The Rulebricks CLI is a deployment and management tool that fully automates the creation of production-ready Rulebricks rule engine clusters. It handles:
- Infrastructure provisioning - Creates Kubernetes clusters, networks, and security groups
- Application deployment - Deploys all Rulebricks services with proper configuration
- Database setup - Configures PostgreSQL (self-hosted or managed)
- Monitoring & logging - Sets up Prometheus, Grafana, and Vector
- Security - Configures TLS certificates, secrets management, and network policies
- Auto-scaling - Configures KEDA for dynamic worker scaling based on load
Our CLI offers a particularly high level of DevOps automation, and allows you to spin up dedicated, automatically scaling Rulebricks clusters in as few as two CLI commands. However, we strongly recommend still paging through as many of these docs as you can, as it's important you understand what these commands are running under the hood.
Prerequisites
Before you begin, ensure you have the following tools installed:
Required for All Deployments
- kubectl - Kubernetes command-line tool
- macOS:
brew install kubectl - Linux: See official docs (opens in a new tab)
- macOS:
Cloud Provider Requirements
AWS
- AWS CLI:
brew install awscli(macOS) or see AWS docs (opens in a new tab) - eksctl:
brew tap weaveworks/tap && brew install weaveworks/tap/eksctl(macOS) or see eksctl docs (opens in a new tab)
Google Cloud Platform
- Google Cloud SDK:
brew install --cask google-cloud-sdk(macOS) or see GCP docs (opens in a new tab)
Azure
- Azure CLI:
brew install azure-cli(macOS) or see Azure docs (opens in a new tab)
Cloud Provider Authentication
You'll need to authenticate with your chosen cloud provider:
- AWS: Configure credentials using
aws configureor environment variables - GCP: Run
gcloud auth loginandgcloud auth application-default login - Azure: Run
az login
The CLI will check for required dependencies and provide installation instructions if any are missing.
Installation
Quick Install (Recommended)
macOS and Linux:
curl -sSfL https://raw.githubusercontent.com/rulebricks/cli/main/install.sh | shWindows: Download the latest Windows binary from the releases page (opens in a new tab) and add it to your PATH.
Install from Source
Requires Go 1.21+:
git clone https://github.com/rulebricks/cli.git
cd cli
make installVerify Installation
rulebricks versionYou should see output showing the CLI version, git commit, and build information.
License Key
The Rulebricks CLI requires a valid license key. You can provide it in several ways:
-
Environment variable (recommended):
export RULEBRICKS_LICENSE_KEY="your-license-key" -
In configuration file (see Initial Setup):
project: license: env:RULEBRICKS_LICENSE_KEY -
Directly in config (less secure):
project: license: 'your-license-key'
Contact support@rulebricks.com for licensing information.
Your First Deployment
Step 1: Initialize Your Project
Run the interactive wizard to create your configuration:
rulebricks initThis will guide you through:
- Project naming and domain configuration
- Cloud provider selection
- Database deployment options
- Email provider setup
- Security and monitoring preferences
The wizard creates a rulebricks.yaml file in your current directory.
Step 2: Review Your Configuration
Before deploying, review the generated rulebricks.yaml file. You can edit it directly or re-run rulebricks init to make changes.
Key things to verify:
- Domain: Ensure your domain DNS is configured (or will be configured) to point to your cloud provider
- Cloud credentials: Make sure you're authenticated with your chosen provider
- License key: Verify your license key is set correctly
Step 3: Deploy
Deploy your Rulebricks cluster:
rulebricks deployThis single command will:
- Provision cloud infrastructure using Terraform
- Create a managed Kubernetes cluster
- Deploy and configure all required services
- Set up DNS and SSL certificates
- Initialize the database with migrations
The deployment process typically takes 15-30 minutes depending on your cloud provider and configuration.
Step 4: Verify Deployment
Check the status of your deployment:
rulebricks statusThis shows:
- Infrastructure health and cluster endpoint
- Kubernetes node status
- Pod distribution and health
- Database availability
- Application deployment status
- Service endpoints and versions
- Certificate validity
Step 5: Access Your Deployment
Once deployment is complete, you can access:
- Main Application:
https://your-domain.com - Grafana Dashboard (if enabled):
https://grafana.your-domain.com - Supabase Studio (if self-hosted):
https://supabase.your-domain.com
Next Steps
- Configure Monitoring: See Monitoring & Logging
- Set Up Logging: See Vector Logging Setup
- Customize Configuration: See Configuration Reference
- Upgrade Your Deployment: See Upgrades & Maintenance
Common Issues
Cloud Authentication Errors
If you see authentication errors:
- AWS: Run
aws configureor check your~/.aws/credentialsfile - GCP: Run
gcloud auth loginandgcloud auth application-default login - Azure: Run
az login
DNS Not Configured
If certificate generation fails, ensure your domain DNS points to the load balancer. You can find the load balancer address in the deployment output or by running rulebricks status.
Resource Quotas
If deployment fails due to resource limits:
- AWS: Check your service quotas in the AWS Console
- GCP: Ensure billing is enabled and quotas are sufficient
- Azure: Check your subscription quotas
For more troubleshooting help, see Status & Troubleshooting.