Overview
Installing Portal Connect involves:- Generating a client mTLS certificate for authentication
- Creating a configuration file with your routes
- Deploying the Agent container
- Verifying the connection and registration
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:./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 yourportal-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.
Step 2: Create Configuration File
Create a YAML configuration file namedapp-config.yaml:
Basic Configuration
Configuration with Headers
If your external services require authentication, add headers per route:Configuration File Location
Save theapp-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:--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 adocker-compose.yml file:
.env file for environment variables:
Option C: Kubernetes
Create a Kubernetes deployment:Step 4: Verify the Deployment
Check Agent Logs
View the Agent logs to confirm successful startup:Check Metrics
Query the metrics endpoint to verify the Agent is healthy:- 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_PATHenvironment 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