HomeBlog › Install RTPengine on Ubuntu

How to install RTPengine on Ubuntu

RTPengine (by Sipwise) is the fast, kernel-accelerated media proxy that gives SIP proxies like Kamailio and OpenSIPS what they lack: it relays RTP audio, handles NAT, does SRTP/DTLS and can record or transcode. This guide builds the daemon from source on Ubuntu 24.04 and connects it to your proxy.

RTPengine tracks kernel and FFmpeg versions closely, so dependency names shift between releases. This is the userspace (forwarding) build; the optional in-kernel module (kernel-module/) is a separate step for maximum throughput. Confirm the current dependency list in the project README (github.com/sipwise/rtpengine) before building.

Step 1 — Install build dependencies

sudo apt update
sudo apt install -y git build-essential markdown gperf \
  libglib2.0-dev libavcodec-dev libavformat-dev libavutil-dev \
  libswresample-dev libavfilter-dev libevent-dev libpcap-dev \
  libxmlrpc-core-c3-dev libhiredis-dev libjson-glib-dev \
  libssl-dev libcurl4-openssl-dev libpcre2-dev libwebsockets-dev \
  libspandsp-dev libmnl-dev libnftnl-dev

Step 2 — Build RTPengine from source

cd /usr/src
sudo git clone https://github.com/sipwise/rtpengine.git
cd rtpengine/daemon
sudo make -j$(nproc)

# Install the binary onto your PATH
sudo cp rtpengine /usr/local/bin/rtpengine

(Optional, for kernel-accelerated forwarding, build the module in ../kernel-module and the iptables plugin in ../iptables-extension, then load xt_RTPENGINE. Userspace forwarding works without it.)

Step 3 — Run and verify

Start RTPengine listening for control commands on the "ng" protocol (UDP 22222 by convention) and relaying media on a defined port range. Replace the IP with your server's public address:

sudo rtpengine --interface=YOUR_PUBLIC_IP \
  --listen-ng=127.0.0.1:22222 \
  --port-min=30000 --port-max=40000 \
  --log-level=6 --foreground

# In production, run it as a systemd service instead of --foreground.
# Check it's listening:
sudo ss -lnup | grep 22222

Open the media port range on the firewall: sudo ufw allow 30000:40000/udp.

Step 4 — Connect to Kamailio or OpenSIPS

Your SIP proxy talks to RTPengine over that ng control socket:

  • Kamailio — load the rtpengine module and point it at the socket: modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:22222"), then call rtpengine_manage() on INVITE/reply. See our Kamailio install guide.
  • OpenSIPS — load the rtpengine module with the same socket and call rtpengine_offer() / rtpengine_answer(). See our OpenSIPS install guide.

With that in place, the proxy handles signalling while RTPengine carries the audio — the standard high-scale open-source design. For the big picture, read Asterisk vs FreeSWITCH vs Kamailio vs OpenSIPS.

Security best practices

  • Bind the ng control socket to localhost (or a trusted management network) — never expose it publicly.
  • Restrict the RTP port range on the firewall and keep it tight.
  • Prefer SRTP/DTLS for media; keep RTPengine and the kernel patched.

Or let us run the whole stack

Signalling, media, recording, dialers, IVR — Qallixo delivers all of it as a managed cloud platform, so you never assemble or secure this yourself. See managed vs self-hosted, or book a demo.

Related: What is VoIP? →

Skip the media plumbing

Qallixo runs signalling and media for you. Start free, no servers required.

Chat with us