Skip to main content
This guide walks you through installing and configuring the Portal Connect Agent.

Overview

Installing Portal Connect involves:
  1. Generating a client mTLS certificate for authentication
  2. Creating a configuration file with your routes
  3. Deploying the Agent container
  4. Verifying the connection and registration
Time to complete: 15-30 minutes

Before You Begin

Ensure you have completed the prerequisites:
  • Docker installed and running
  • Internal service URLs identified
  • Network access verified

Step 1: Generate mTLS Certificates

Portal Connect uses mTLS for secure authentication. Generate your client certificate using the Agent’s built-in tool.

Pull the Agent Image

First, obtain the Portal Connect Agent Docker image:

Generate Certificates

Run the certificate generation command:
This creates two files in the ./certs directory:
  • portal-connect-client-<timestamp>.crt - Client certificate (public)
  • portal-connect-client-<timestamp>.key - Private key (private)

Secure Your Private Key

Set appropriate permissions on the private key:
ImportantNever share or commit the portal-connect-client-<timestamp>.key file. Treat it as a secret.

Register Your Certificate with Spotify

Visit the Support Center and submit a new ticket asking to register your Portal Connect certificate. Under Attachments, upload your portal-connect-client-<timestamp>.crt file (public certificate only). Spotify will use this file to register your certificate. Note that the private key should never leave your infrastructure.
Certificate ExpiryCertificates are valid for only 180 days. Repeat step 1 before the certificate expires, delivering the new certificate to Spotify first, before deploying the new key and certificate to your agents.

Step 2: Create Configuration File

Create a YAML configuration file named app-config.yaml:

Basic Configuration

Configuration with Headers

If your external services require authentication, add headers per route:
Using Environment Variables
  • Reference environment variables with ${VAR_NAME}
  • For file-based secrets, use ${VAR_NAME_FILE} to read from a file path

Configuration File Location

Save the app-config.yaml file in a secure location accessible to Docker:

Step 3: Deploy the Agent

You can deploy the Agent using Docker run, Docker Compose, or orchestration platforms like Kubernetes.

Option A: Docker Run

Deploy using a simple docker run command:
Parameters explained:
  • --name - Container name for easy reference
  • -v - Mount configuration file and certificates (read-only)
  • -e CONFIG_PATH - Path to configuration file inside container
  • -e GITHUB_TOKEN - Environment variable for token substitution
  • -p 9466:9466 - Expose metrics port (optional)
  • --restart unless-stopped - Automatic restart policy

Option B: Docker Compose

Create a docker-compose.yml file:
Create a .env file for environment variables:
Deploy with Docker Compose:

Option C: Kubernetes

Create a Kubernetes deployment:
Create the ConfigMap and Secrets:

Step 4: Verify the Deployment

Check Agent Logs

View the Agent logs to confirm successful startup:
Expected log messages:

Check Metrics

Query the metrics endpoint to verify the Agent is healthy:
Look for metrics indicating:
  • WebSocket connection state: agent_websocket_connected{} 1
  • Registered routes count
  • No connection errors

Troubleshooting Installation

Certificate Validation Fails

Error message: mTLS certificate validation failed Solutions:
  • Verify certificate files exist at the specified paths
  • Check file permissions (should be readable by container user)
  • Ensure certificates are valid and not expired
  • Verify certificates are in PEM format

Cannot Connect to Broker

Error message: Failed to connect to broker or WebSocket connection failed Solutions:
  • Verify broker URL is correct in configuration
  • Check network connectivity to the broker URL
  • Ensure firewall allows outbound WSS connections (the Agent only needs outbound access)
  • Verify client certificate is registered with Spotify
  • Check that your Portal instance is operational (contact Spotify support)
Outbound Connection OnlyThis is an outbound connection from the Agent. You should NOT need to configure any inbound firewall rules.

Configuration File Not Found

Error message: Configuration file not found or ENOENT Solutions:
  • Verify volume mount path is correct
  • Check CONFIG_PATH environment variable matches mounted path
  • Ensure configuration file has correct filename
  • Check file permissions allow read access

Container Exits Immediately

Solutions:
  • Check logs: docker logs portal-connect-agent
  • Verify configuration file syntax:
  • Check all required environment variables are set
  • Ensure certificates are mounted correctly