Ant Media Server

Install Ant Media Server (Free Community Edition) on Ubuntu 22.04 LTS

2024 Quick Guide

After our recent post regarding setting up the free version of Red5 Media Server on Ubuntu 22.04 LTS, I thought I’d post a quick, no-fluff guide for 2024 to setting up a great alternative that’s becoming increasingly popular – namely, the free, community edition of Ant Media Server (there’s a paid edition too with more features).

Although Red 5 is great for RTMP, Ant is probably a better choice if you’re looking to dip your toes into the waters of something like HTML5/WebRTC. So, without all the explanations here’s a list of commands to get Ant Media Server (free edition) up and running in a few minutes on a fresh install of Ubuntu 22.04 server as “root” (add sudo before each command if you need to):

apt update
apt upgrade

If you run into any prompts on-screen, just hit return to accept the default option(s)

reboot

We now need to log back in and run:

wget https://github.com/ant-media/Ant-Media-Server/releases/download/ams-v2.7.0/ant-media-server-community-2.7.0.zip
wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh && chmod 755 install_ant-media-server.sh
./install_ant-media-server.sh -i ant-media-server-community-2.7.0.zip

In your console, if all has gone well, you should then see the message “Ant Media Server is installed and started.”

Then simply go to http://YOURIPADDRESS:5080 (replace YOURIPADDRESS with your actual IP). Create a new login by filling in the fields with your chosen username/password to get started – The screen should look like this:

The free, community edition of the Ant Media Server looks like this

If you run a firewall, you’ll need to allow on ports 1935, 5080, 5443 & 5554.

Install SSL certificate for Ant Media Server

If you’re serious about streaming with Ant Media Server, you’re going to want to do so over an https encrypted connection to ensure browser compatibility. Fortunately, this is fairly straightforward with Ant as it has its own inbuilt method to help you out. Please be aware that you’ll have to associate the install with an actual domain name that points to your server.

Assuming you’ve just done a standard install as detailed in this post, we need to navigate to:

cd /usr/local/antmedia

Now, we can install our certificate with:

./enable_ssl.sh -d yourdomainname.com

Obviously, you’ll need to substitute yourdomainname.com above with your actual domain name. Also bear in mind that if you’re running an existing web server and run into problems because it won’t install, you may need to stop Apache and Nginx beforehand (to prevent binding on port 80). You can restart them afterwards.

Assuming the SSL cert. install went as planned, you should now be able to log in securely at https://yourdomainname.com:5443/

Happy streaming!