install your own private RTMP server on Ubuntu 20.04

Step 1: Install NGINX Dependencies
RTMP has 3 Dependencies: OpenSSL, PCRE and Zlib.
Ubuntu 20.04 already has default OpenSSL, PCRE, we only need install Zlib:

wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make
sudo make install

Step 2: Installing nginx with RTMP module

$ sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev
$ wget http://nginx.org/download/nginx-1.15.1.tar.gz
$ wget https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/archive/dev.zip
$ tar -zxvf nginx-1.15.1.tar.gz
$ unzip dev.zip
$ cd nginx-1.15.1
$ ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-dev
$ make
$ sudo make install
$ sudo /usr/local/nginx/sbin/nginx

And to test to make sure nginx is running, point your browser to http:/// and you should get the "Welcome to nginx!" page.

Step 3: Configuring nginx to use RTMP
Open your config file, located by default at /usr/local/nginx/conf/nginx.conf and add the following at the very end of the file:

rtmp {
        server {
                listen 1935;
                chunk_size 4096;

                application live {
                        live on;
                        record off;
                }
        }
}

Restart nginx with:
$ sudo /usr/local/nginx/sbin/nginx -s stop
$ sudo /usr/local/nginx/sbin/nginx

Step 4: Testing!
Download OBS Studio from https://obsproject.com/ and install it.
Download https://get.videolan.org/vlc/3.0.11/win32/vlc-3.0.11-win32.exe and install it.
Create a new profile in OBS, and change your Broadcast Settings thusly:

Streaming Service: Custom
Server: rtmp://<your server ip>/live
Play Path/Stream Key: test

add a Text source "hello rtmp!"


and open your VLC, Open Network Stream with rtmp://ubunu2008/live/test, you will see:

One Reply to “install your own private RTMP server on Ubuntu 20.04”

Leave a Reply

Your email address will not be published. Required fields are marked *