Most content creators on YouTube, Facebook, Twitch, and other live streaming platforms have a common problem. That is how to do 24/7 live streaming without keeping on their machine. This video gives you a better solution for that, not only for 24/7 live streaming, It helps you to multi-stream at once for many platforms such as YouTube and Twitch. You can set any RTMP endpoint.
In the previous video of MineX Tuts Community Forum, we showed you how to run a 24/7 live stream on a terminal. This is a well-organized server with a user interface.
This live streaming server maintains an excellent connection with social media platforms. You can run your live stream smoothly and with minimal latency. Follow all the steps correctly until the end.
Setup VPS Server Ubuntu
You can create this server for free if you can get a VPS. The best solution is the Oracle Cloud platform free tier but you can use any service provider. If you want a cheap VPS provider you can check the below link.
Using any provider, deploy a virtual machine with Ubuntu 18.04 & 20.04, Centos 7 & 8, Mac(Partial). This VPS should have at least 4GB RAM to run the live stream smoothly. You can install this server below this requirement and try to test how it is performed.
Setup 24/7 Live Stream Server
After you deploy the server, connect to the server using SSH and get the terminal. You can use any SSH client you prefer (Putty SSH Client).

Get the super user access by typing this command.
sudo -i
Then update all applications currently installed on the server.
sudo apt update -y
Next, you have to go to the Ant Media Server GitHub community edition page. Copy the link of the zip file that is the latest release of the app. You have to download it to the server, use this command to download the file.
You have to replace the link that marked in red with new Ant Media Sever release.
wget https://github.com/ant-media/Ant-Media-Server/releases/download/ams-v2.4.3/ant-media-server-community-2.4.3.zip
Then you have to download the installation script as well.
wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh
Give 755 permissions to the script file and make sure it is executable.
chmod 755 install_ant-media-server.sh
Ok, now you can run the installation script. First, find the downloaded Ant Media file using this command. It shows you files available in the working directory.
ls

Copy the name of the zip file and paste it at the end of this command (you have to replace the text that marked in red into your downloaded file name). Let’s enter this command to start the installation. This process takes a few minutes.
sudo ./install_ant-media-server.sh -i [ANT_MEDIA_SERVER_DOWNLOADED_FILE]
Now the installation is finished. You have to enter a command that changes IP table settings if you are using the Oracle Cloud. Because they set up an IP table inside the VM instances to prevent connecting it from outside. Enter this command to change it.
iptables -P INPUT ACCEPT && iptables -P OUTPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -F && sudo netfilter-persistent save
Open Firewall Ports on Server
The installation process is over. The next step is to add a few new ports to your server firewall to open them. This process can be changed by the service provider but follow a similar sequence.
Go to the firewall section of your server provider. Add a new rule, and enter this IP range as the source IP address.
0.0.0.0/0

For the destination, you have to enter these TCP ports and UDP ports, then save the rules.
- TCP: 1935 (RTMP)
- TCP: 5080 (HTTP)
- TCP: 5443 (HTTPS)
- UDP: 50000-60000 (WebRTC)
- TCP: 5000-65000 (You need to open this range in only cluster mode for the internal network. It should not be open to the public)
Getting Started with Multi-Stream Server (Ant Media)
Ok, now we successfully finished the installation. You can enter the “Ant Media server” user interface by typing your public IP address (server IP address) of the server at port 5080.
http://serverip:5080
When you enter the Ant Media Server for the first time, you have to create an admin account with credentials.

Log in to the application using the credentials you entered. Ok, this is your dashboard, where you can see your server status.
Let’s see how you can use this application to start a live stream to multiple platforms. Choose one of the default applications. Over Else, you can create a new application using this “New application” button at the bottom of the page.

Create New Live Stream Playlist
After you navigate to the application, you have to create a new playlist for each streaming platform or multiple platforms.
As a demo, I am going to stream YouTube, Twitch, and Facebook at once with a pre-recorded video.

To create a new playlist, click the “New live stream” button, and you will get the dropdown menu. Select the “Playlist”, name it as your wish and there is an option to loop the playlist. If you tick on this option, your playlist will loop an infinite number of times until you stop the process.
Upload Prerecorded Video File to AntMedia Server
You can use an external source to upload your media library or internally on the server. Ant Media Server gives you an option to upload the media files on the server.
You just need to switch to the “VOD” tab and upload the media file. Then click “Upload VOD” and browse your video file. Uploading time depends on the size of the file.
Ok file upload successfully, next you have to create a direct link to this media file. Click the “embed” icon of the video and paste the code into the notepad.
Get the first part of the URL up to the app name, then add “streams” at the end. Next, add the video ID and indicate the file format at last. After that, you can create a direct link to that file using this format (You have to replace the red text with your own credentials.
http://129.126.115.129:5080/LiveApp/streams/799773766444527547108346.mp4

Add Media Files to Playlist
After creating your playlist, you need to add media to the playlist. Click the pencil icon at the right corner. You can add a new playlist item as a URL.

This URL should be a direct link to your media file otherwise it will not play. Here you can add more than one media file which means you can set up a list of media files. It plays every media file, if you set the loop option it keeps on playing.
Create RTMP Endpoint URLs
Ok, now we have to create an RTMP endpoint URL for each platform. They follow a similar format, I will show you an example from Facebook.
Go to the live stream dashboard of your social media platform and get the stream server URL. At the end of the server, the URL adds the stream key. This is your RTMP endpoint URL.
How to Create Facebook RTMP URL
Replace the stream key (marked in red) with your own key.
rtmps://live-api-s.facebook.com:443/rtmp/{stream_key}
How to Create YouTube RTMP URL
Replace the stream key (marked in red) with your own key.
rtmp://a.rtmp.youtube.com/live2/{stream_key}
How to Create Twitch RTMP URL
First you have to select the relevant server based on your location. Visit the Twitch recommended ingest page and get the server link and paste your stream key. Example Twitch RTMP endpoint is below (Phoenix).
Replace the stream key (marked in red) with your own key.
rtmp://phx.contribute.live-video.net/app/{stream_key}
Start Multi Live Streams
Let’s add the created stream address to Ant Media Server. Click the dropdown menu at the right corner of the playlist then select “Edit RTMP endpoints”.
Paste the created URL here. You can add more than one RTMP endpoint here. So I am going to add YouTube and Twitch URLs as well.

Ok, it is finished, you just need to start your broadcast. Click the dropdown menu again next to the pencil icon and press the “Start broadcast”.
Now it is on air, let’s see how it works. You can see that Facebook streaming has started. As well as the YouTube streaming at the same time. Here twitch streamed the video.

Using this self-hosting live stream server you can run your 24/7 music streaming. There are many paid services but this is very easy and you don’t need to spend too much money.
If you have any issue regarding this tutorial ask on the MineX Tuts Community Forum.
Is there a way to set up an automatic overlay that occasionally shows “like/subscribe” reminders over the course of a repeating playlist?
maybe you can try give your pre recorded video “like/subscribe” overlay, because this is just stream your video
try it, and comment if success
I get this error each time I try to install ant media
“package ‘libcrystalhd-dev’ has no installation candidate”
is there a way to fix it?
Thank you
Hi, I’m still waiting for you Tutorial on-
How can we stream Browser Source / URL,
( Like OBS’s Web Source / Stream via URL )
It will published at tomorrow.
brother how to change stream bitrate?
Hi, I’m still waiting for you Tutorial on-
How can we stream Browser Source / URL,
( Like OBS’s Web Source / Stream via URL )
Can you close ant media server and browser while streaming .will it end the stream on youtube
pls answer
Yes you can close the browser after stream start. It will not stop the broadcast.