With your own streaming server, you have complete control over how your content is delivered. Using a web server, this is easy to achieve thanks to the HTTP Live Streaming (HLS) protocol and HTTP streaming.

Key Takeaways

  • HTTP Live Streaming (HLS) splits a stream into small chunks that are delivered over HTTP, so the stream can be embedded in a website.
  • Small projects need little hardware; a fast con­nec­tion in a pro­fes­sion­al data centre matters most.
  • For very low latency, Low-Latency HLS or WebRTC are al­tern­at­ives.
  • The tutorial sets up NGINX with the RTMP module on a Windows server, con­fig­ures RTMP and HTTP, and opens ports 1935 and 80.
  • You send the stream with OBS or FFmpeg and play it on your website with Video.js.
Free VPS Trial
Try a virtual server risk-free for 30 days

Try out your VPS for 30 days. If you're not satisfied, we'll fully reimburse you.

How does HTTP streaming work?

Ori­gin­ally developed by Apple for its own devices, HTTP Live Streaming (HLS) is now one of the most widely used protocols for streaming au­di­ovisu­al media on the internet. Because trans­mis­sion takes place over HTTP, one of the core tech­no­lo­gies of the internet, HLS works across many devices and platforms. In modern browsers, playback often relies on JavaS­cript-based players, while some systems, including Apple devices, support HLS natively.

With HLS streaming, the con­tinu­ous data stream is divided into small chunks. The end device downloads these chunks quickly and puts them back together during playback. This enables fast trans­mis­sion and, in the best case, viewers do not notice that the stream has been split into separate parts. To make sure the video is assembled correctly, HLS also uses an index file. This file tells the end device the order in which the chunks should be played.

This seg­ment­a­tion has another key advantage, which is that the video quality can be adjusted during playback without reloading the entire stream. The next chunk is simply loaded in a higher or lower quality, depending on the available con­nec­tion.

Another major benefit of HLS streaming is that you can integrate the stream into your own website. With HTML5, you can embed a suitable player and display the stream directly on your site.

Note

In addition to HLS streaming, there is also the Real Time Messaging Protocol (RTMP). Although RTMP has become less important in recent years due to the dis­con­tinu­ation of Adobe Flash, it is still relevant for custom streaming setups. You also need the protocol when setting up an HLS server. If you do not want to embed your stream on a website, creating only an RTMP server may be a suitable al­tern­at­ive.

What do you need your own streaming server for?

Streaming is becoming in­creas­ingly popular, and not only because of film and TV platforms like Netflix or Amazon. Private in­di­vidu­als and small busi­nesses are also re­cog­nising the potential of live streaming. For companies, broad­casts can be par­tic­u­larly useful for product launches, for example. Webinars and workshops can also be held via streaming.

Note

HTTP Live Streaming was ori­gin­ally developed for broad com­pat­ib­il­ity, but it usually comes with a com­par­at­ively high delay of around 6 to 30 seconds between the live event and playback. This is due to the segment-based trans­mis­sion used in HTTP streaming. Low-Latency HLS (LL-HLS) has since been developed to sig­ni­fic­antly reduce latency in live streaming, typically to around 2 to 3 seconds, while pre­serving the broad device and player support as­so­ci­ated with HLS.

What hardware do you need for HLS streaming?

To set up a suitable server solution, you first need to un­der­stand the hardware re­quire­ments for reliable HLS streaming over HTTP.

Processor per­form­ance (CPU)

If the streaming server is used only to dis­trib­ute the data stream, you do not need much pro­cessing power. For small projects, two cores with around 2 GHz each are usually suf­fi­cient. To handle higher demand as your project grows, 4 CPU cores are re­com­men­ded.

Memory (RAM)

RAM is primarily used for caching during streaming. For simple tests or very small projects, 2 GB of RAM and a few CPU cores may be enough. In practice, however, you should plan for sig­ni­fic­antly higher resources, es­pe­cially if you expect multiple sim­ul­tan­eous viewers or need transcod­ing.

Storage (HDD/SSD)

You need very little storage space for the server files them­selves, as a web server is generally light­weight. 10 GB may already be suf­fi­cient. However, fast SSD storage is re­com­men­ded to avoid creating a bot­tle­neck. Most storage re­quire­ments come from the video files you want to keep on the server. If you record your stream on the server’s hard drive, you will therefore need sig­ni­fic­antly more storage space.

Bandwidth

A fast con­nec­tion is the most important re­quire­ment for streaming. To prevent poor image quality or long loading times, the available bandwidth must always be suf­fi­cient. The amount of data the server in­fra­struc­ture needs to transmit depends on the video quality and the number of viewers. A home internet con­nec­tion is usually not enough, so for reliable HTTP streaming and HLS streaming, you should run your streaming server in a pro­fes­sion­al data centre.

Note

For scenarios where the delay between the live event and playback needs to be es­pe­cially low, such as video con­fer­ences, mul­ti­play­er gaming, or in­ter­act­ive streams, WebRTC is often used as an al­tern­at­ive. WebRTC is a real-time trans­mis­sion protocol that enables sub-second latencies but comes with different in­fra­struc­ture re­quire­ments and scaling strategies compared with classic HTTP streaming and HLS streaming.

How to host an HLS streaming server with IONOS

IONOS offers various server solutions:

  • Dedicated server: dedicated hardware with AMD or Intel pro­cessors and per-minute billing
  • vServer: high-per­form­ance vir­tu­al­isa­tion for in­de­pend­ence and security

The servers differ not only in their spe­cific­a­tions, but also in their billing model. A vServer comes with fixed monthly costs, while dedicated servers are billed by the minute, so you can de­com­mis­sion them when you no longer need them and stop incurring costs.

How to set up a streaming server step by step

You can set up your own HTTP Live Streaming server in just a few steps. The required software is freely available on the internet. In this example, we use a Windows server with NGINX software.

Note

Modern streaming setups often rely on spe­cial­ised streaming servers, such as SRS or MediaMTX, or on CDN solutions. The NGINX RTMP setup shown here is mainly suitable for testing, small projects, or learning the basics of HTTP streaming and HLS streaming.

Step 1: Establish a server con­nec­tion

To work on your server, you first need to connect to it. With IONOS, log in to your user account and open the Cloud Panel, which you can find in the ‘Server & Cloud’ section. Under ‘Remote Desktop con­nec­tion’, you’ll find a download link for the con­nec­tion file.

On Windows, double-click the down­loaded file to open the ‘Remote Desktop Con­nec­tion’ program. Then enter the password, which is also available in the Cloud Panel. A window will open and display the server’s desktop.

Image: IONOS Cloud Panel with information about the remote desktop connection
In the IONOS Cloud Panel, you’ll find in­form­a­tion on how to establish a con­nec­tion to your future streaming server.
Note

Even if you don’t use a Windows PC, you can of course establish a con­nec­tion to the server. However, you may need ad­di­tion­al remote desktop software. On Linux systems such as Ubuntu 24.04, you can also establish an SSH con­nec­tion.

Step 2: Install NGINX

For HTTP streaming, you use a standard web server based on NGINX. Since the default version of NGINX does not include the RTMP module required for streaming, you either need a specially pre­con­figured NGINX version with an in­teg­rated RTMP module or you must compile the module yourself. Al­tern­at­ively, you can use ready-made Windows builds that already include RTMP.

Unpack the software package to a location of your choice. Then open the Windows Command Prompt or Windows Power­Shell and navigate to the newly created NGINX folder. Start the web server with the following command:

start nginx
batch

You won’t notice any changes at first. To check whether the server is running, open your own IP address in a browser. You should then see a message from the web server. At this stage, only the web server itself is active. The streaming func­tion­al­ity is only enabled by the con­fig­ur­a­tion in the next step.

Step 3: Adjust the con­fig­ur­a­tion

In the next step, adjust the web server con­fig­ur­a­tion. In the cor­res­pond­ing folder, you should find the nginx.conf file. Add the following RTMP section at the end of the file:

rtmp {
server {
listen 1935;
chunk_size 4000;
application show {
live on;
hls on;
hls_path C:/nginx/hls/;
hls_fragment 3;
hls_playlist_length 60;
deny play all;
}
}
}
nginx
Note

On Windows, make sure the specified path actually exists and can be written to. As shown in the example above, use forward slashes (/) instead of back­slashes (\) and adjust the path to match your in­stall­a­tion directory.

You can choose the path for your HLS stream yourself. The name of the application (here show) is also entirely up to you. The only important thing is that you continue to use this con­fig­ur­a­tion con­sist­ently in other places.

You also need to extend the existing HTTP settings in the already present http {} block of the con­fig­ur­a­tion file:

http {
include       mime.types;
default_type  application/octet-stream;
sendfile        off;
server_names_hash_bucket_size 128;
## Start: Timeouts ##
client_body_timeout   10;
client_header_timeout 10;
keepalive_timeout     30;
send_timeout          10;
keepalive_requests    10;
## End: Timeouts ##
server {
listen       80;
server_name  localhost;
location /hls {
add_header Cache-Control no-cache;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /nginx/;
}
}
}
nginx
Note

Make sure you do not create a second http {} block. NGINX con­fig­ur­a­tion files usually include this section by default. You only need to add or adjust the settings shown above within the existing block.

Save the file and restart the web server. The easiest way to do this is to stop the NGINX process or processes in Task Manager and then start the server again using the command.

Step 4: Open the port

To make your stream ac­cess­ible, you need to open the required ports. With IONOS, you can do this in the Cloud Panel. In the firewall settings under ‘Network’, create a new entry and open TCP port 1935. For HTTP streaming, you should also open port 80 if it is not already open on your server. These are the same two ports you pre­vi­ously entered in the NGINX con­fig­ur­a­tion file.

Image: Open port in the IONOS Cloud Panel
Open the cor­res­pond­ing ports so that the trans­mis­sion can work.

Step 5: Start HTTP Live Streaming

For a live stream, you also need suitable software. A popular choice among streamers is Open Broad­caster Software (OBS). There, you enter the server address and a stream key:

Server:
rtmp://<IP address>/show

Stream key:
test
text

At this point, enter the server’s IP address. IONOS customers can find it in the Cloud Panel, for example. For testing, you can also enter localhost instead of the IP address. The stream key you choose also de­term­ines the name of the generated HLS streaming files. In this example, the stream is available at /hls/test.m3u8.

Note

In many streaming tools, the server address is entered sep­ar­ately from the stream key. Make sure you configure both correctly.

In addition to tools like OBS, you can also send your stream directly to the server with FFmpeg. FFmpeg handles both the encoding and the trans­mis­sion of the video stream. This is es­pe­cially useful if you:

  • want to create automated streams
  • want to process your own video sources
  • want to generate multiple quality levels

A simple example:

ffmpeg -re -i input.mp4 -c:v libx264 -c:a aac -f flv rtmp://<IP address>/show/test
bash

The input video is converted into a format suitable for streaming and then sent to the RTMP server.

Step 6: Embed the stream on your website

You can now access your stream with a media player such as VLC. However, HLS streaming also lets you make the stream available through a website. To do this, adapt an existing website or create a new HTML document. The NGINX web server already includes an HTML document called index.html. Add the following source code there:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HLS</title>
<link href="js/video-js.css" rel="stylesheet">
<script src="js/video.min.js"></script>
</head>
<body>
<div style="text-align: center;">
<video-js id="live_stream" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" autoplay width="1280" height="720" poster="/poster.jpg">
<source src="/hls/test.m3u8" type="application/x-mpegURL">
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that
<a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p>
</video-js>

<script>
var player = videojs('live_stream');
player.play();
</script>
</div>

</body>
</html>
html

This basic website only displays the Video.js player with your stream. If you want to make the stream available to other users, you should add more content and improve the design, for example with CSS. Al­tern­at­ively, you can integrate this section into an existing, well-designed website. The important point is that the path to the video files is correct, for example: <source src="/hls/test.m3u8" type="application/x-mpegURL">. If you rename folders or files, you also need to update the path here.

For the player to work, you also need the Video.js files video.min.js and video-js.css. You can find them in the release package of Video.js 8 (the code shown here is for Video.js 8, not for the newer Video.js 10). Place them in a subfolder named js in the same directory as the HTML document. The website will then display a video player with your stream.

Reviewer

Go to Main Menu