GigHive Music and Video Library
GigHive is an open-source deployment framework for hosting your own media library, a band’s library or fan videos, or even videos uploaded by guests from events like a wedding. There are two pieces to Gighive:
- A pre-built web-accessible media library waiting to be populated. This is the server piece. Gighive uses Ansible and Terraform to build a vm and on top, a fast Apache server and MySQL database. It includes a few audio and video clips donated from one of our other users as a sample.
- Companion iPhone app for fans and wedding guests to upload content (web-based upload also built-in).
The automation spins up a fully reproducible environment using Docker, Ansible, and Terraform. It has a very simple interface: a splash page, a single database of stored videos and an upload utility.
This project is designed to be portable, easy to deploy, and suitable for local development or cloud environments (Azure supported out of the box).
Components
- Ansible Control Machine: Tested on Ubuntu 24.04 or 22.04, so the requirements are any flavor of Ubuntu or Pop-OS 24.04 or 22.04, installed on bare metal. Virtualbox implementation assumes Control Machine would also be home to your Virtualbox VMs.
- Target Server: Your choice of Virtualbox or Azure deployment targets for the vm and containerized environment.
- Default vm size is 64GB, ~10GB of which will be used by the OS (configurable in ansible/group_vars).
- You will have ~54GB for media files.
- Docker will be installed to that VM. Bind mounts used for config files and media files. Check Dockerfile for exact specs.
Software Prerequisites
Software needed for either option, Virtualbox or Azure:
- Ansible, Python and git will be installed. More detailed listing here.
- An id_rsa.pub file is needed for passwordless authentication into the Gighive server.
For Virtualbox installations, Virtualbox will be the additional component installed.
For Azure deployments, az and azure-cli will be installed.
Architecture (logical)
Click the diagram above to view full size
- Gighive runs very efficiently on an Orange Pi 5 or GMKtech mini PC. Stuff a few NVMe’s in either and you’ll have plenty of storage for your videos. We’ve tested on both of them.
- Note that both cpu architectures are supported: amd64, arm64
Secrets and Default Passwords
GigHive ships with example credentials to make first-time setup fast and simple.
These defaults are for local/demo use only and must be changed before any
Internet-exposed or production deployment. You will see a step for this below.
⚙️ Prerequisites: Install Ansible and Python to your controller machine.
- Decide where you will install Ansible as the controller and what target vm (virtualbox or Azure) will be the Gighive server.
- If you are going to install on a virtualbox VM, find an open IP address to use in your network.
- If you are going to install to Azure, Azure will provision an IP for you.
- In a later step, you will add that IP to the appropriate variable in the Ansible inventory file.
- See Ansible core files discussion for more info on how Ansible’s configuration works .
- Log onto that server and install Ansible:
sudo apt update && sudo apt install -y pipx python3-venv git
pipx ensurepath
-
Log out.
- Log back in and install Ansible.
pipx install --include-deps ansible
ansible --version # Should be 2.17.2 or higher
- Clone the repo from your desired location (usually /home/$USER).
- The repo has some sample media files, so it’s about 690MB in size.
- Takes a few minutes to download on an average connection.
git clone https://github.com/gighive/gighive
- In whatever directory you have installed gighive, set the GIGHIVE_HOME variable and test to see if it’s correct.
- Example: GIGHIVE_HOME is located in user’s home directory.
export GIGHIVE_HOME=/home/$USER/gighive
echo $GIGHIVE_HOME
cd $GIGHIVE_HOME
- Add GIGHIVE_HOME export to your .bashrc.
echo "export GIGHIVE_HOME=/home/$USER/gighive" >> ~/.bashrc
cat ~/.bashrc
- Make sure you have id_rsa.pub in ./ssh for passwordless authentication.
- Update the secrets to your desired credentials. Copy the example file and then edit the destination to your liking:
cd $GIGHIVE_HOME
cp ansible/inventories/group_vars/gighive/secrets.example.yml ansible/inventories/group_vars/gighive/secrets.yml
⚙️ Option A: Gighive as a virtualbox VM. Install Gighive as a vm on your Ansible controller machine.
- From $GIGHIVE_HOME, Install Virtualbox using Ansible.
- Default shown below is the virtualbox install.
- install_virtualbox=true will be set in the below Ansible command.
- The script will ask for your sudo password, so enter it in when prompted.
cd $GIGHIVE_HOME
ansible-playbook -i ansible/inventories/inventory_bootstrap.yml ansible/playbooks/install_controller.yml -e install_virtualbox=true -e install_terraform=false -e install_azure_cli=false --ask-become-pass
- When the script finishes, it will prompt you to reboot.
- Hit “enter” to stop the script and then reboot.
- Verify the installation.
cd $GIGHIVE_HOME
ansible-playbook -i ansible/inventories/inventory_bootstrap.yml ansible/playbooks/verify_controller.yml -e target_provider=vbox -e install_virtualbox=true -e install_terraform=false -e install_azure_cli=false
- After finishing, you should see a green checkmark and the words “All prerequisites verified successfully!” at the bottom of the Ansible output. Otherwise, redo the steps above.
- In the inventory file below, set the “ansible_host” variable to the IP address to the IP address you decided upon in the Prerequisites.
vi ansible/inventories/inventory_bootstrap.yml
- Execute the Ansible playbook that will install Gighive.
ansible-playbook -i ansible/inventories/inventory_bootstrap.yml ansible/playbooks/site.yml --ask-become-pass
- If the previous step ran without error, CONGRATULATIONS!! You’ve installed Gighive!! Now access it in a browser:
https://<ansible_host IP from earlier step>
OPTIONAL: It is helpful to set an alias in your .bashrc to access the vm you’ve created so you can check it out.
alias gighive='ssh ubuntu@<ansible_host value found in ansible/inventories/inventory_bootstrap.yml>"
Option B: Gighive as an Azure VM. Install Gighive on Azure (requires an Azure subscription).
Make sure prerequisites from above are installed.
- You will need at minimum an Azure Standard tier subscription to run this.
- This will not work with a free subscription.
- The default vm size is Standard_B2ms, a basic, cost-effective vm.
- Export Azure Vars (as noted at top of 2bootstrap.sh)
export ARM_SUBSCRIPTION_ID=[put your subscription id here]
export ARM_TENANT_ID=[put your tenant id/mgmt group id here]
or, if you have azure.env configured with these exports, just:
- Provision infrastructure. Run ./2bootstrap.sh. Watch for and respond to these prompts:
- apply Terraform plan
- update the ansible inventory file
- run the ansible build
- If Step 2 ran without error, CONGRATULATIONS!! You’ve installed Gighive!! Now access it in a browser:
https://<ansible_host IP captured from the output of the install or the inventory file>
OPTIONAL: If you’re finished with the VM, delete all resources in Azure
cd $GIGHIVE_HOME;./3deleteAll.sh
⚙️ Setup & Installation
- Once installed, there will be a splash page, a link to the database and a link to the uploads page. Simple!
- Default install will populate the database with ~10 sample video and audio files. These can be deleted later with database reset procedure.
- There are three users:
- viewer: Viewers can view media files, but can’t upload.
- uploader: Uploaders can upload and view media files.
- admin: Admin can view and upload files and change passwords.
- Default passwords are set in $GIGHIVE_HOME/ansible/inventories/group_vars/gighive.yml and should be changed.
- Admin utility: a page for the admins to reset default password in GUI as well.
📂 Repository Structure
├── 1prereqsInstall.sh
├── 2bootstrap.sh
├── 3deleteAll.sh
├── ansible
│ ├── inventories
│ │ ├── group_vars
│ │ ├── inventory_azure.yml
│ │ ├── inventory_azure.yml.j2
│ │ ├── inventory_baremetal.yml
│ │ └── inventory_virtualbox.yml
│ ├── playbooks
│ │ └── site.yml
│ ├── roles
│ │ ├── base
│ │ ├── blobfuse2
│ │ ├── cloud_init
│ │ ├── cloud_init_disable
│ │ ├── docker
│ │ ├── mysql_backup
│ │ ├── nfs_mount
│ │ ├── post_build_checks
│ │ ├── security_basic_auth
│ │ ├── security_owasp_crs
│ │ ├── validate_app
│ │ └── varscope
│ └── vdiLockedWriteDelete.sh
├── ansible.cfg
├── assets
│ ├── audio
│ └── video
├── azure.env
├── azure-prereqs.txt
├── CHANGELOG.md
├── docs
│ ├── index.html
│ ├── PREREQS.md
│ └── README.md
├── inventory.ini
├── terraform
│ └── variables.tf
└── tree.txt
License
GigHive is dual-licensed:
- AGPL v3 License: Open source, free for personal use with strong copyleft protection for use as a SaaS.
- Commercial License: Required for SaaS, multi-tenant, or commercial use without AGPL obligations.
🤝 Contributing
Contributions welcome! Please open issues and pull requests.
👉 Contact us for commercial licensing or for any other questions regarding Gighive. 