⚙️ Configuration Guide
Crate Community Edition (CE) is designed for simplicity and focuses on local, YAML-based configuration. This guide covers all aspects of configuring your Crate CE instance.
YAML Configuration
Each file in the configuration directory corresponds to an Organization. Files must be named after a valid UUID representing the Organization ID:
bc7e5f3a-8b1e-4b1a-9c1a-1a2b3c4d5e6f.yaml
Organization Schema
The YAML file follows the OrganizationConfig schema:
# Display name for the organization
name: "My Local Organization"
# List of domains managed by this organization
domains:
- host: "api.local.crate.cc"
details:
# Routing policy
routing:
type: "round-robin" # Options: "round-robin", "failover"
destinations:
- "http://backend-1:8080"
- "http://backend-2:8081"
# Security settings
security:
# Optional: Isolate admin routes on a dedicated subdomain
admin_subdomain: "admin"
# Optional: List of IP addresses/CIDR blocks allowed for admin routes
ip_allowlist: ["127.0.0.1", "192.168.1.0/24"]
Routing Strategies
round-robin: Distributes incoming requests equally among all health-checked destinations.failover: Sends all traffic to the first available destination; switches to the next only if the current one fails.
Environment Variables
Crate CE can be customized using the following environment variables:
| Variable | Description | Default |
|---|---|---|
CONFIG_STORAGE_DIR |
The directory where Crate CE looks for YAML configuration files. | /etc/crate/config |
TRAFFIC_LOG_FILE |
Set to true to enable local traffic logging to a file. |
false |
TRAFFIC_LOG_PATH |
The path to the traffic log file (output is JSONL). | ./traffic.jsonl |
LOG_FILE |
Set to true to enable system logs to a file. |
false |
LOG_PATH |
The path to the system log file. | ./gateway.log |
PORT |
The port for the Gateway to listen on. | 9980 |
Configuration Directory Structure
A typical Crate CE configuration directory would look like this:
/etc/crate/config/
├── bc7e5f3a-8b1e-4b1a-9c1a-1a2b3c4d5e6f.yaml
├── 123e4567-e89b-12d3-a456-426614174000.yaml
└── f47ac10b-58cc-4372-a567-0e02b2c3d479.yaml
Crate CE will automatically load and watch these files for changes. Adding, removing, or modifying these files will take effect immediately without a restart.
Next Steps
- Understand the Architecture Overview.
- Learn about Docker Deployment.
- Back to Getting Started.