Debian 10/Ubuntu 20.04

If you notice any mistakes that need to be corrected, please reach out on Discord!

MongoDB

Petio supports two ways of connecting to a Mongo Database instance, locally or remote. We recommend the locally hosted MongoDB option.

MongoDB Locally

Make sure to add the correct repository to apt depending on whether you're using Debian or Ubuntu.

  • Import the public key used by the package management system:

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
  • Create the /etc/apt/sources.list.d/mongodb-org-4.4.list file:

Debian 10
Ubuntu 20.04
Debian 10
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
Ubuntu 20.04
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
  • Reload local package database:

sudo apt-get update
  • Install the MongoDB packages:

sudo apt-get install -y mongodb-org
  • Start MongoDB:

sudo systemctl start mongod
  • Verify that MongoDB has started successfully:

sudo systemctl status mongod
  • To make sure MongoDB starts after restart use:

sudo systemctl enable mongod

MongoDB Remotely

  • Register for Atlas here.

  • Create a free cluster.

  • Change the provider or region if you need to. It may take some time to create the cluster.

  • After the cluster is made, click on connect and select MongoDB Compass and follow the instructions on screen.

Installing Petio

  • Create a user for Petio:

sudo useradd -M --shell=/bin/false petio
  • Make a directory for Petio:

sudo mkdir /opt/Petio
  • Download the latest version of Petio:

sudo wget https://petio.tv/releases/latest -O petio-latest.zip
  • Extract Petio to the directory we just made:

sudo unzip petio-latest.zip -d /opt/Petio
  • Change ownership of the directory for Petio:

sudo chown -R petio:petio /opt/Petio
  • Create the petio service with systemd:

/etc/systemd/system/petio.service
[Unit]
Description=Petio a content request system
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=1
ExecStart=/opt/Petio/bin/petio-linux
User=petio
[Install]
WantedBy=multi-user.target
  • Reload systemd:

sudo systemctl daemon-reload
  • Start Petio:

sudo systemctl start petio

Once you've completed theses steps, you can navigate to http://<hostname>:7777 to start configuring Petio.