Docker is a convenient way to run FreeSWITCH in a self-contained, reproducible environment — ideal for development, testing, CI/CD pipelines, and cloud deployments where you want isolated, version-pinned instances. The FreeSWITCH repository ships officialDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/signalwire/freeswitch/llms.txt
Use this file to discover all available pages before exploring further.
Dockerfile examples that build the switch and all its dependencies entirely from source, with no dependency on the SignalWire package repository. Configuration and log directories can be mounted from the host for persistence across container restarts.
Official Docker Images
Thedocker/ directory of the FreeSWITCH repository contains official Docker configuration:
docker/README.md— Volume mount instructions, port reference, and networking guidance.docker/examples/Debian11/Dockerfile— A complete, multi-stage Dockerfile that clones all required libraries (libks,sofia-sip,spandsp,signalwire-c) and builds FreeSWITCH from source on Debian 11 (Bullseye).
Build from Dockerfile
Change to the Debian 11 example directory
Dockerfile here installs all build dependencies, clones the required support libraries, compiles them, then compiles FreeSWITCH itself — producing a self-contained image with no external package repository requirements.Build the Docker image
libks, sofia-sip, spandsp, and signalwire-c before building FreeSWITCH, so expect the initial build to take several minutes. Subsequent builds use the Docker layer cache for unchanged steps.Run with explicit port mappings
If you prefer to publish ports individually rather than using--network host, map the following ports. Be aware of performance considerations for the large RTP range:
| Port(s) | Protocol | Purpose |
|---|---|---|
5060 | TCP / UDP | SIP signaling — internal profile |
5080 | TCP / UDP | SIP signaling — external/outbound profile |
5061 | TCP | SIPS (SIP over TLS) — internal |
5081 | TCP | SIPS — external |
5066 | TCP | WebSocket (WS) for WebRTC signaling |
7443 | TCP | WebSocket Secure (WSS) for WebRTC |
8021 | TCP | Event Socket Library (ESL) — fs_cli and API clients |
16384–32768 | UDP | RTP / SRTP media streams (primary range) |
64535–65535 | UDP | RTP / SRTP media streams (secondary range) |
Docker Compose Example
For a more complete deployment with persistent configuration and log volumes, use Docker Compose:fs_cli from inside the container:
Environment and Volumes
Configuration (/etc/freeswitch)
FreeSWITCH reads its entire configuration from /etc/freeswitch at startup. Mount a host directory here to use your own dialplan, directory, and module configuration:
Logs (/var/log/freeswitch)
FreeSWITCH writes freeswitch.log and the compiled XML snapshot (freeswitch.xml.fsxml) to /var/log/freeswitch. Mount this directory to persist logs across container restarts and make them accessible to log aggregation tools:
Temporary files and recordings
For recordings, voicemail storage, and other runtime data, mount the appropriate paths:Health check
The official Docker setup includes a health check that runsfs_cli status against the running instance. The container is reported as healthy only when FreeSWITCH is fully initialized and accepting Event Socket connections. This integrates correctly with docker compose depends_on: condition: service_healthy for orchestrated stacks.