How To Install Nginx With RTMP Module On CentOS 8
How To Install Nginx With RTMP Module On CentOS 8
Net
Atlantic.Net Blog
0 Comments (https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-
module-on-centos-8/#disqus_thread)
(https://facebook.com/sharer/sharer.php?
display=popup&u=https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-
rtmp-module-on-centos-8/)
on CentOS 8&url=https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-
rtmp-module-on-centos-8/)
8&body=https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-
module-on-centos-8/)
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 1/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
(https://www.linkedin.com/sharing/share-offsite/?url=https://www.atlantic.net/vps-
hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/)
(https://reddit.com/submit/?url=https://www.atlantic.net/vps-hosting/how-to-
install-nginx-with-rtmp-module-on-centos-8/&resubmit=true&title=How to Install
(https://news.ycombinator.com/submitlink?u=https://www.atlantic.net/vps-
hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/&t=How to Install
to stream audio, video, and data over the Internet. Nginx RTMP is an Nginx-based
media streamer that comes with a lot of features including H264/AAC support, online
transcoding with FFmpeg, HTTP callback support, and an HTTP control module for
In this tutorial, we will show you how to compile Nginx with the RTMP module and
Prerequisites
A fresh CentOS 8 VPS (/vps-hosting/) on the Atlantic.Net Cloud Platform
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 2/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
Connect to your Cloud Server via SSH and log in using the credentials highlighted at
Once you are logged in to your CentOS 8 server, run the following command to update
yum update -y
with RTMP support. First, install the Development Tool group package with the
following command:
Once installed, install other required dependencies using the following command:
yum install wget git unzip perl perl-devel perl-ExtUtils-Embed libxslt libxslt-devel libxml2
libxml2-devel gd gd-devel pcre-devel GeoIP GeoIP-devel -y
Once all the packages are installed, you can proceed to compile Nginx.
RTMP support.
First, download the latest stable version of Nginx with the following command:
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 3/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
unzip pcre-8.42.zip
tar -xvzf zlib-1.2.11.tar.gz
Once both are extracted, download OpenSSL with the following command:
Next, download the latest version of the Nginx RTMP Module from the Git repository
Once all the components are downloaded, you can proceed to the next step.
cd nginx-1.18.0/
Next, configure Nginx with RTMP support using the following command:
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 4/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
./configure --prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--modules-path=/usr/lib64/nginx/modules \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--user=nginx \
--group=nginx \
--build=CentOS \
--builddir=nginx-1.18.0 \
--with-select_module \
--with-poll_module \
--with-threads \
--with-file-aio \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module=dynamic \
--with-http_image_filter_module=dynamic \
--with-http_geoip_module=dynamic \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_auth_request_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_degradation_module \
--with-http_slice_module \
--with-http_stub_status_module \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \
--http-scgi-temp-path=/var/cache/nginx/scgi_temp \
--with-mail=dynamic \
--with-mail_ssl_module \
--with-stream=dynamic \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-stream_geoip_module=dynamic \
--with-stream_ssl_preread_module \
--with-compat \
--with-pcre=../pcre-8.42 \
--with-pcre-jit \
--with-zlib=../zlib-1.2.11 \
--with-openssl=../openssl-1.1.0h \
--with-openssl-opt=no-nextprotoneg \
--add-module=../nginx-rtmp-module \
--with-debug
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 5/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
Once the configuration process has been completed, you should get the following
output:
Configuration summary
+ using threads
+ using PCRE library: ../pcre-8.42
+ using OpenSSL library: ../openssl-1.1.0h
+ using zlib library: ../zlib-1.2.11
make
make install
After installing Nginx, verify the installed version of Nginx with the following
command:
nginx -V
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 6/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
nano /lib/systemd/system/nginx.service
[Unit]
Description=nginx - high performance web server
Documentation=https://nginx.org/en/docs/ (https://nginx.org/en/docs/)
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
[Install]
WantedBy=multi-user.target
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 7/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
Save and close the file when you are finished, then reload the systemd daemon with the
following command:
systemctl daemon-reload
Next, start Nginx and enable it to start at system reboot with the following command:
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
Next, create a new Nginx configuration file using the following command:
nano /etc/nginx/nginx.conf
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 8/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
worker_processes auto;
events {
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935; # Listen on standard RTMP port
chunk_size 4000;
}
}
http {
sendfile off;
tcp_nopush on;
aio on;
directio 512;
default_type application/octet-stream;
server {
listen 8080;
location / {
# Disable cache
add_header 'Cache-Control' 'no-cache';
# CORS setup
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
types {
application/dash+xml mpd;
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 9/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
}
root /mnt/;
}
}
}
Save and close the file, then create a new directory for the HLS configuration and give
proper ownership:
mkdir -p /mnt/hls
chown -R nginx:nginx /mnt/hls
nano /etc/nginx/nginx.conf
hls_playlist_length 60;
# disable consuming the stream from nginx as rtmp
deny play all;
}
application vod {
play /mnt/mp4s;
}
Save and close the file, then restart the Nginx service with the following command:
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 10/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
mkdir -p /mnt/mp4s
cd /mnt/mp4s
wget https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4 (https
myfile.mp4
CentOS 8 default repository, so you will need to enable the Powertool repo in your
Once the FFmpeg is installed, start the streaming server with the following command:
ffmpeg -re -i /mnt/mp4s/myfile.mp4 -vcodec libx264 -vprofile baseline -g 30 -acodec aac -strict
f flv rtmp://your-server-ip:1935/show/vod
Once the client system, open the VLS media player, go to VLC Media => Open Network
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 11/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
Provide your RTMP streaming server URL and click on the Play button.
Once you are connected successfully, you should see your MP4 video in the following
screen:
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 12/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
Conclusion
In the above tutorial, you learned how to install Nginx with RTMP support. You also
learned how to configure Nginx to stream MP4 video and play it with VLC media player
from the remote system. Try installing Nginx with RTMP support on VPS Hosting
connection-to-mysql-database-server/)
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 13/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
command-examples-to-monitor-your-linux-processes/)
(/press-releases/atlantic-net-attains-ssae-18-certification-compliance-
aicpa-standard-principles/) (/press-releases/atlantic-net-
offers-hipaa-audited-hosting-solution-to-give-medical-
companies-and-patients-protection/) (/press-
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 14/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
releases/atlantic-net-offers-hipaa-audited-hosting-solution-to-give-
medical-companies-and-patients-protection/)
Recent Posts
a-cloud-server-from-an-iso/)
compliant-hosting/top-5-hipaa-compliant-crm-software-tools/)
(https://www.atlantic.net/?p=33486)
(https://www.atlantic.net/?p=33567)
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 15/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
ALSO ON ATLANTIC.NET
a year ago • 4 comments a year ago • 1 comment 2 years ago • 1 comment 2 years a
In this tutorial, we will show Ubuntu allows you to add Let’s look at four Linux This tuto
you how to set up a full- multiple virtual IP addresses distributions that we feel are setting u
featured Mail server with … on a single network … the best available for … on a Linu
LOG IN WITH
OR SIGN UP WITH DISQUS ?
Name
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 16/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
ABOUT US (/ABOUT-US/)
Why Atlantic.Net (https://www.atlantic.net/hosting-services-provider/)
Our Certifications (https://www.atlantic.net/hosting-services-provider/certifications-and-partnerships/)
Our Data Centers (https://www.atlantic.net/hipaa-data-centers/)
Media Press Room (https://www.atlantic.net/press-room/)
Partner Program (https://www.atlantic.net/partners/)
Career Opportunities (/careers/)
Contact Us (https://www.atlantic.net/about-us/corporate-contact/)
SUPPORT (/SUPPORT/)
Always Available Support (https://www.atlantic.net/hosting-services-provider/support-team/)
100% Uptime SLA (https://www.atlantic.net/hosting-services-provider/100-uptime-sla/)
Network Status (https://status.atlantic.net/)
Speed Test (https://www.atlantic.net/speed-test/)
Service Policies (https://www.atlantic.net/service-policies/)
Privacy Policy (https://www.atlantic.net/service-policies/privacy-policy/)
Cookie Settings
Clifton, NJ 07014
United States
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 17/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
United States
DALLAS, TX (/HIPAA-DATA-CENTERS/DALLAS-TEXAS-HOSTING/)
2323 Bryan Street,
United States
ASHBURN, VA (/HIPAA-DATA-CENTERS/ASHBURN-VIRGINIA-HOSTING/)
1807 Michael Faraday Ct,
Reston, VA 20190
United States
ORLANDO, FL (/ORLANDO-COLOCATION-HOSTING-DATA-CENTER/)
440 W Kennedy Blvd, Suite 3
Orlando, FL 32810
United States
Canada
LONDON, UK (/HIPAA-DATA-CENTERS/LONDON-UK-HOSTING/)
14 Liverpool Road, Slough,
United Kingdom
SALES: 888-618-3282
INTL: +1-321-206-3734
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 18/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
(http
s://
ww
w.fa
cebo
ok.c
om/
Atla
ntic
Net)
RESOURCES
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 19/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 20/21
17/3/2021 How to Install Nginx with RTMP Module on CentOS 8 | Atlantic.Net
https://www.atlantic.net/vps-hosting/how-to-install-nginx-with-rtmp-module-on-centos-8/ 21/21