Remux Wiki

Caddy Setup Guide (Optional)

Set up a reverse proxy and expose Remux over the internet.

This guide describes how you can use a reverse proxy and custom domain to expose Remux to the internet (reachable by clients). Caddy automatically sets up an SSL certificate for you, so that traffic is protected.

Check out Caddy and Caddy as a reverse proxy (basic and more extensive examples) for more info.

This guide can be skipped if you don't want Remux behind a domain with HTTPS (less secure).


Prerequisites

Caddy is packaged as a Docker container. If you haven't already, install Docker on your server.


Docker compose

Create the Caddy folder (in your desired root folder) and a shared Docker network for Caddy and Remux:

bash (terminal)
mkdir caddy
cd caddy
docker network create caddy-net
mkdir -p conf data

Create a separate docker-compose.yml for Caddy:

docker-compose.yml
services:
  caddy:
    image: caddy:2-alpine
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - ./conf:/etc/caddy:ro
      - ./data:/data
    networks:
      - caddy-net
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "--fail", "--silent", "--show-error", "http://127.0.0.1:2019/config/"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 15s

networks:
  caddy-net:
    external: true

Configure the firewall with UFW

Allow the ports Caddy uses for HTTP, HTTPS, and HTTP/3:

bash (terminal)
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 443/udp

If UFW is not already enabled, allow SSH before enabling it so you do not lock yourself out of the server:

bash (terminal)
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status

DuckDNS (optional step)

If you don't have a domain, you can use DuckDNS:

  1. Sign in to DuckDNS and create a subdomain.
  2. Set the subdomain to your server's public IP address.
  3. If your public IP changes periodically, configure one of the update clients listed by DuckDNS.
  4. Confirm that the domain resolves to your public IP before starting Caddy.

If the server is behind a router, forward TCP ports 80 and 443, plus UDP port 443, from the router to the server. You do not need to forward Remux port 3000.

Caddyfile

Create a file named Caddyfile inside the conf directory. Replace remux.my-domain.duckdns.org with the domain pointing to your server.

Caddyfile
remux.my-domain.duckdns.org {
  reverse_proxy remux:3000
}

Caddy will still obtain and renew the certificate, enable HTTPS, and redirect HTTP to HTTPS automatically.

Start Caddy:

bash (terminal)
docker compose up -d

Remux (once set up in the next step) will now be served over HTTPS (encrypted and secure).


Last updated on by @jonas-thuvesson-winberg

On this page