- Install the dependencies
- Clone the repository
- Configure the server
- Build the server
- Run the server
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
# Install Docker:
sudo apt-get install git docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugingit clone https://github.com/ThomasChourret/RTMPS-docker.git
cd RTMPS-docker- Set your keys in the keys.txt file. To generate keys, you can use the following command:
python3 -c "import secrets; [print(secrets.token_urlsafe(32)) for _ in range(10)]" >> keys.txt- Set allowed IP addresses to play the stream in the ips.txt file.
- Set your SSL certificate in the ssl directory.
mkdir ssl
cp /path/to/your/certificate.crt ssl/server.crt
cp /path/to/your/private.key ssl/server.keydocker build -t secure-rtmps-server .docker run -p 443:443 secure-rtmps-server- To stream to the server, use the following URL: rtmps://your-server-ip/live (Don't forget to specify the key in the stream settings)
- To view the stream, use the following URL: rtmps://your-server-ip/live/key
Replace your-server-ip with your server's IP address and key with the key you set in the keys.txt file.
Example of configuration in OBS Studio : https://prnt.sc/IeOOzgyZ5pXf