Hopp til innhold

This guide is based on an article to use nginx as an RTMP server. Also note that this guide has little to no focus on security. If you plan on using this for something critical or online you must secure your setup better then I do here.

What does it do?

When streaming there might be edge cases where you want to stream to a local server. This server can record incoming streams and have a simple webpage showing a youtube style video player. This server does not transcode the video and can not handle many concurrent viewers. But it can be made very small and simple. Stability might also be a problem.

The OrangePi Zero

OrangePi Zerois a tiny ARM based computer similar to a Rasperry Pi. It contains a quad core 1,2 Ghz ARM prosessor and 256 or 512 MB or RAM. It has one USB port, wireless and 100 Mbit wired ethernet. The reason I use this ARM computer is the size and price. An 256 MB version cost 7 dollars and an 512 MB version cost 9 dollars.

What will you need?


  • OrangePi Zero
  • SD card (4GB or more)
  • 5 Volt USB power supply (I have not seen the OrangePi use more then 500mA)
  • Free ethernet port on your router and internet connection
  • Ethernet cable


Flashing the image to the SD card.

put your SD card into your computer.

Download and unzip the Armbian image.

Install Win32 Disk Imager and run it as Administrator.

Choose the image file and drive that the SD card is connected to. Press write to start flashing the card. (Content on the SD card will be deleted in this process).

When the image is copied to the SD card. Unplug it and put it into the OrangePi Zero. Put in network cable.

Scanning for the OrangePi Zero on your network

before connecting power to the OrangePi Zero you should scann your network using Angry IP scanner. Run the scan and use "Tools - Selection - Dead hosts" to remove unresponsive IP adresses from the list.

depending on the size of your network you might get many IP addresses that are in use on your network.

Connect your OrangePi Zero to the network and give it power. Wait 1-2 minutes and open a new Angry IP Scanner. Redo the test.

If the OrangePi Zero has booted it should now have asked the network for an IP address and we can find it. In my setup it got the IP address

Connecting using Putty

To connect to the OrangePi Zero we use a program called putty. Install it and open it. input the IP address you found in the last step and connect.

You will be asked to accept that the computer you are trying to connect has a self signed certificate. this is just to say okay to.

The default username for Armbian OS is root. The password is 1234

At first logon you must change the root password and create a user account. Just follow the instructions given.

When the user account is created you can start imputing commands. I would start by rebooting the system. This will expand the partition used on the SD card. That way you can fit all the required software.


After restart you can connect again using putty. It is recommended to start by updating the OS. This might take some time. (Run each line of commands by itself)

apt-get update
apt-get update

Setting a static IP adress

It is almost always smart to use a static IP address when running a server. Armbian has a tool that can be used to set a static IP address. Find a free IP address in you network. It might also be smart to put it outside you DHCP's IP range.


choose "Edit a connection" and OK button

choose "Wired connection 2" and press Edit button.

Select "Manual" as shown above and select "Show" as seen below.

Input the IP address that you want your server to use.

When you input the IP address you must also input a subnet mask. My network is a or /24 network. Yours might be different. Here is a page showing conversion between the different formats.


Use putty to connect to your OrangePi using the new IP address.

Set time zone

The OrangePi Zero don't have a real time clock  it must therefor use a time server to get the right time. To set the time zone use the following command.

dpkg-reconfigure tzdata

Installing nginx with RTMP module

Nginx is a webserver that can run on simple machines like the OrangePi. First download dependencies.

sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev

Before continuing it's recommended to switch to your own user (the one you created the first time you logged in). Close putty and start it again using your own username instead of root.

Start by downloading nginx. newest version can be found here.

wget http://nginx.org/download/nginx-1.11.13.tar.gz

Download the RTMP module for nginx

wget https://github.com/arut/nginx-rtmp-module/archive/master.zip

Unzip both files into folders.

tar -zxvf nginx-1.11.13.tar.gz
unzip master.zip  

Enter the nginx folder and build it with the RTMP module

cd nginx-1.11.13
./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-master
sudo make install

The installation is located at (/usr/local/nginx). Start nginx by typing the following command.

sudo /usr/local/nginx/sbin/nginx

You can now test the basic server by using your computers browser and typing in the IP address of you server.

sudo nano /usr/local/nginx/conf/nginx.conf 

Add the following to the end of the file.

rtmp {

        server {
                listen 1935;
                chunk_size 8192;
                buflen 5s;

                application live {
                        live on;
                        record off;

Exit nano (Ctrl x) and save changes.

This config is very simple. There is so much more that can be added. instructions on this can be found here.

Restart the nginx
sudo /usr/local/nginx/sbin/nginx -s stop
sudo /usr/local/nginx/sbin/ngin

You can now test the setup by getting your streaming software (OBS  (free) or X-split).

In the streaming software. Add a custom streaming server.

The URL rtmp://your servers IP/live (mine is rtmp://

Choose a Stream key, I just use "test".

Save changes and try starting your stream. No errors means it works.

To test the stream you can open it in VLC. select media and open network broadcast. input your servers address with the stream key. (mine is rtmp://

Autostart webserver on reboot


sudo nano nginx-passenger.sh

Insert the following command and save the file.


# this script starts the nginx process attached to passenger

sudo /usr/local/nginx/sbin/nginx

sudo chmod +x  /etc/init.d/nginx-passenger.sh
sudo update-rc.d nginx-passenger.sh defaults


CPU load

While testing the streaming system (with a 2,5mbit datastream) with one client wathing the server only uses 5-6 % of CPU and not much memory.

I believe this small server could service multiple clients but there might be problems with stability so testing is a must.