Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.pangolin.net/llms.txt

Use this file to discover all available pages before exploring further.

Try free on Pangolin Cloud

Fastest way to get started with Pangolin using the hosted control plane. No credit card required.
Blueprints let you define Pangolin resources as code. Instead of configuring every site, target, and access rule manually in the dashboard, you describe the desired state in YAML or container labels and let Pangolin apply it consistently. Use blueprints when you want:
  • Repeatable rollouts across many sites
  • Version control for infrastructure and access settings
  • A source of truth that can be reviewed, templated, and automated
Some features in this documentation are marked with (EE), which means they require Enterprise Edition.

Blueprint Mental Model

A blueprint can contain up to three top-level sections:
  • public-resources: Internet-facing HTTP, TCP, or UDP resources
  • private-resources: Client-only access to hosts or CIDR ranges
  • sites: Site-level settings such as container label discovery
public-resources:
  <resource_key>:
    ...

private-resources:
  <resource_key>:
    ...

sites:
  <site_key>:
    ...
Think of the resource key as your stable ID inside the blueprint. The fields under that key describe what Pangolin should create or maintain.

Choose A Format

Pangolin supports two blueprint formats:

YAML

Use YAML when you want a readable file that can be committed to git, applied through Newt, pasted into the UI, or sent through the API.

Container Labels

Use container labels when the resource definition should live inside your Compose stack. This is especially useful when a container and its Pangolin resource should be managed together.

How YAML Blueprints Are Applied

UI

Paste YAML into Settings > Blueprints in the Pangolin dashboard.

Newt

Run Newt with --blueprint-file to keep the file declarative and continuously applied:
newt --blueprint-file /path/to/blueprint.yaml <other-args>
If you only want a one-time bootstrap during provisioning, use --provisioning-blueprint-file instead.

API

Apply a blueprint through the Pangolin API with an API key. See the API documentation.PUT /org/{orgId}/blueprint
{
  "blueprint": "base64-encoded-json-content"
}
Python example

CLI

Apply a blueprint directly from the Pangolin CLI when you want a one-off apply from a terminal, CI job, or local automation.Using your logged-in user accountFirst log in and select the organization you want the blueprint applied to:
pangolin login
pangolin select org --org <org_id>
Then apply the file:
pangolin apply blueprint --file /path/to/blueprint.yaml
The CLI uses your active account and selected organization. You can optionally set the saved blueprint name:
pangolin apply blueprint --file /path/to/blueprint.yaml --name production
Using an Integration API keyFor non-interactive automation, pass an Integration API key, API endpoint, and organization ID together:
pangolin apply blueprint \
  --file /path/to/blueprint.yaml \
  --api-key <api_key_id.api_key_secret> \
  --endpoint https://api.example.com \
  --org <org_id>
For Pangolin Cloud, use https://api.pangolin.net as the endpoint. For self-hosted Pangolin, use your API host, for example https://api.your-domain.com. See Integration API for creating API keys and enabling the API on self-hosted deployments.You can also pipe a blueprint through stdin. When using stdin, provide --name because there is no filename to derive it from:
render-blueprint | pangolin apply blueprint --file - --name production
--blueprint-file in Newt and container labels behave as an ongoing source of truth. Dashboard edits can be overwritten the next time the blueprint is applied. UI, API, and CLI applies are typically one-off operations.

Quick Start YAML Example

This example shows all three top-level sections in one file:
public-resources:
  web-app:
    name: Web App
    protocol: http
    full-domain: app.example.com
    auth:
      sso-enabled: true
      whitelist-users:
        - admin@example.com
    targets:
      - site: my-site
        hostname: app
        port: 8080
        method: http
        healthcheck:
          hostname: app
          port: 8080
          path: /health

private-resources:
  ssh-host:
    name: SSH Host
    mode: host
    sites:
      - my-site
    destination: 192.168.1.10
    tcp-ports: "22"
    roles:
      - DevOps

sites:
  my-site:
    name: My Site
    docker-socket-enabled: true

Public Resources

Public resources expose services through Pangolin.
  • Use http for websites, APIs, and dashboards
  • Use tcp or udp for raw public services bound to a port on the Pangolin server

HTTP Resource Example

public-resources:
  app:
    name: App
    protocol: http
    full-domain: app.example.com
    host-header: app.internal
    tls-server-name: app.internal
    headers:
      - name: X-Env
        value: production
    rules:
      - action: allow
        match: country
        value: US
      - action: deny
        match: path
        value: /admin
    auth:
      sso-enabled: true
      whitelist-users:
        - admin@example.com
    targets:
      - site: my-site
        hostname: app
        port: 8080
        method: http
When applying a blueprint via Newt (using --blueprint-file or container labels), site on each target is optional. If omitted, the target is assigned to the site of the Newt that applied the blueprint.

Raw TCP Or UDP Example

public-resources:
  mqtt:
    name: Mosquitto MQTT
    protocol: tcp
    proxy-port: 1883
    targets:
      - site: my-site
        hostname: mqtt-server
        port: 1883
For raw resources:
  • proxy-port is required
  • Target method must not be set
  • auth is not supported

Targets-Only Resources

A public resource can contain only targets. This is useful when you want to add or manage targets for an existing resource definition without repeating all resource-level fields.
public-resources:
  extra-targets:
    targets:
      - site: secondary-site
        hostname: app-2
        port: 8080
        method: http
      - site: tertiary-site
        hostname: app-3
        port: 8080
        method: http
When a resource is targets-only, name and protocol are not required.

Authentication Example

Authentication is configured inside auth and is supported only for HTTP resources.
public-resources:
  secure-app:
    name: Secure App
    protocol: http
    full-domain: secure.example.com
    auth:
      pincode: 123456
      password: strong-password
      basic-auth:
        user: demo
        password: change-me
      sso-enabled: true
      sso-roles:
        - Member
      sso-users:
        - user@example.com
      whitelist-users:
        - admin@example.com

Maintenance Page (EE)

The maintenance object lets you present a maintenance page for a public HTTP resource.
public-resources:
  app:
    name: App
    protocol: http
    full-domain: app.example.com
    maintenance:
      enabled: true
      type: automatic
      title: Scheduled Maintenance
      message: We are upgrading the service.
      estimated-time: 2 hours
    targets:
      - site: my-site
        hostname: app
        port: 8080
        method: http
Maintenance type values:
  • forced: Always show the maintenance page
  • automatic: Show it only when all targets are unhealthy or the sites are offline

Private Resources

Private resources define what Pangolin clients can reach after they connect to your organization.
  • Use mode: host for a single host or DNS name
  • Use mode: cidr for an entire network range
  • Use mode: http to expose an internal HTTP endpoint to clients via a private domain
When applying a blueprint via Newt (using --blueprint-file or container labels), sites is optional. If omitted, the resource is assigned to the site of the Newt that applied the blueprint.
private-resources:
  internal-net:
    name: Internal Network
    mode: cidr
    destination: 10.0.0.0/24
    sites:
      - my-site
    tcp-ports: "22,443,8000-9000"
    udp-ports: "53,123"
    disable-icmp: false
    alias: "*.internal.example.com"
    roles:
      - Developer
    users:
      - user@example.com
    machines:
      - machine-id-1

  internal-app:
    name: Internal App
    mode: http
    destination: 10.0.0.5
    destination-port: 8080
    sites:
      - my-site
    full-domain: app.internal.example.com
    ssl: true
    scheme: https
    roles:
      - Member

Container Labels Format

Container labels are the same blueprint schema flattened into dot-separated keys:
  • Start every label with pangolin.
  • Keep the same object path as YAML
  • Use array indexes for lists, such as [0]
Example YAML:
public-resources:
  my-app:
    headers:
      - name: X-Env
        value: prod
Equivalent Compose labels:
labels:
  - pangolin.public-resources.my-app.headers[0].name=X-Env
  - pangolin.public-resources.my-app.headers[0].value=prod
Container labels are continuously applied. Treat the Compose file as the source of truth because dashboard edits can be overwritten.

Enable Container Label Discovery

To use container labels, Newt must be able to read the Docker socket:
newt --docker-socket /var/run/docker.sock <other-args>
Or with an environment variable:
DOCKER_SOCKET=/var/run/docker.sock

Docker Compose Example

services:
  newt:
    image: fosrl/newt
    container_name: newt
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - PANGOLIN_ENDPOINT=https://app.pangolin.net
      - NEWT_ID=h1rbsgku89wf9z3
      - NEWT_SECRET=z7g54mbcwkglpx1aau9gb8mzcccoof2fdbs97keoakg2pp5z
      - DOCKER_SOCKET=/var/run/docker.sock

  nginx1:
    image: nginxdemos/hello
    container_name: nginx1
    labels:
      - pangolin.public-resources.nginx.name=nginx
      - pangolin.public-resources.nginx.full-domain=nginx.fosrl.io
      - pangolin.public-resources.nginx.protocol=http
      - pangolin.public-resources.nginx.headers[0].name=X-Example-Header
      - pangolin.public-resources.nginx.headers[0].value=example-value
      - pangolin.public-resources.nginx.targets[0].method=http
      - pangolin.public-resources.nginx.targets[0].path=/path
      - pangolin.public-resources.nginx.targets[0].path-match=prefix

  nginx2:
    image: nginxdemos/hello
    container_name: nginx2
    labels:
      - pangolin.public-resources.nginx.targets[1].method=http
      - pangolin.public-resources.nginx.targets[1].hostname=nginx2
      - pangolin.public-resources.nginx.targets[1].port=80

networks:
  default:
    name: pangolin_default
This creates a single Pangolin resource with multiple targets:
Example resource

Container Label Behavior

Automatic Discovery

If hostname or port are not set explicitly, Pangolin can detect them from the container configuration. The hostname typically defaults to the container name, and port detection is based on the container’s expose configuration.

Site Assignment

If no site is specified on a target (public resource) or on a private resource, it is assigned to the site of the Newt that applied the blueprint — whether through container labels or --blueprint-file.

Merged Configuration

Labels from multiple containers can be merged into one logical resource, which is useful when different containers contribute different targets.

Configuration Reference

Use this section when you need the full schema. The order below mirrors the blueprint structure rather than the dashboard UI.

Top-Level Object

public-resources:
  app:
    name: App
    protocol: http
    full-domain: app.example.com
    targets:
      - hostname: app
        port: 80
        method: http

private-resources:
  ssh-host:
    name: SSH Host
    mode: host
    sites:
      - my-site
    destination: 192.168.1.10
    tcp-ports: "22"

sites:
  my-site:
    name: My Site
    docker-socket-enabled: true

Public Resource Object (public-resources)

public-resources:
  web-app:
    name: Web App
    protocol: http
    full-domain: app.example.com
    enabled: true
    host-header: internal.example.local
    tls-server-name: internal.example.local
    headers:
      - name: X-Env
        value: prod
    rules:
      - action: allow
        match: country
        value: US
      - action: deny
        match: region
        value: 019
    auth:
      pincode: 123456
      sso-enabled: true
      whitelist-users:
        - admin@example.com
    maintenance:
      enabled: true
      type: automatic
    targets:
      - site: my-site
        hostname: app
        port: 8080
        method: http
        path: /
        path-match: prefix
        rewrite-path: /
        rewrite-match: prefix
        healthcheck:
          hostname: app
          port: 8080
          path: /health

Private Resource Object (private-resources)

private-resources:
  internal-net:
    name: Internal Network
    mode: cidr
    sites:
      - my-site
    destination: 10.0.0.0/24
    tcp-ports: "22,443"
    udp-ports: "53"
    disable-icmp: false
    alias: "*.internal.example.com"
    roles:
      - Member
    users:
      - user@example.com
    machines:
      - machine-id-1

  internal-app:
    name: Internal App
    mode: http
    sites:
      - my-site
    destination: 10.0.0.5
    destination-port: 8080
    full-domain: app.internal.example.com
    ssl: true
    scheme: https

Validation Rules And Constraints

Core Rules

  1. A public resource can be targets-only. In that case it may contain only targets, and name plus protocol are not required.
  2. When protocol is http, the resource must have full-domain and each target must include method.
  3. When protocol is tcp or udp, the resource must have proxy-port, targets must not include method, and auth is not allowed.
  4. full-domain values must be unique across public resources.
  5. proxy-port values must be unique per protocol within public-resources. TCP 3000 and UDP 3000 can coexist, but two TCP resources cannot both use 3000.
  6. alias values must be unique across private resources in the blueprint.

Common Validation Errors

”Admin role cannot be included in sso-roles”

Admin is reserved and cannot be used in auth.sso-roles.

”Duplicate ‘full-domain’ values found”

Every public HTTP resource must have its own unique full-domain.

”Duplicate ‘proxy-port’ values found in public-resources”

Two public resources with the same protocol cannot reuse the same proxy-port.

”When protocol is ‘http’, all targets must have a ‘method’ field”

Each HTTP target must specify http, https, or h2c.

”When protocol is ‘tcp’ or ‘udp’, targets must not have a ‘method’ field”

Raw targets do not use HTTP methods.

”When protocol is ‘tcp’ or ‘udp’, ‘auth’ must not be provided”

Authentication settings apply only to HTTP public resources.

”Resource must either be targets-only or have both ‘name’ and ‘protocol’ fields”

Provide both fields for a full public resource definition, or remove everything except targets.

”Duplicate ‘alias’ values found in private-resources”

Private resource aliases must be unique within the blueprint.

”Destination must be a valid IP address or valid domain AND alias is required”

In host mode, the destination must be a valid host or IP. If you use a domain, provide alias as well.

”Destination must be a valid CIDR notation for cidr mode”

In cidr mode, destination must be a valid CIDR block such as 10.0.0.0/24.

”Admin role cannot be included in roles”

Admin is reserved and cannot be used in private resource roles.