Home › Blog › Install Kamailio on Ubuntu
How to install Kamailio SIP server on Ubuntu
Kamailio is a high-performance open-source SIP server used as a registrar, proxy, load balancer or SBC front-end — routing tens of thousands of calls per second. This guide installs it from the official apt repository on Ubuntu 24.04 with a MySQL/MariaDB backend.
noble for 24.04). Check deb.kamailio.org for the current branch and adjust the repo line below.Step 1 — Add the Kamailio repository
sudo apt update
sudo apt install -y gnupg2 wget
# Import the signing key
wget -O- https://deb.kamailio.org/kamailiodebkey.gpg \
| sudo gpg --dearmor -o /usr/share/keyrings/kamailio.gpg
# Add the repo (5.8 branch, Ubuntu 24.04 'noble' — adjust as needed)
echo "deb [signed-by=/usr/share/keyrings/kamailio.gpg] http://deb.kamailio.org/kamailio58 noble main" \
| sudo tee /etc/apt/sources.list.d/kamailio.list
sudo apt update
Step 2 — Install Kamailio and modules
Install the core plus the modules you'll actually use (MySQL, TLS, presence, WebSocket, etc.):
sudo apt install -y kamailio kamailio-mysql-modules \
kamailio-tls-modules kamailio-websocket-modules \
kamailio-presence-modules kamailio-utils-modules \
mariadb-server
Step 3 — Set up the database
Kamailio ships helper tools (kamdbctl, kamctl) configured through /etc/kamailio/kamctlrc. Set the DB engine and credentials there, then create the schema:
# In /etc/kamailio/kamctlrc, uncomment / set:
# DBENGINE=MYSQL
# DBHOST=localhost
# DBRWUSER="kamailio"
# DBRWPW="yourpassword"
# SIP_DOMAIN=sip.yourdomain.com
sudo kamdbctl create # creates the kamailio database + tables
Then enable the database features in /etc/kamailio/kamailio.cfg by defining #!define WITH_MYSQL and #!define WITH_AUTH (and WITH_USRLOCDB to persist registrations) near the top of the file.
Step 4 — Start and verify
sudo systemctl enable kamailio
sudo systemctl restart kamailio
sudo systemctl status kamailio
# Check it's listening on SIP (5060) and open the CLI
sudo kamctl monitor
sudo ss -lnup | grep 5060
Open the firewall for SIP: sudo ufw allow 5060/udp (and 5061/tcp if you use TLS). Add a user to test registration with sudo kamctl add alice yourpassword.
Add media with RTPengine
Kamailio only routes SIP signalling — it does not relay or record audio. For NAT traversal, recording or transcoding, pair it with a media proxy. See our guide on installing RTPengine, and the overview of how Kamailio compares to Asterisk, FreeSWITCH and OpenSIPS.
Security best practices
- Enable TLS for SIP and use strong subscriber passwords.
- Rate-limit and use
pike/htableto block floods; runfail2ban. - Firewall SIP to known peers where possible; keep Kamailio patched.
Want the finished product instead?
Kamailio is a building block, not a call center. Qallixo gives you dialers, IVR, recording and WhatsApp on a fully-managed stack — nothing to route or patch. See managed vs self-hosted.