Skip to content

Scripts

taylorbourne edited this page Mar 3, 2021 · 5 revisions

Setup/Installation

These scripts will help with getting things setup/installed

Ubuntu – Setup Docker, xteve_lazystream, and Plex

This script will setup Docker, this container, and Plex in an Ubuntu environment. Submitted by @nexxai


# Setup Docker
## Clean up old docker stuff
sudo apt-get remove docker docker-engine docker.io containerd runc

## Install pre-reqs
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

## Setup the repo
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

## Install Docker packages and configure the plexnet network
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

## Configure the Docker bridge network so that inter-container name resolution works
## because the default bridge network does not allow this
sudo docker network create --driver bridge plexnet


# Configure xTeVe and start it
git clone https://github.com/taylorbourne/xteve_lazystream
cd xteve_lazystream
mv sample.env .env
sed -i 's/\#quality/\quality/g' .env
sudo docker run -d --name=xteve_lazystream -p 34400:34400 -e TZ="America/Edmonton" --env-file=.env --log-opt max-size=10m --log-opt max-file=3 -v /mnt/user/appdata/xteve/.xteve:/xteve:rw -v /mnt/user/appdata/xteve/config/:/config:rw -v /mnt/user/appdata/xteve/guide2go/:/guide2go:rw -v /mnt/user/appdata/xteve/playlists/:/playlists:rw -v /tmp/xteve/:/tmp/xteve:rw --restart always --network plexnet taylorbourne/xteve_lazystream


cd ..

# Start Plex
sudo docker run -d --name=plex -e PUID=1000 -e PGID=1000 -e VERSION=docker --restart always -p 32400:32400 --network plexnet ghcr.io/linuxserver/plex


echo "Manual Setup Instructions"
echo "#########################"
echo "1. Ensure port 32400 is allowed in to the droplet/VM. For DigitalOcean, this means setting up a firewall in the Networking section.  For AWS, this means setting up a Security Group.  For Azure, this would mean a Network Security Group."
echo "Note that if you decide to limit the inbound traffic (this is definitely suggested if you have a static or rarely changing IP), when configuring your Plex server, 'Remote Access' may show that it's in accessible by way of a red exclamation mark.  This does not necessarily mean that it isn't accessible for these purposes.  If you run into connection issues, it may be worth removing the IP restriction on the firewall/SG/NSG to troubleshoot, but a red exclamation mark is not conclusively a bad thing."
echo "2. Start a temporary local port forward using: ssh -L 32400:127.0.0.1:32400 [USERNAME]@[IP]"
echo "3. Browse to https://127.0.0.1:32400/web to initiate the setup of the Plex server"
echo "4. Once the setup is complete, sign in (if it doesn't show you signed in) and then open the Settings"
echo "5. Claim the server"
echo "6. Under 'Manage', select 'Live TV & PVR'"
echo "7. Add a new PVR"
echo "8. Click the 'Don't see your HDHomeRun device? ...' link"
echo "9. Enter: 'xteve_lazystream:34400' (this is the hostname that Docker uses to refer to the container and which is only available when you create your own bridge network, like this script did earlier; the default bridge network does not allow container-to-hostname lookups)"
echo "10. Choose any country and click 'Continue'"
echo "11. Click the 'Have an XMLTV guide on your server?' link and then enter 'http://xteve_lazystream:34400/xmltv/xteve.xml' in the XMLTV Guide field and enter a descriptive title like 'NHL and MLB'.  Then click 'Continue'"
echo "12. Click 'Continue'"
echo "13. Click 'Close'"
echo "14. Disconnect from the port forwarding session initiated in step 2."
echo ""
echo "You're done!"```
Clone this wiki locally