AVideo is an open-source video hosting platform built on apache/PHP with tons of functionality! You can learn more about AVideo from the links below:
We will be covering how to run AVideo using Docker, Docker-compose, Portainer, and Nginx Proxy Manager. We have an advanced course on how to do this at TrueFreedomTech.com covering multiple configurations and separating data from compute, deploying with git, and more.
We assume you already have a working server with Docker, Portainer, and Nginx Proxy Manager running. We will go over the Dockerfile for AVideo and AVideo-Encoder, the compose for the stack, and configuring Nginx-Proxy-Manager.
The first step in getting AVideo running will be creating your images.
If you are unfamiliar with creating docker images please visit Dockerfile best practices and continue through the whole “Build images” Section. If you would like to learn how we build images please visit TrueFreedomTech.com and check out our course on Dockerfile. This wiki should still be enough to get you up and running if you have a little bit of experience already, advanced users should be able to take what they learn here and adapt it to their own needs.
We are going to be building these images locally on a windows machine running docker and deploying them on the same machine, the same process applies to Linux.
Step 1: Download files from the True Freedom Tech Dockerfile Repo.
Step 2: Open a terminal and cd
into the folder containing the Dockerfile.
Step 3: Run docker build . -t <your-docker-hub-user>/avideo:streamer
You do not have to use your docker hub user but if you want to push this image to docker hub it is a good idea to do so.
Step 4 (optional): Push to docker hub docker push <your-docker-hub-user>/avideo:streamer
.
FROM ubuntu:22.04
RUN apt update && apt upgrade -y && apt install -y software-properties-common
RUN apt clean && apt update -y && apt dist-upgrade -y
RUN add-apt-repository ppa:deadsnakes/ppa
RUN mkdir /HLS /HLS/live /HLS/recorders
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime
RUN DEBIAN_FRONTEND="noninteractive" apt install -y openssl lsof cron nginx supervisor wget sshpass nano net-tools curl php8.1 libnginx-mod-rtmp libapache2-mod-php8.1 php8.1-mysql php8.1-curl php8.1-gd php8.1-zip php8.1-intl php8.1-xml php-common php8.1-cli php8.1-common php-json php8.1-opcache php8.1-readline apache2 apache2-utils mysql-client ffmpeg git libimage-exiftool-perl libapache2-mod-xsendfile python3.9 build-essential make libpcre3 libpcre3-dev unzip htop python3-pip python3-pip libimage-exiftool-perl
RUN apt install -y libssl-dev
RUN service apache2 start
RUN a2enmod rewrite headers expires ssl http2 xsendfile php8.1 && service apache2 restart
RUN cd /var/www/ && git clone https://github.com/WWBN/AVideo.git
RUN mkdir /live-build && cd /live-build && git clone https://github.com/arut/nginx-rtmp-module.git && git clone https://github.com/nginx/nginx.git && cd nginx && ./auto/configure --with-http_ssl_module --with-http_stub_status_module --add-module=../nginx-rtmp-module --with-cc-opt="-Wimplicit-fallthrough=0" && make && make install && cd /usr/local/nginx/html && wget https://raw.githubusercontent.com/WWBN/AVideo/master/plugin/Live/install/stat.xsl && apt install python3-pip -y && pip3 install glances
RUN pip3 install youtube-dl
RUN a2enmod rewrite && service apache2 restart
RUN a2dismod http2
RUN update-rc.d apache2 defaults
COPY apache-config /etc/apache2/apache2.conf
COPY apache-vhost /etc/apache2/sites-available/000-default.conf
COPY nginx-live-adaptive-record.conf /usr/local/nginx/conf/nginx.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY crontab /var/spool/cron/crontabs/root
VOLUME /var/www/AVideo
RUN chmod -R 777 /HLS
RUN mkdir /var/www/tmp
RUN chmod -R 777 /var/www/tmp
EXPOSE 80
EXPOSE 8080
EXPOSE 443
EXPOSE 1935
EXPOSE 8443
EXPOSE 2053
RUN service nginx stop
CMD ["/usr/bin/supervisord"]
Step 1: Download files from the True Freedom Tech Dockerfile Repo.
Step 2: Open a terminal and cd
into the folder containing the Dockerfile.
Step 3: Run docker build . -t <your-docker-hub-user>/avideo:encoder
You do not have to use your docker hub user but if you want to push this image to docker hub it is a good idea to do so.
Step 4 (optional): Push to docker hub docker push <your-docker-hub-user>/avideo:encoder
.
FROM ubuntu:20.04
RUN apt update && apt upgrade -y && apt install -y software-properties-common apt-transport-https
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime
RUN DEBIAN_FRONTEND="noninteractive" apt install -y wget sshpass nano net-tools curl php7.4 libapache2-mod-php7.4 php7.4-mysql php7.4-curl php7.4-gd php7.4-zip php7.4-intl php7.4-xml php-common php7.4-cli php7.4-common php-json php7.4-opcache php7.4-readline apache2 apache2-utils mysql-client ffmpeg git libimage-exiftool-perl libapache2-mod-xsendfile python3.9 build-essential make libpcre3 libpcre3-dev unzip htop python3-pip python3-pip libimage-exiftool-perl
RUN apt install -y libssl-dev
RUN service apache2 start
RUN a2enmod rewrite headers expires ssl http2 xsendfile php7.4 && service apache2 restart
RUN rm -rf /var/www/*
RUN cd /var/www/ && git clone https://github.com/WWBN/AVideo-Encoder.git
COPY php.ini /etc/php/7.4/apache2/php.ini
COPY apache-config /etc/apache2/apache2.conf
COPY apache-vhost /etc/apache2/sites-available/000-default.conf
RUN chown -R www-data:www-data /var/www
RUN pip3 install youtube-dl
RUN update-rc.d apache2 defaults
CMD ["/usr/sbin/apachectl", "-D", "FOREGROUND"]
The next step is our Docker-Compose. We will be deploying this with Portainer.
If you are not familiar with Portainer or Docker-Compose here are the official docs:
Now, without further adieu…
Step 1: Go to Stacks.
Step 2: Click Add Stack.
Step 3: Name your stack (Ex. Avideo).
Step 4: Paste in the contents below (Don't forget to change the image name to your image):
Step 5: Click Deploy the Stack.
![]() |
![]() |
![]() |
#Docker-Compose Version
version: '3.8'
#Apps
services:
#Name of App
avideo:
#Docker image
image: <your-docker-hub-user>/avideo:streamer #(Don't forget to change the image name to your image)
#Docker Network
networks:
- nginx-public
- internal
ports:
- 1935:1935
- 2053:2053
#App Restart Policy
restart: always
#App Data
volumes:
- streamer:/var/www/AVideo
#Name of App
encoder:
#Docker Image
image: <your-docker-hub-user>/avideo:encoder #(Don't forget to change the image name to your image)
#Docker Network
networks:
- nginx-public
- internal
#App Restart Policy
restart: always
#App Data
volumes:
- encoder:/var/www/AVideo-Encoder
#Name of App
db:
#Docker Image
image: mariadb:10.8
#Docker Network
networks:
- internal
#Environmental Variables
environment:
MYSQL_ROOT_PASSWORD: db_root_pass
MYSQL_DATABASE: db
MYSQL_USER: dbuser
MYSQL_PASSWORD: db_pass
#App Data
volumes:
- dbdata:/var/lib/mysql
networks:
nginx-public:
external: true
internal:
external: false
volumes:
streamer:
encoder:
dbdata:
Before we configure our apps, we will set up our domains using Nginx-Proxy-Manager. If you followed our Nginx-Proxy-Manager stack setup you should be able to copy everything we do step by step.
Step 1: Copy the AVideo-Streamer service name.
This should be avideo_avideo
if you did not change the names of apps.
Step 2: Log in to Nginx-Proxy-Manager and create a new proxy host.
Step 3: Enter your Domain name (Ex. Tv.TrueFreedomTech.com)
Step 4: Add the service name to the Forward Hostname / IP at port 80.
Step 5: Enable Cache Assets, Block Common Exploits, and Websockets Support.
Step 6: Click Save.
Step 7 (Optional): Enable SSL (we say this is optional, but you should always have an SSL cert if possible).
Step 1: Copy the AVideo-Streamer service name.
This should be avideo_avideo
if you did not change the names of apps.
Step 2: Log in to Nginx-Proxy-Manager and create a new proxy host.
Step 3: Enter your Domain name (Ex. tv-live-server.truefreedomtech.com)
Step 4: Add the service name to the Forward Hostname / IP at port 8443.
Step 5: Enable Cache Assets, Block Common Exploits, and Websockets Support.
Step 6: Click Save.
Step 7 (Optional): Enable SSL (we say this is optional, but you should always have an SSL cert if possible).
Step 1: Copy the AVideo-Encoder service name.
This should be avideo_encoder
if you did not change the names of apps.
Step 2: Log in to Nginx-Proxy-Manager and create a new proxy host.
Step 3: Enter your Domain name (Ex. Upload.TrueFreedomTech.com)
Step 4: Add the service name to the Forward Hostname / IP at port 80.
Step 5: Enable Cache Assets, Block Common Exploits, and Websockets Support.
Step 6: Click Save.
Step 7 (Optional): Enable SSL (we say this is optional, but you should always have an SSL cert if possible).
![]() |
![]() |
![]() |
![]() |
After setting up your domain name it's time to finish configuring the app. Go to the URL you chose for your application. You should arrive at a screen like this!
(If you do not arrive at a screen like this, something is wrong! Our premium members can open a support ticket Here!)
Step 1: Enter your site URL.
Step 2: Enter the name of your site.
Step 3: Enter your admin account email.
Step 4: Enter your account password.
Step 5: Change DB host to “db” this is reliant on your database container's app name.
Step 6: Enter your db user from environmental variables
Step 7: Enter your db password from environmental variables.
Step 8: Enter the name of your database. avoid spaces, dashes, underscores, etc. You can leave this as is or change it. It is good practice to change it from the default.
Step 9: Install!
After setting up your domain name go to the URL you chose for your application (ex. tv-live-server.example.com/stats). You should arrive at a screen like this!
(If you do not arrive at a screen like this, something is wrong! Our premium members can open a support ticket Here!)
To enable live streaming you need to log in to your AVideo streamer site, go to the AVideo plugins, find the "Live" plugin, install the database tables, activate the plugin, and edit the parameters.
Change the following parameters:
After editing the parameters you will edit the live servers.
![]() |
![]() |
![]() |
![]() |
![]() |
You should have a red live button across the menu bar. Click that.
You will come to a screen like this.
If you are using OBS you will paste the server URL
into the server box
. Paste the Stream Name/Key
into the Stream Key Box
You also need to fill in the Stream Settings below the RTMP settings. Now you are ready to stream!
Live Streams will be auto encoded and added as videos to your streamer site.
After setting up your domain name it's time to finish configuring the app. Go to the URL you chose for your application. You should arrive at a screen like this!
(If you do not arrive at a screen like this, something is wrong! Our premium members can open a support ticket Here!)
Step 1: Enter your site URL.
Step 2: Change DB host to “db” this is reliant on your database container's app name.
Step 3: This is The environmental variable + dbuser from the compose.
Step 4: Enter your db password from environmental variables.
Step 5: Enter the name of your database. avoid spaces, dashes, underscores, etc. You can leave this as is or change it. It is good practice to change it from the default.
Step 6: Enter your Streamer site URL (This should be completed before installing the encoder!)
Step 7: Enter your admin account email.
Step 8: Enter your account password.
Step 9: Install!
This is the basic setup for AVideo, as mentioned at the beginning we have a more in-depth course available at TrueFreedomTech.com.