Try Live Demo

This blog post will help you to enable SSL for Ant Media Server. Enabling SSL is not mandatory for all cases. However,  it’s mandatory when requesting access to the mic and camera. It’s not mandatory for playing streams HTTPS and WSS (WebSocket Secure) are mandatory for Google Chrome to run WebRTC and WebSocket applications.

In addition, developers want to serve their content with a secure connection as well. The script in this post installs the Let’s Encrypt SSL certificate.

Enable SSL - Lets encrypt ssl ant media server

Enable SSL in Linux(Ubuntu)

Go to the folder where Ant-Media-Server is installed. Default directory is /usr/local/antmedia

cd /usr/local/antmedia

If there is a service that uses 80 port, you need to disable it. If your system has Apache Web Server, you need to disable it first such a command below

sudo service apache2 stop

There should be a file in the installation directory. Call the with your domain name

sudo ./ -d script supports external fullchain.pem, chain.pem and privkey.pem files as in the following format



sudo ./ -f yourdomain.crt -p yourdomain.key -c yourdomainchain.crt -d
sudo ./ -f yourdomain.pem -p yourdomain.key -c yourdomainchain.pem -d

If you disable any service that binds to 80 port such as Apache Web Server, enable it again

sudo service apache2 start

Make sure that your domain points to your server’s public IP address in the DNS records

If the above scripts return successfully, SSL will be installed on your server, you can use HTTPS through 5443. Like below

ATTENTION: If port 80 is used by some other process or it’s forwarded to some other port, will not be successful. Please disable the process or delete the port forwarding temporarily before running the script above

That’s all. I hope this small blog post will help you in enabling SSL. By the way, please let us know if you have a question or need help with this issue or any other one.



Categories: Tutorial