Install Kamailio SIP Server on Ubuntu 24.04
You install Kamailio SIP Server on Ubuntu 24.04 to manage your Voice over IP (VoIP) and real-time communications.
Kamailio is an open-source SIP server that acts as the central brain for your internet-based calls and messages. It understands and processes Session Initiation Protocol (SIP), the standard language for setting up, managing, and tearing down multimedia communication sessions.
This powerful server is built for handling a massive amount of traffic, efficiently routing calls, managing user registrations, and securing your communication infrastructure for applications like VoIP, instant messaging, and presence.
Here, you’ll learn the exact steps to get Kamailio up and running on your Ubuntu 24.04 LTS (Noble Numbat) system.
Install Kamailio by first installing MariaDB with `sudo apt install mariadb-server`. Then, add the Kamailio repository and install Kamailio itself with `sudo apt install kamailio kamailio-mysql-modules`. Finally, configure the database connection in `/etc/kamailio/kamctlrc` and create the database schema with `sudo kamdbctl create`.
Install MariaDB
First, you’ll need to install MariaDB. Kamailio requires a database server to store its content, and MariaDB is a great open-source option. Run the command below to install it on Ubuntu.
sudo apt update
sudo apt install mariadb-server
Once MariaDB is installed, we’ll move on to adding the Kamailio repository.
Add Kamailio repository
Once MariaDB is installed, run the command below to add Kamailio’s repository to Ubuntu.
Kamailio packages aren’t available in Ubuntu’s default repositories, so you need to add its own repository first.
But first, add the repository GPG key.
wget -O- http://deb.kamailio.org/kamailiodebkey.gpg | sudo apt-key add -
Then, add the repository for Ubuntu 24.04. Right now, the latest version is 6.0.
If a newer version is released, you can find it at https://deb.kamailio.org.
sudo tee /etc/apt/sources.list.d/kamailio.list<<EOF
deb http://deb.kamailio.org/kamailio60 noble main
deb-src http://deb.kamailio.org/kamailio60 noble main
EOF
After adding its repository key and file, run the command below to install Kamailio and related modules.
sudo apt update
sudo apt install kamailio kamailio-mysql-modules kamailio-websocket-modules kamailio-tls-modules
After the installation, check if the Kamailio application is available by running the command [kamailio -V].
kamailio -V
The Kamailio bin file is installed by default at [/usr/sbin/kamailio].
Configure Kamailio
Now that Kamailio is installed, you can begin configuring it.
First, make sure the database connection is created. Edit the file [/etc/kamailio/kamctlrc] and make sure the [DBENGINE] variable is set to MySQL. Uncomment the line to turn it on.
sudo nano /etc/kamailio/kamctlrc
Change the highlighted line.
## the SIP domain
SIP_DOMAIN=srv1.example.com
## chrooted directory
# CHROOT_DIR="/path/to/chrooted/directory"
## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE
## by default none is loaded
##
## If you want to setup a database with kamdbctl, you must at least specify
## this parameter.
DBENGINE=MYSQL
## database host
DBHOST=localhost
Save the file and exit.
Then, run the command below to create a database for Kamailio. This command will create the users and tables needed by Kamailio (Schema).
sudo kamdbctl create
You’ll be prompted for your MySQL root password. If you haven’t set one up yet, just press Enter.
Use the highlighted value to complete the prompts.
Enter character set name:
latin1
INFO: creating database kamailio ...
INFO: granting privileges to database kamailio ...
INFO: creating standard tables into kamailio ...
INFO: Core Kamailio tables successfully created.
Create the presence related tables? (y/n): y
INFO: creating presence tables into kamailio ...
INFO: Presence tables successfully created.
Create the tables for imc cpl siptrace domainpolicy carrierroute drouting userblocklist htable purple uac pipelimit mtree sca mohqueue rtpproxy rtpengine secfilter ims_icscf? (y/n): y
INFO: creating extra tables into kamailio ...
INFO: Extra tables successfully created.
Create the tables for uid_auth_db uid_avp_db uid_domain uid_gflags uid_uri_db? (y/n): y
INFO: creating uid tables into kamailio ...
INFO: UID tables successfully created.
A MySQL user named “kamailio” will be created with the password “kamailiorw.” This user has read and write permission to access the Kamailio database.
Another user named “kamailioro” with password “kamailioro” will be created. It has read-only access permissions to the Kamailio database.
Next, edit the [/etc/kamailio/kamailio.cfg] file.
sudo nano /etc/kamailio/kamailio.cfg
Add the highlighted lines just below #!KAMAILIO.
#!KAMAILIO
#!define WITH_MYSQL
#!define WITH_AUTH
#!define WITH_USRLOCDB
#!define WITH_ACCDB
#
Save and exit.
After making all the changes above, restart Kamailio.
sudo systemctl restart kamailio
To check and verify if Kamailio is running, run the command below.
systemctl status kamailio
The command should output lines similar to the one below.
Loaded: loaded (/usr/lib/systemd/system/kamailio.service; enabled; preset: enabled)
Active: active (running) since Thu 2025-03-20 10:40:23 CDT; 38s ago
Process: 6194 ExecStart=/usr/sbin/kamailio -P /run/kamailio/kamailio.pid -f $CFGFILE >
Main PID: 6196 (kamailio)
Tasks: 33 (limit: 4551)
Memory: 23.8M (peak: 24.1M)
CPU: 113ms
CGroup: /system.slice/kamailio.service
Kamailio is installed and ready to use.
That should do it!
Conclusion:
You’ve successfully installed Kamailio SIP Server on Ubuntu 24.04, setting up a robust solution for managing VoIP communications. Here are the key takeaways:
- Open-Source Flexibility: Kamailio is a highly scalable and flexible SIP server suitable for real-time communication applications.
- Database Integration: The installation requires configuring MariaDB as a database server to store Kamailio’s data.
- Repository Addition: Adding the Kamailio repository and its GPG key is essential to install the latest packages.
- Configuration Steps: Configuration includes setting up the database connection kamctlrc and modifying kamailio.cfg the required modules.
- Service Management: After installation, Kamailio can be managed using systemd, ensuring it runs consistently in the background.
With these steps completed, Kamailio is fully operational, providing a powerful VoIP and related services platform.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
Do you have a tutorial to install RTPProxy with kamailio?
Sorry, I haven’t written a tutorial on that topic. I may do it in the future.
I spent about a week using other guides but to no avail, this has helped massively! Thanks Richard!