Forums How to host rtmp servers: Android


Viewing 1 post (of 1 total)
  • Author
  • #74
    Donald BiltonDonald Bilton

    How to create an rtmp server with android. There are several ways to approach this issue. I will focus on a terminal based solution using termux terminal emulator located in the android app store. We will then fetch the tools and configurations required to become an rtmp server.

    1. Download termux (terminal emulator) in the android app store and launch the application.No rooting is required.

    termux home screen

    2. Auto scripts are in development through github

    Please visit for more information.

    3. Copy and paste the commands into termux. Include the () in the code snippet

    pkg install proot-distro screen -y
    proot-distro install alpine 
    proot-distro login alpine)

    4. The terminal should go through the process
    of updating termux, fetch a copy of alpine
    and download the RTMP server’s dependencies.
    Now we need to update Alpine Linux and install the rtmp
    server dependencies. Include the parenthesis in
    copy paste.

    (cd /home; apk update; apk upgrade
    apk add git bash screen openssl
    git clone --depth=1 -b Alpine --single-branch
    cd tollstream-RTMP-server
    chmod +x

    tollstream script provides free(free works well for small scale servers) and paid accounts through Tollstream is not affiliated with Ngrok. We use Ngrok’s reverse proxy to assist people in port forwarding issues. (Behind firewalls they can’t configure,routers or other, non administrative restrictions. )

    5. Please visit if your are behind nat firewalls that you either don’t have the administration rights to configure, the know how, or the patience. You will want to register for free with Ngrok also let’s you monitor your connections and blacklist ips etc and add other ips to your whitelist such as friends. The free version works for 4 connections from the outside world, and there are paid versions that have no restrictions.

    6. After registration, you will enter the authkey into the terminal to register it with the servers automated script. From that point on, ngrok will be the one giving you urls that are accessible from the internet. You will be accessible from the web from that url. The automated install script will list that url that is accessible from the internet. The automated script then takes your url and username of tollstream, encrypts it, and sends it to for e-commerce assistance.
    ngrok authkey

    ngrok home screen

    Your authkey will be saved in your server and will only need to be entered once.

    7. Your server should be set up and the automated script should list several urls. You should make note of these urls, depending on your desired configuration. I will attempt to explain what these urls mean and how they will be used.

    tollstream rtmp urls

    A) You will receive a url that is accessible from the web if port forwarding was successful. If you port forwarded ,yourself ,and are having connection problems from the outside web, please check to see if you have configured your firewalls properly to port forward tcp 1935.

    B) You will receive a url that was issued from that points to your public ip address and rtmp server. This would be the same as if someone typed in your public ip and attempted to access your server, except it allows for port forwarding behind networks that are not configured for port forwarding.

    C) You will receive a url that assumes that you are running broadcasting software on the same machine as the server is located. This is the url that is considered localhost looking like rtmp://localhost:1935/(app)/(stream key)
    Or rtmp:// key)

    D) you will receive a url that includes your private ip address of your server so that other devices such as cameras, sell phones, or other networked devices can send their information to the server from within you own network. This means devices that are connected to the same router but have been issued separate private ip. (Every device connected to the same router has a separate private ip and, typically, share the same public ip that is issued by your internet service provider.

    Example. I have tollstream rtmp server set up on my laptop but I want to use my cell phone that is on the same wifi to send live video to my server.

    8. To test if your rtmp server is working, you can download larix broadcaster in the app store at :

    You may use any other streaming application such as obs studio but it will be your job to learn the format and settings.

    9. In order to test your nginx, rtmp, server to see if your video streaming is working, properly, please go into the settings in larix broadcaster. Then select connections. Create a new connection.

    larix settings

    The format that will be expected is rtmp:// where name_publish Example: rtmp://
    Save the setting.
    * name_publish is expected streamkey in your broadcasting software, as your server issues you a non replicatable and dynamically updated stream key every time you spawn a server.
    streaming url larix

    You will also want to go into advanced setting in larix in the main settings screen. Please check the box next to background streaming. This will allow larix to continue broadcasting your chosen camera, regardless if the app is in the foreground or not. Larix will need to be restarted to apply the settings.

    10. In order to see if your broadcaster and nginx,rtmp,server is working, you should download vlc media player from:

    11. Return back to the main screen of larix broadcaster until you see video of your camera and a red button to start streaming. Push the red button. You should see a bit rate being uploaded equal to the bitrate that larix has in it’s settings for your connections video. That can be altered by going into your connections video settings. If it remains at zero bits, there is a problem communicating with the nginx,rtmp, server installed through termux.

    After install, launch vlc and Click the three horizontal lines icon known as settings in vlc. You will select stream and paste your larix connection settings that was in the format of rtmp://
    Because tollstream’s server script issues you a ever changing, dynamically updated, streamkey that is non replicatable for privacy purposes, saying name_publish as your stream key in your broadcasting software allows the streamkey to remain non updated in the broadcasting software. However, the script is aware of your dynamically updating stream key that the server creates every time a new server is launched. This makes updating your streamkey unecessary on your broadcasting software. But your server understands that you have a non replicatable streamkey that is issued by openssl. This keeps your stream private from eaves droppers. But gives you the convienance of not having to conatantly update it in your broadcasting software.

    You should see your stream being played in vlc if all is going well.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.