Skip to main content

Install Relay Server on Docker

Deploy a Camouflage relay server using Docker for quick and simple deployment.

Prerequisites

  • Docker Engine 20.10 or later
  • 2 CPU cores minimum
  • 4 GB RAM minimum
  • Domain name pointing to your server
  • SSL certificates for your domain
  • Ports 443/tcp and 61700/udp available

Installation Steps

1. Pull the Relay Image

docker pull camouflagenetworks/camouflage-relay:latest

2. Create Configuration Directory

mkdir -p /opt/camouflage/relay/config
mkdir -p /opt/camouflage/relay/ssl

3. Prepare SSL Certificates

Place your SSL certificates:

cp your-cert.pem /opt/camouflage/relay/ssl/cert.pem
cp your-key.pem /opt/camouflage/relay/ssl/key.pem

4. Create Configuration File

Create /opt/camouflage/relay/config/relay.yaml:

server:
listen_addr: "0.0.0.0:61700"
public_addr: "relay.yourdomain.com:61700"
max_connections: 10000
connection_timeout: 300s

tls:
cert_file: "/etc/camouflage/ssl/cert.pem"
key_file: "/etc/camouflage/ssl/key.pem"
min_version: "1.3"

quic:
max_idle_timeout: 30s
max_stream_timeout: 60s
keep_alive_interval: 10s

logging:
level: "info"
format: "json"
output: "/var/log/camouflage/relay.log"

metrics:
enabled: true
port: 9090
path: "/metrics"

5. Run the Relay Server

docker run -d \
--name camouflage-relay \
--restart unless-stopped \
-p 443:443 \
-p 61700:61700/udp \
-p 9090:9090 \
-v /opt/camouflage/relay/config:/etc/camouflage/config \
-v /opt/camouflage/relay/ssl:/etc/camouflage/ssl \
camouflagenetworks/camouflage-relay:latest

6. Verify Installation

Check the relay server is running:

docker logs camouflage-relay

You should see output indicating the server started successfully.

7. Health Check

Verify the relay is healthy:

curl -k https://your-server-ip/health

Expected response:

{
"status": "healthy",
"version": "0.2.0",
"uptime": 3600,
"active_connections": 0
}

Configuration Options

Environment Variables

VariableDescriptionDefault
RELAY_LOG_LEVELLogging level (debug, info, warn, error)info
RELAY_PUBLIC_ADDRPublic address for clients to connectRequired
RELAY_METRICS_PORTPrometheus metrics port9090
RELAY_MAX_CONNECTIONSMaximum concurrent connections10000

Volume Mounts

Container PathPurpose
/etc/camouflage/configConfiguration files
/etc/camouflage/sslSSL certificates
/var/log/camouflageLog files

Monitoring

Access Prometheus metrics at: http://your-server-ip:9090/metrics

Key metrics:

  • camouflage_relay_connections_total - Total active connections
  • camouflage_relay_bytes_sent_total - Total bytes transmitted
  • camouflage_relay_bytes_received_total - Total bytes received
  • camouflage_relay_errors_total - Total errors encountered

Troubleshooting

Container Won't Start

Check logs:

docker logs camouflage-relay

Common issues:

  • Missing SSL certificates
  • Port conflicts
  • Invalid configuration
  • Incorrect file permissions

Connection Issues

Verify ports are accessible:

netstat -tulpn | grep -E '443|61700'

Ensure firewall allows traffic:

# UFW
sudo ufw allow 443/tcp
sudo ufw allow 61700/udp

# iptables
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 61700 -j ACCEPT

SSL Certificate Issues

Verify certificates are valid:

openssl x509 -in /opt/camouflage/relay/ssl/cert.pem -text -noout

Check certificate expiration:

openssl x509 -in /opt/camouflage/relay/ssl/cert.pem -noout -dates

Container Management

Stop the container

docker stop camouflage-relay

Start the container

docker start camouflage-relay

Restart the container

docker restart camouflage-relay

View logs

# Follow logs
docker logs -f camouflage-relay

# Last 100 lines
docker logs --tail=100 camouflage-relay

Upgrading

To upgrade to a newer version:

  1. Stop and remove the current container:
docker stop camouflage-relay
docker rm camouflage-relay
  1. Pull the new image:
docker pull camouflagenetworks/camouflage-relay:latest
  1. Run the new container with the same volumes:
docker run -d \
--name camouflage-relay \
--restart unless-stopped \
-p 443:443 \
-p 61700:61700/udp \
-p 9090:9090 \
-v /opt/camouflage/relay/config:/etc/camouflage/config \
-v /opt/camouflage/relay/ssl:/etc/camouflage/ssl \
camouflagenetworks/camouflage-relay:latest

Your configuration will be preserved in the mounted volumes.

Next Steps

See Also