Cratopus icon

🚀 Getting Started with Crate CE

This guide will walk you through downloading and running Crate Community Edition (CE) for the first time.

Prerequisites

  • Linux, macOS, or Windows (amd64 or arm64)
  • Docker: Optional, but recommended for quick deployment.
  • Curl: For testing your setup.

No runtime dependencies required — Crate CE ships as a single, self-contained binary.


Installation Options

1. Download the Prebuilt Binary

Download the latest release for your platform from the Crate CE Releases page.

# Example: Linux amd64
curl -L -o crate-ce https://gitlab.com/cratecc/ce/-/releases/latest/downloads/crate-ce-linux-amd64

# Make it executable
chmod +x crate-ce

Available binaries:

Platform Binary Name
Linux (amd64) crate-ce-linux-amd64
Linux (arm64) crate-ce-linux-arm64
macOS (amd64) crate-ce-darwin-amd64
macOS (arm64) crate-ce-darwin-arm64

The easiest way to run Crate CE is via Docker. We provide a lightweight image that contains everything you need.

# Pull the latest image
docker pull registry.gitlab.com/cratecc/ce:latest

# Run the container
docker run -d \
  -p 80:80 \
  -e SERVICE=gateway \
  -e ENVIRONMENT=production \
  -e CODE_VERSION=1.0.0 \
  -v $(pwd)/crate-config:/etc/crate/config \
  --name crate-ce \
  registry.gitlab.com/cratecc/ce:latest gateway start

Running Crate CE

Start the gateway by running the binary directly:

./crate-ce

Crate CE will start listening on port 80 by default.

Command Line Options

Flag / Env Var Default Description
HTTP_PORT 80 Port the gateway listens on.
SERVICE gateway REQUIRED: Must be set to gateway.
ENVIRONMENT development Operational environment for logging/certs.
CONFIG_STORAGE_DIR /etc/crate/config Directory for YAML configuration files.
MIRROR_PORT 9090 Port for the built-in mirror server.

Example with custom config directory:

CONFIG_STORAGE_DIR=./my-config ./crate-ce

Configuration

Crate CE loads YAML configuration files from the config directory at startup.

  1. Create a config directory:
    mkdir -p crate-config
    
  2. Add a sample configuration — create a file using the config_[UUID].yaml naming convention (e.g., config_bc7e5f3a-8b1e-4b1a-9c1a-1a2b3c4d5e6f.yaml):
    version: "1.0"
    name: "My Local Organization"
    domains:
      - host: "api.local.crate.cc"
        active: true
        details:
          routing:
            type: "round-robin"
            destinations:
              - "http://localhost:9090"
    

Testing Your Setup

Use the built-in Mirror Service to verify that Crate CE is routing correctly.

  1. Start Crate CE — the mirror service runs automatically alongside the gateway.
  2. Send a test request:
    curl -H "Host: api.local.crate.cc" http://localhost
    
  3. Expected result: You should receive a JSON response echoing back your request headers and path, confirming the gateway is routing traffic.

Next Steps