Skip to main content

Getting Started

This guide starts PRISM and verifies that licensed rendering works.

Prerequisites​

  • Docker (recommended) or a Linux server for a packaged binary install
  • Google Chrome or Chromium for a binary install, installed and available in $PATH (the Docker image bundles Chromium automatically)
  • A licence file. PRISM is commercial software and this is not optional for the part you came to see: without a licence it starts, proxies every request and renders nothing, so the crawler test below returns your origin's JavaScript shell and looks like a working install. Email sales@trident-cache.com for a trial; see Licensing.

Quick Start with Docker​

# Obtain license.lic from sales first. Generate a persistent admin token.
export PRISM_ADMIN_TOKEN="$(openssl rand -hex 32)"
# This shell variable is substituted into TOML; it is not PRISM env configuration.
cat > config.toml <<TOML
[server]
address = "0.0.0.0:4000"
origin = "http://host.docker.internal:3000"

[admin]
address = "0.0.0.0:4001"
bearer_token = "$PRISM_ADMIN_TOKEN"

[license]
path = "/etc/prism/license.lic"
TOML

docker run -d --name prism \
--add-host=host.docker.internal:host-gateway \
-p 127.0.0.1:4000:4000 -p 127.0.0.1:4001:4001 \
-e RUST_LOG=info \
-v "$PWD/config.toml:/etc/prism/config.toml:ro" \
-v "$PWD/license.lic:/etc/prism/license.lic:ro" \
docker.trident-cache.com/prism:latest

Port 4000 serves proxied traffic. Port 4001 exposes the admin API. Both listeners bind to all interfaces inside the container, while Docker publishes them only on the host loopback address (127.0.0.1). Put a reverse proxy in front of port 4000 for public traffic; keep the admin port private.

The --add-host mapping supports Linux Docker Engine (20.10+). Your origin must listen on an address reachable from Docker's host gateway; a host service bound only to 127.0.0.1 is not reachable through that gateway. Restrict origin access with your firewall. Docker Desktop provides host.docker.internal itself.

Keep the generated token for the authenticated commands below. The token is stored in config.toml; protect that file. All admin endpoints except GET /health, GET /ready, and GET /startup require the bearer token.

Leave the licence out and everything below still appears to work — the container starts, /health answers, traffic flows — except the rendering, which is the whole product. GET /status on the admin port reports licensed, and that is the field to check first when the crawler test returns a bare shell.

By default PRISM expects your SPA origin at http://localhost:3000. Override it in the TOML config file (see Configuration).

Quick Start from Binary​

Install from the signed package repositories (recommended — this also installs the systemd unit and a default config):

# Debian / Ubuntu
curl -fsSL https://pkg.trident-cache.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/trident.gpg
echo 'deb [signed-by=/usr/share/keyrings/trident.gpg] https://pkg.trident-cache.com/prism/apt stable main' | sudo tee /etc/apt/sources.list.d/trident-prism.list
sudo apt update && sudo apt install prism

RPM and Alpine repositories live at the same host — see the README for the dnf and apk variants. Before starting, install your license and set [license].path, [server].origin, and [admin].bearer_token in /etc/prism/config.toml. For the commands below, set PRISM_ADMIN_TOKEN in your shell to that same token. Then start the service:

sudo systemctl enable --now prism

Minimal Configuration​

The server portion of config.toml looks like this (retain the license and admin sections above; this fragment alone does not enable rendering):

[server]
address = "127.0.0.1:4000"
origin = "http://my-app:3000"
mode = "bot-only" # or "render-all"
  • address -- the host and port PRISM listens on.
  • origin -- the upstream SPA that PRISM will fetch pages from and render.
  • mode -- bot-only renders only for detected bots (default). render-all renders every request through headless Chrome.

Test It​

Send a request with a regular browser User-Agent:

curl -sS -o /dev/null -w "%{http_code}\n" http://localhost:4000/
# 200 -- proxied directly from origin, no rendering

Now send a request as Googlebot:

curl -fsS -D bot-headers.txt -o bot.html \
-H "User-Agent: Googlebot" http://127.0.0.1:4000/
cat bot-headers.txt
# Inspect bot.html for content your app normally creates with JavaScript.

If the response is still a JavaScript shell, check the license first:

curl -fsS -H "Authorization: Bearer $PRISM_ADMIN_TOKEN" \
http://127.0.0.1:4001/status
# Confirm "licensed": true in the JSON response.

A healthy proxy does not prove rendering works. If licensed is true, also check route exclusions, origin connectivity, render readiness, and logs. Repeat the bot request to inspect cache behavior and confirm application content in the HTML.

The X-Prism-Cache response header tells you whether the result was a cache HIT, MISS, STALE, or BYPASS.

Verify with the Admin API​

Check that PRISM is healthy:

curl -fsS http://127.0.0.1:4001/health
# {"status":"ok"}

View Prometheus metrics:

curl -fsS -H "Authorization: Bearer $PRISM_ADMIN_TOKEN" \
http://127.0.0.1:4001/metrics

Next Steps​

  • Configuration -- full reference for config.toml options
  • Rendering -- tune Chrome pool size, timeouts, and wait strategies
  • Deployment -- production deployment patterns with Docker, systemd, and Kubernetes