FreeSWITCH is a powerful open-source telephony platform used for SIP trunking, VoIP servers, WebRTC, and AI voice bots. Maintained by SignalWire, FreeSWITCH is designed for high-performance media processing and can handle voice, video, and text communication across all popular VoIP protocols.
📌 Why Install from Source?
Ubuntu’s repositories (especially 20.04/22.04/24.04) often give errors like 401 Unauthorized or GPG issues. Installing from source avoids:
- Repo authentication problems
- GPG key issues
- Version conflicts
- GCC compatibility errors
🖥 System Requirements
- Ubuntu 18.04 / 20.04 / 22.04
- 2GB RAM minimum (4GB recommended)
- Root / sudo access
- Open ports 5060 (SIP)
🔹 Step 1: Update Ubuntu
sudo apt update && sudo apt upgrade -y
🔹 Step 2: Install Dependencies
Install required packages depending on your Ubuntu version:
Ubuntu 18.04 LTS
sudo apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-dev \
libsqlite3-dev libcurl4-openssl-dev libpcre3-dev libspeexdsp-dev libldns-dev \
libedit-dev libtiff5-dev yasm libopus-dev libsndfile1-dev unzip libavformat-dev \
libswscale-dev libavresample-dev liblua5.2-dev liblua5.2 cmake libpq-dev unixodbc-dev \
autoconf automake ntpdate libxml2-dev libpq-dev libpq5 sngrep
Ubuntu 20.04 LTS
sudo apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-dev \
libsqlite3-dev libcurl4-openssl-dev libpcre3-dev libspeexdsp-dev libldns-dev \
libedit-dev libtiff5-dev yasm libopus-dev libsndfile1-dev unzip libavformat-dev \
libswscale-dev libavresample-dev liblua5.2-dev liblua5.2-0 cmake libpq-dev unixodbc-dev \
autoconf automake ntpdate libxml2-dev libpq-dev libpq5 sngrep
Ubuntu 22.04 LTS
sudo apt install --yes build-essential pkg-config uuid-dev zlib1g-dev libjpeg-dev \
libsqlite3-dev libcurl4-openssl-dev libpcre3-dev libspeexdsp-dev libldns-dev \
libedit-dev libtiff5-dev yasm libopus-dev libsndfile1-dev unzip libavformat-dev \
libswscale-dev liblua5.2-dev liblua5.2-0 cmake libpq-dev unixodbc-dev autoconf automake \
ntpdate libxml2-dev libpq-dev libpq5 sngrep
🔹 Step 3: Install SignalWire Libraries
Install libks
sudo git clone https://github.com/signalwire/libks.git /usr/local/src/libks
cd /usr/local/src/libks
sudo cmake .
sudo make && sudo make install
sudo sh -c 'ldconfig && ldconfig -p' | grep libks
Install libsignalwire
sudo git clone https://github.com/signalwire/signalwire-c.git /usr/local/src/signalwire-c
cd /usr/local/src/signalwire-c
sudo cmake .
sudo make && sudo make install
sudo sh -c 'ldconfig && ldconfig -p' | grep signalwire
🔹 Step 4: Install Sofia-SIP and SpanDSP Libraries
Starting from FreeSWITCH 1.10.4, you must install sofia-sip and spandsp separately.
Sofia-SIP
sudo git clone https://github.com/freeswitch/sofia-sip /usr/local/src/sofia-sip
cd /usr/local/src/sofia-sip
sudo ./bootstrap.sh
sudo ./configure
sudo make && sudo make install
sudo sh -c 'ldconfig && ldconfig -p' | grep sofia
SpanDSP
sudo git clone https://github.com/freeswitch/spandsp /usr/local/src/spandsp
cd /usr/local/src/spandsp
sudo ./bootstrap.sh
sudo ./configure
sudo make && sudo make install
sudo sh -c 'ldconfig && ldconfig -p' | grep spandsp
If correctly installed, you’ll see library versions; otherwise, no output appears.
🔹 Step 5: Download FreeSWITCH Source
cd /usr/src
sudo git clone https://github.com/signalwire/freeswitch.git
cd freeswitch
sudo git checkout v1.10
🔹 Step 6: Bootstrap & Configure
sudo ./bootstrap.sh -j
sudo ./configure
🔹 Step 7: Fix Ubuntu 24.04 Build Errors
Edit modules file:
nano modules.conf
Comment these lines:
#applications/mod_av
#applications/mod_spandsp
#applications/mod_signalwire
#applications/mod_verto
This prevents GCC “warnings treated as errors” issues.
🔹 Step 8: Compile & Install
make clean
make -j$(nproc)
sudo make install
sudo make sounds-install
sudo make moh-install
🔹 Step 9: Start FreeSWITCH
Foreground mode:
/usr/local/freeswitch/bin/freeswitch -nc
Background mode:
/usr/local/freeswitch/bin/freeswitch
🔹 Step 10: Connect to CLI
/usr/local/freeswitch/bin/fs_cli
status
🔹 Step 11: Verify SIP Port
ss -lunpt | grep 5060
📞 Default Test Extension
- Username: 1000
- Password: 1234
- Domain: Your Server IP
- Port: 5060
Use any softphone (Zoiper, Linphone) to test calls.
📂 Important Directories
| Directory | Purpose |
|---|---|
| /usr/local/freeswitch/conf | Configuration |
| /usr/local/freeswitch/log | Logs |
| /usr/local/freeswitch/sounds | Audio files |
🔥 Stop FreeSWITCH
Inside CLI:
shutdown
Or:
pkill freeswitch
🚀 Use Cases
- SIP Trunk Gateway
- Call Center System
- WebRTC Calling
- AI Voice Assistant
- Media Server for scalable telecom
Compared to Asterisk, FreeSWITCH offers better scalability for media-heavy applications.


