Getting Started
Get up and running with Trusted Server quickly.
Prerequisites
Before you begin, ensure you have the following installed (versions are pinned in .tool-versions):
- Rust 1.95.0 (see
.tool-versions) - NodeJS 24.12.0
- Basic familiarity with Rust and WebAssembly
For Fastly deployment (optional for local dev):
- Fastly 15.1.0 CLI installed
- A Fastly account and API key
Installation
Clone the Repository
git clone https://github.com/IABTechLab/trusted-server.git
cd trusted-serverLocal Development
Trusted Server supports two local development modes:
Option A — Fastly Compute via Viceroy
Simulates the full Fastly production environment locally.
Install and configure the Fastly CLI using the Fastly setup guide, then install Viceroy:
cargo install viceroy --version 0.17.0 --locked --forceStart the local Fastly simulator:
fastly compute serveThe server will be available at http://localhost:7676.
Option B — Axum dev server
No Fastly account, CLI, or Viceroy needed. Runs natively on your machine.
The Axum adapter reads configuration from environment variables — it does not auto-load .env files. You must export the variables into your shell before starting the server.
# Copy and edit the environment file
cp .env.dev .env
# Export the variables into your current shell session
set -a && source .env && set +a
# Build and start the dev server
cargo run -p trusted-server-adapter-axumThe server will be available at http://localhost:8787. Set PORT=<port> before cargo run to bind the dev server to a different local port.
Environment variable conventions used by the Axum adapter:
| Purpose | Pattern | Example |
|---|---|---|
| Config store value | TRUSTED_SERVER_CONFIG_{STORE}_{KEY} | TRUSTED_SERVER_CONFIG_SETTINGS_AD_SERVER_URL=https://… |
| Secret store value | TRUSTED_SERVER_SECRET_{STORE}_{KEY} | TRUSTED_SERVER_SECRET_KEYS_SIGNING_KEY=abc123 |
Store names and key names are uppercased with hyphens and dots replaced by underscores.
Dev server limitations: The Axum adapter does not support KV store, geo lookup, config/secret-store writes, or admin key-management routes. See Architecture for the full list.
Build the Project
# Axum dev server (native)
cargo build -p trusted-server-adapter-axum
# Fastly adapter (WASM)
cargo build -p trusted-server-adapter-fastly --target wasm32-wasip1Run Tests
# Fastly/WASM crates (requires Viceroy)
cargo test-fastly
# Axum native adapter
cargo test-axumConfiguration
Edit trusted-server.toml to configure:
- Ad server integrations
- KV store mappings
- EC configuration
- GDPR settings
See Configuration for details.
Deploy to Fastly
fastly compute publishNext Steps
- Learn about Edge Cookies
- Follow the EC Setup Guide
- Understand GDPR Compliance
- Configure Ad Serving