Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,11 @@ Session.vim
# auto-generated tag files
tags

# Media (oooops...)
media/
# We do not want to commit user data
media

# and even more, we don't want to commit TLS Certs :o
acme/

# or htpasswd files
htpasswd
158 changes: 130 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,152 @@
# Media Server
Dockyard
========

A media server configuration to run Plex, Sonarr, Radarr, and Transmission in Docker and behind Traefik.
TL;DR
-----

Each subdirectory contains a docker-compose setup. Setups can be combined, for
instance, you can spawn Traefik to act as a router to server-compents in other
setups.

## First run
## Requirements

NOTE: All the following should be applied on the machine you want to setup our
Plex stack on.

- install Apache `htpasswd`
- install [Docker](https://www.docker.com/)
- install [Docker Compose](https://docs.docker.com/compose/)
- create a [Plex accout](https://www.plex.tv/)
- clone this repository
- clone and setup [the reverse proxy](https://github.com/hkaj/reverse_proxy)
- create a user for your media server, export its `$USER_ID` and `$GROUP_ID`.
- create a folder named `media` in this folder (`dockyard`) owned by $USER_ID:$GROUP_ID from your `media` user.
- get your Plex claim token at https://www.plex.tv/claim/
- create a `web` docker network with `docker network create web`
- run `DOMAIN_NAME="..." PLEX_TOKEN="..." USER_ID="$USER_ID" GROUP_ID="$GROUP_ID" docker-compose up -d`
- profit :)
- clone this repository in a folder of your choice, where you want all your
media to be stored
- a domain (or subdomain) name with A records pointing to your server IP
```
# Replace example.com with your (sub)domain here
example.COM A <YOUR_SERVER_IP>
*.example.com A <YOUR_SERVER_IP>
```

- Export these env vars in your `.bashrc/.zshrc`:
```shell
export TRAEFIK_ADMIN_PORT=8080
# Change example.com with your domain name
export DOMAIN_NAME=fsociety.tel
# Change me@example.com with your domain name
export ACME_EMAIL=me@example.com
export USER_ID=${UID}
export GROUP_ID=${GID}
```

- then resource .zshrc/.bashrc, or simply log out of your server and connect again
```
# Bash
source ~/.bashrc

# ZSH
source ~/.zshrc
```

- protect your server with authentication (enabled on all services, no need to
log-in on all of them)
```
# Jump into the repo you just cloned
cd dockyard

htpasswd -c htpasswd <YOUR_USER_NAME_HERE>
# you will then be prompted for your password
# an htaccess file will be created
```


- finally bring up your stack (you can use [ctop](https://ctop.sh) to monitor
your stack)
```shell
# Bring up the stack !
docker-compose up -d
```

## Configuration

## Plex

Plex won't be opened to the web when you start it for the first time. For that
reason, you'll need to create an SSH tunnel to perform the initial configuration

```shell
ssh -L 32400:127.0.0.1:32400 <YOUR_SERVER>
# Don't close the SSH session or your terminal until you finish the setup
```

Then, you can reach `http://127.0.0.1:32400` in your browser and follow the
instructions. You will then be able to access your Plex server on
[https://app.plex.tv](https://app.plex.tv).

TODO: recommend TLS setup on the Plex server itself

## Transmission

TODO: protect via password using Traefik

## Radarr

TODO: protect via password using Traefik

## Sonarr

TODO: protect via password using Traefik

## Ombi

TODO: protect via password using Traefik

## PlexPy

TODO: protect via password using Traefik

## Jackett

TODO: protect via password using Traefik

## Config
## Where to find your media ?

In the `dockyard` (our repo) folder, a `media` subfolder will be created.
This is where all your content will be stored. This is the folder to
backup up and relocate to another server in case you need to migrate your
data from one machine to another.

### Transmission
## Troubleshooting

We use [Transmission](https://transmissionbt.com/) as the downloader.
### Docker-Compose commands

- stop transmission's container
- configure basic auth at `media/transmission/config/settings.json` (you will need to touch `rpc-authentication-required`, `rpc-username` and `rpc-password`)
- start transmission's container
All these commands must be run at the root of the repo you cloned

- getting logs from your container:
```shell
docker-compose logs

### Sonarr
# Only logs for a given set of services
docker-compose logs plex proxy
```

We use [Sonarr](https://sonarr.tv/) to track and manage TV shows.
### Accessing Traefik's user interface

- setup auto-update and authentication
- connect transmission as a downloader
Traefik's user interface is not exposed publicly. To connect to it, you can use
SSH-tunneling on port `8080`:
```shell
ssh -L 8080:127.0.0.1:8080 <YOUR_SERVER>
# don't close the SSH session
```

The interface will be accessible under `http://localhost:8080` on your local
machine.

### Radarr
## Disclaimer

We use [Radarr](https://radarr.video/) (a clone of Sonarr) to track and manage movies.
We can't be held responsible for what you'll do with the setups (don't download
stuff illegally, etc. etc.)

- setup auto-update and authentication
- connect transmission as a downloader
## Maintainers

* [hkaj](/hkaj)
* [elafarge](/elafarge)

### Jackett

We use [Jackett](https://github.com/Jackett/Jackett) as a proxy between private trackers and our other components.
48 changes: 48 additions & 0 deletions README.old.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Media Server

A media server configuration to run Plex, Sonarr, Radarr, and Transmission in Docker and behind Traefik.


## First run

- install [Docker](https://www.docker.com/)
- create a [Plex accout](https://www.plex.tv/)
- clone this repository
- clone and setup [a reverse proxy](../traefik/)
- create a user for your media server, export its `$USER_ID` and `$GROUP_ID`.
- create a media folder in docker-compose's folder with $USER_ID:$GROUP_ID ownership
- get your Plex claim token at https://www.plex.tv/claim/
- run `DOMAIN_NAME="..." PLEX_TOKEN="..." IP_ADDRESS="..." USER_ID="$USER_ID" GROUP_ID="$GROUP_ID" docker-compose up -d`
- profit :)

## Config


### Transmission

We use [Transmission](https://transmissionbt.com/) as the downloader.

- stop transmission's container
- configure basic auth at `media/transmission/config/settings.json` (you will need to touch `rpc-authentication-required`, `rpc-username` and `rpc-password`)
- start transmission's container


### Sonarr

We use [Sonarr](https://sonarr.tv/) to track and manage TV shows.

- setup auto-update and authentication
- connect transmission as a downloader


### Radarr

We use [Radarr](https://radarr.video/) (a clone of Sonarr) to track and manage movies.

- setup auto-update and authentication
- connect transmission as a downloader


### Jackett

We use [Jackett](https://github.com/Jackett/Jackett) as a proxy between private trackers and our other components.
Loading