Back to Insights
VoIP Engineering

How to Install FreeSWITCH on Debian 12: Packages, Docker and Your First Call

Telephony Engineering Team
7 min read
How to Install FreeSWITCH on Debian 12: Packages, Docker and Your First Call

This guide walks you through installing FreeSWITCH on a fresh Debian 12 server, securing the defaults, and placing your first test call between two softphones. By the end you will have a working media server you can build on.

Always check the current FreeSWITCH documentation for exact repository and package details, because installation instructions change between releases. The steps below reflect the common approach at the time of writing.

Before you begin

You need:

  • A Debian 12 server or VM with root or sudo access
  • A static IP address, and DNS if you will use hostnames
  • Time synchronization (for example with chrony or systemd-timesyncd), because SIP and TLS depend on accurate clocks
  • Two SIP softphones or desk phones for testing, such as Linphone or Zoiper
  • Control of the firewall in front of the server

FreeSWITCH's official packages target Debian. If you prefer Ubuntu or another distribution, you will usually build from source or use a container.

Choose an installation method

MethodBest forTrade-off
Official Debian packagesMost servers: fast, supported, easy to updateRequires a SignalWire token for the package repository
DockerRepeatable environments and testingNeeds careful networking for RTP; image provenance matters
Build from sourceCustom modules, non-Debian systemsSlower, more dependencies to manage

Method 1: install from the official Debian packages

FreeSWITCH's package repository is hosted by SignalWire and requires a free personal access token from a SignalWire account. Create the token first, then run the following as root (or prefix with sudo).

apt-get update && apt-get install -y gnupg2 wget lsb-release

TOKEN=YOUR_SIGNALWIRE_TOKEN

wget --http-user=signalwire --http-password=$TOKEN \
  -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg \
  https://freeswitch.signalwire.com/repo/deb/debian-release/signalwire-freeswitch-repo.gpg

echo "machine freeswitch.signalwire.com login signalwire password $TOKEN" > /etc/apt/auth.conf
chmod 600 /etc/apt/auth.conf

echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ $(lsb_release -sc) main" \
  > /etc/apt/sources.list.d/freeswitch.list

apt-get update
apt-get install -y freeswitch-meta-all

freeswitch-meta-all installs FreeSWITCH with a broad set of modules, which is convenient for learning. For production, install only the modules you need.

Enable and start the service, then confirm it is running:

systemctl enable --now freeswitch
fs_cli -x "status"

If fs_cli prints uptime and session counts, FreeSWITCH is running.

Where things live

PathContents
/etc/freeswitch/Configuration (XML)
/var/log/freeswitch/Log files
/usr/share/freeswitch/Sounds and shared files
/var/lib/freeswitch/Recordings, databases, and runtime data

Method 2: run FreeSWITCH in Docker

Containers are handy for testing and repeatable builds, with one important caveat: FreeSWITCH uses a very large range of UDP ports for RTP, and Docker's port mapping handles large ranges poorly. The simplest reliable setup is host networking.

docker run -d --name freeswitch --network host \
  -v /opt/freeswitch/conf:/etc/freeswitch \
  -v /opt/freeswitch/log:/var/log/freeswitch \
  YOUR_FREESWITCH_IMAGE

Notes:

  • Replace YOUR_FREESWITCH_IMAGE with an image you build or one you trust. Community images exist, but verify who maintains an image before running it on a production server.
  • Copy the default configuration into your mounted volume first, so you can edit it.
  • Many teams build their own image from a Debian base using the same packages as above, which keeps versions under your control.

Method 3: build from source

Building from source gives you full control and works on any distribution. The source is on GitHub at signalwire/freeswitch. In outline:

  1. Install the build toolchain and development libraries.
  2. Build and install required libraries that the release depends on (such as sofia-sip and spandsp, and others noted in the build guide).
  3. Run ./bootstrap.sh -j, ./configure, make, and make install.
  4. Create a service unit so FreeSWITCH starts on boot.

The exact dependency list changes by version, so follow the current build instructions in the official documentation.

Open the right ports

Open only what you need, and restrict sources where possible.

PortProtocolPurpose
5060UDP and TCPSIP for the internal profile (phones)
5080UDP and TCPSIP for the external profile (carriers and trunks)
5061 / 5081TCPSIP over TLS, if enabled
16384 to 32768UDPRTP audio (the default range)
8021TCPEvent Socket (keep this local)
7443TCPWebRTC over secure WebSocket, if enabled

Never expose the Event Socket port (8021) to the internet.

Secure the defaults before you expose the server

The stock FreeSWITCH configuration is built for demonstration. Change these before the server is reachable from outside:

  1. Default extension password. The sample users (1000 to 1019) share a password defined in vars.xml as default_password, which is a well-known value. Change it to a strong, unique value.
  2. Event Socket password. In autoload_configs/event_socket.conf.xml, change the default password and restrict access to localhost with the ACL.
  3. Restrict SIP exposure. Use firewall allow-lists for carriers and known networks. Block everything else.
  4. Add automatic blocking of abusive sources. See FreeSWITCH hardening with fail2ban and firewalls.
  5. Disable what you do not use, including unused modules and demo features.

Internet-facing SIP servers are scanned constantly, often within minutes of going online. Treat security as step one, not a later task. See also VoIP security best practices.

Behind NAT? Set your external addresses

If the server sits behind NAT, or has a public IP that the operating system does not know about (common on cloud platforms), set the external addresses in vars.xml so SDP and SIP headers advertise the right IP:

<X-PRE-PROCESS cmd="set" data="external_rtp_ip=YOUR.PUBLIC.IP"/>
<X-PRE-PROCESS cmd="set" data="external_sip_ip=YOUR.PUBLIC.IP"/>

Reload with fs_cli -x "reloadxml" and restart the SIP profiles as needed. NAT problems are the number one cause of one-way audio. See NAT traversal with STUN, TURN and ICE and SIP ALG.

Make your first call

  1. Register softphone A as extension 1000. Use your server's IP as the SIP domain or server, username 1000, and the password you set in default_password.

  2. Register softphone B as extension 1001 with the same password.

  3. Confirm registration on the server:

    fs_cli -x "sofia status profile internal reg"
    
  4. Call 1001 from 1000. Both phones should ring and carry audio in both directions.

  5. Try the echo test by dialing 9196. You should hear your own voice repeated back.

If both calls work, signaling, routing, and media are working end to end.

Useful fs_cli commands

CommandPurpose
statusUptime and session counts
sofia statusSIP profiles and gateways
sofia status profile internal regRegistered users
show channelsActive calls
sofia global siptrace onPrint SIP messages to the console
console loglevel 7Increase log detail
reloadxmlReload configuration

Troubleshooting

ProblemLikely causeWhat to try
Phone will not registerWrong password, domain, or blocked portCheck default_password, port 5060, and sofia status profile internal reg
Calls connect but no audioRTP ports blocked, or NAT addresses wrongOpen the RTP range and set external IPs
One-way audioNAT or a router SIP ALGFix external IPs and disable SIP ALG
Calls rejectedDialplan or user not foundWatch siptrace and check the dialplan context
Changes do not applyConfiguration not reloadedreloadxml, and restart profiles if needed

What to do next

Frequently asked questions

Is FreeSWITCH free?

Yes. FreeSWITCH is open-source software. Commercial support and hosted services are available from vendors, but the software itself is free to use.

Which operating system is best for FreeSWITCH?

Debian is the primary target for the official packages. Other distributions work, usually by building from source or using containers.

Can I run FreeSWITCH on Ubuntu?

Yes, typically by building from source or using a container, since the official package repository targets Debian.

How many calls can one FreeSWITCH server handle?

It depends on hardware, codecs, transcoding, and features such as recording. Measure with realistic traffic rather than relying on generic numbers. See SIP trunking load testing.

References


Need FreeSWITCH installed, hardened, and scaled for production? Our FreeSWITCH development team designs, builds, and operates production media servers.

Discussion

0

Join the conversation

Sign in with your preferred account to comment, reply, and keep the discussion useful for other engineers.

Takes a few seconds. No separate password required.

C

Controva LLC

Engineering Team

We build digital empires that scale. Specializing in high-performance web architecture, AI automation, and headless commerce.

Work with us

Share this article