Skip to main content

RTMP HLS nginx php Server – The easy way





Tired of paying for Wowza media server? Unreal media server?
Tired of trying to find a decent tutorial on how to build your own nginx rtmp server with php and hls support?
UPG.GR has the solution for you with a few easy steps (as usual)
*Note that a referral link to digital ocean is included in this article that will grant you 10$ of credit to try for free with no obligations

If you are an advanced linux user and have your own linux box, just run the following command on any Ubuntu and your done! : curl -sL | sudo bash –

Step 1
Go to digital ocean and get a free account with 10$ credits (to use for a month)


Step 2

Enter your email and select a password



Step 3

Activate your account and login to get your free credit



Step 4

Create a new droplet


Step 5

Select the 10$ a month droplet. This will be enough for testing and for about 100 concurrent users. Enter the subdomain of a domain you control For example if you have a domain enter “”. If you do not have domain just enter there whatever and you will access your server with the ip you will be provided.


Step 6

Select a country near you.


Step 7

Select your favorite UBUNTU distro. Watch this space for a Centos tutorial – request it in the comments and I ll do it for you.


Step 8

Create droplet :


Step 9

Wait for your droplet to be created


Step 10

Check your email for your login credentials


Step 11

In the meantime go your registra or dns server to map the subdomain you chose to the ip of the server you got in your email. In my example I am using the free tier of cloudflare to manage my dns (


Step 12

Go back to digital ocean and start the console (or just putty to the ip on port 22 and authenticate)





Step 13

Login using the credentials you are provided in your email


Step 14

Enter “sudo -s”


Step 15

Enter “sudo apt-get install curl -y”

Enter “curl -sL | sudo bash -”


Step 16

Your server is up! you can test it on the address you specified. Port 80 and 1935 is open. port 80 for the player port 1935 for the streaming. You may stream using Adobe Media Encoder (free). Remember to use the h.264 codec and not the default VP6 !


Connect and start streaming

Step 17

Test your streamer by visiting the main interface on the subdomain you defined or the ip address you were provided. I have prepared 5 streams. stream1,stream2,stream3,stream4,stream518

Step 18

Review my github projects where you can find all the source code for this project.

There are 3 projects :   –  Automation – Fork of the latest working nginx server (1.9.2) – Latest fork of the rtmp module for nginx

You can edit the nginx.conf to suit you needs at : /usr/local/nginx/conf/nginx.conf

You can find the html files that show the web interface at : /usr/local/nginx/html


To do :

Web administration for nginx.conf options
Ftp server to edit the php files

Please comment here to encourage me to continue with this project.

Canada Business Directory

Have a look at my new project :

This is a full Canadian Business Directory. The database is one year old and is derived from the official gov website. More than 1 million records are included in this database and this website is a way to interact with all this data-set.

Some of the services offered by this project are :

  • Purchasing of the current dataset
  • Purchasing of corrections to existing data

This project is made using php/mysql and some simple functions to query and filter the results securely. Importing the data was quite challenging as they came in a CSV file. After trying for ages to find the best way to import such a file to mysql, I ended up importing it using windows ODBC and ms access. If you need more information on that, I will be happy to help or create a mini guide on that 🙂

I will also be happy to provide you with the full source so that you can run a similar project, if you request it nicely in the comments.

Playing rtmp streams on a webpage

I don’t understand why there is no opensource way of playing an rtmp stream on a webpage using any of the free opensource players.

The only options available seem to be the flowplayer with a watermark and jwplayer again with a watermark. Then some others have released similar players with watermarks (again). Only premium versions seem to be able to play rtmp streams without watermarks. This is crazy.

Anyway, here is a way to create your own streaming player for the web with no watermarks and top quality for your streams. Soon I will be releasing a totally opensource project on Github about this..

So following my example you will be creating a flash rtmp player.

Just head to Adobe and download a trial version of Flash Builder. At the time of this post the version was 4.6

Install as usual, sign in with a free adobe id to activate the trial and create a new MXML application. Just use all the defaults!

Edit the main.mxml file and add something like this :


<s:VideoPlayer id="vidPlyr"
left="100" right="100"
top="100" bottom="100"
horizontalCenter="0" verticalCenter="0"
<s:DynamicStreamingVideoSource host="rtmp://" streamType="live">
<s:DynamicStreamingVideoItem streamName="stream" />



Go to Project – Export Release Build

Go where the project is and get the bin-release folder contents and upload them to your server. If you used all the defaults you will be able to access the video page at

You are done!!! Here is your watermark free rtmp streaming player. I believe you get the point and you can start renaming things as needed and adding code to fallback to mobile etc.

Watch this space for a full fallback player that I will be releasing soon. Comment here and I’ll release it sooner 🙂


Connectwise Analytics

This project was done on my spare time mostly, for the company I work for. It digs into the connectwise and labtech databases pulling interesting data, presenting them in a nice jquery way. Ideal for your NOC board monitors or your management executive boards / meetings.

Here are some screenshots (company names and technicians’ names are blanked :

I am tempted to release this as opensource. I would love to get some beta testers. The only thing you need to run it on your server is php,mssql extensions and a read only user for labtech and connectwise (or only connectwise.) All configuration is done on a single config file.


GreekTV for ROKU

This is the ROKU application all Greeks abroad were waiting for!

Have you seen all those expensive services with monthly prices up to $40 ? Well this one is only $2.99 and you get all the major channels plus some other minor ones.

There is a Lite (ad supported) version here :  (Canada, UK)

There is a paid (no ads) version here : ($2.99 a month only) (Canada, US, UK, Rest of the World)

You can also add the above by just searching in the Roku channel store for “GreekTV”

I would really love to hear your feedback or suggestions for this project. I am also running a facebook page for it :

You will be needing a Roku Player for this to work :