# Plex Server Setup This repository contains scripts and configuration for setting up a Plex Media Server on Ubuntu. I run this on a Raspberry Pi 4B. * [Installation](#installation) * [1. Copy the Files over to Your Server](#1.-copy-the-files-over-to-your-server) * [2. SSH into Your Server](#2.-ssh-into-your-server) * [3. Configure Your Environment](#3.-configure-your-environment) * [Copy the Example Env File](#copy-the-example-env-file) * [Fill in PLEX_CLAIM with Your Plex Claim Token](#fill-in-plex_claim-with-your-plex-claim-token) * [4. Run the Installation Scripts](#4.-run-the-installation-scripts) * [Install Docker](#install-docker) * [Set up External Drive](#set-up-external-drive) * [5. Start Plex](#5.-start-plex) * [Tailscale Setup](#tailscale-setup) ## Installation ### 1. Copy the Files over to Your Server ```sh scp compose.yaml .env.example setup-docker.sh setup-drive.sh @:/home// ``` ### 2. SSH into Your Server ```sh ssh @ ``` ### 3. Configure Your Environment #### Copy the Example Env File ```sh cp .env.example .env ``` #### Fill in PLEX_CLAIM with Your Plex Claim Token [Get a claim token from Plex](https://www.plex.tv/claim/) ### 4. Run the Installation Scripts #### Install Docker ```sh sudo ./setup-docker.sh ``` #### Set up External Drive If you're using an external hard drive for your media, set up the fstab entry for it: ```sh sudo ./setup-drive.sh ``` The defaults use my hard drive assumptions. To use different configuration, pass the overrides before the command: ```sh FSTAB_UUID=your-uuid FSTAB_MOUNT_POINT=/mnt/data FSTAB_FS_TYPE=ext4 sudo -E ./setup-drive.sh ``` After you've added the fstab entry, mount the drive: ```sh sudo mount -a ``` ### 5. Start Plex ```sh docker compose up --detach ``` ## Tailscale Setup If you want to have access to your server outside of your home network, you can setup tailscale to do so. ```sh scp setup-tailscale.sh @:/home// sudo ./setup-tailscale.sh ``` The script will print a URL to authenticate in a browser.