Skip to content

Getting started

MXProxy runs as a Docker container and communicates with the Docker daemon through its socket.

Before you start, make sure Docker Compose is installed. For public websites, you'll also need your domains to point to your server and ports 80 and 443 to be reachable.

Installation

Create a compose.yaml:

compose.yaml
services:
  mxproxy:
    image: malasaur/mxproxy:0.2
    container_name: mxproxy
    restart: unless-stopped
    ports:
      - "80:80" # HTTP
      - "443:443/tcp" # HTTPS
      - "443:443/udp" # HTTP/3
    extra_hosts:
      - "dockerhost:host-gateway"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./data:/data
      - ./config:/config
      - ./custom:/custom
    networks: [mxproxy]

networks:
  mxproxy:
    external: true

For production deployments, pin MXProxy to a release version instead of using latest. See Updating for more information.

Create the Docker network

MXProxy requires an external Docker network. By default, it uses a network named mxproxy.

Create the network:

docker network create --ipv6 mxproxy

All services that MXProxy should proxy must be connected to this network.

Warning

Mounting /var/run/docker.sock gives MXProxy access to the Docker daemon. Only run MXProxy with a Docker host and configuration you trust.

Start MXProxy

Start the container:

docker compose up -d

To inspect its logs:

docker compose logs -f mxproxy

Configure your first service

Add your application to the mxproxy network and define a reverse_proxy label:

compose.yaml
services:
  app:
    image: traefik/whoami
    networks: [mxproxy]
    labels:
      reverse_proxy: example.com -> 80

networks:
  mxproxy:
    external: true

Replace example.com with your domain and 80 with the port your application listens on.

MXProxy detects the container's IP address and forwards requests to it.

That's it! You're now ready to explore the usage guide!