An open API service indexing awesome lists of open source software.

https://github.com/snackk/awesome-media-center

Media center using docker-compose with Traefik, Portainer, Nextcloud, Emby, Jackett, Radarr, Sonarr.
https://github.com/snackk/awesome-media-center

List: awesome-media-center

docker docker-compose emby nextcloud nextcloud-docker portainer traefik

Last synced: 4 months ago
JSON representation

Media center using docker-compose with Traefik, Portainer, Nextcloud, Emby, Jackett, Radarr, Sonarr.

Awesome Lists containing this project

README

          

## awesome-media-center


alt text


Media center using docker-compose with Traefik, Portainer, Nextcloud and Emby.

## Overview

Traefik acts as a reverse proxy to expose the running docker containers, exposes ports 80 and 443. Port 80 redirects all the requests to 443, to enforce HTTPS. Services are registered as dynamic DNS entries in the host machine, that maps a subdomain for the respective container ip. Additionally, each service is SSL certified, managed by Traefik using Letsencrypt.

## Prerequisites

* Domain, with the subdomains registered
* Server
* Docker and docker compose

## Installation

Each of the services is represented by a docker stack, containing a *docker-compose.yml*. For the installation to be more manageable, the only two service deployed by docker cli are [traefik](#traefik) and [portainer](#portainer). The remaining services will be deployed using [portainer](#portainer) to easily manage the stacks.

First, run trafik - traefik will expose all internal services that enable traefik in their configs:
```sh
$ cd trafik && docker compose up -d
```

Next, run the portainer:
```sh
$ cd portainer && docker compose up -d
```

With portainer up and running, we can either add the stacks on portainer dashboard, by adding each of the docker-compose files, or by repeating the docker compose up on each of the services.

Any issue with the installation should refer to the [problems](#problems) section.

### Traefik

On the *docker-compose.yml* one should change the property *basicauth.users*. The password should be generated by *htpasswd*, and for each character "$" should be escaped by inserting another "$" character.

#### Traefik upgrade

Traefik is not managed by portainer, so we can't recreate the stack and pull the latest image, so we need to do it manually:
```sh
$ docker pull traefik
$ cd traefik
$ docker stop traefik
$ docker rm traefik
$ docker compose up -d
```

### Portainer

Like Traefik, not managed by itself, so we need to manually recreate and pull the latest image:

#### Portainer upgrade

```sh
$ docker pull portainer/portainer-ce
$ cd portainer
$ docker stop portainer
$ docker rm portainer
$ docker compose up -d
```

### Nextcloud

Should be deployed using portainer under stacks.

To setup wizard requires the following credentials:
* *user* - nextcloud
* *password* - secret
* *database* - nextcloud
* *host* - db:3306

#### Nextcloud upgrade

Since nextcloud is managed by the Portainer, we could just recreate the stack, and portainer will automatically fetch the latest image and recreate it.

```sh
$ docker pull nextcloud/nextcloud
$ cd nextcloud
$ docker stop nextcloud
$ docker rm nextcloud
$ docker-compose up -d
```

### Emby

Should be deployed using portainer under stacks.

The *UID* and *GID* on the environment are described in the section [User ID and Group ID](#user).

#### Emby upgrade

Since emby is managed by the Portainer, we could just recreate the stack, and portainer will automatically fetch the latest image and recreate it.

```sh
$ docker pull emby/emby
$ cd emby
$ docker stop emby
$ docker rm emby
$ docker compose up -d
```

#### Emby Backup

This step is recommended when changing the OS of the host machine / changing hardware parts.
This will backup the entire emby config and create a **backup.tar** file.
```sh
$ cd ~ && mkdir emby-backup && cd emby-backup
$ docker run --rm --volumes-from emby -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /config
```

#### Emby Restore Backup

If you're using colima, please read through this first: [Additional config - Colima](#colima).

For Colima:

Additionally, you need to copy the generated emby-backup folder to `~/colima-data`.
```sh
$ docker run --rm --volumes-from emby -v ~/colima-data/emby-backup:/backup ubuntu bash -c \
"cd /config && tar xvf /backup/backup.tar --strip 1 && chown -R 501:20 /config"
```

Here, you should make sure you've copied the emby-backup to the new host machine, and cd into it:
```
$ cd ~/Desktop/emby-backup
$ docker run --rm --volumes-from emby -v $(pwd):/backup ubuntu bash -c "cd /config && tar xvf /backup/backup.tar --strip 1"
```

### Transmission

Should be deployed using portainer under stacks.

The volumes should be changed to match the wanted mount. The *PUID* and *PGID* on the environment are described in the section [User ID and Group ID](#user).

#### Transmission upgrade

Since transmission is managed by the Portainer, we could just recreate the stack, and portainer will automatically fetch the latest image and recreate it.

```sh
$ docker pull transmission/transmission
$ cd transmission
$ docker stop transmission
$ docker rm transmission
$ docker compose up -d
```

### Additional config - Colima

Because Colima doesn't automatically mount the host volumes, we need to manually add them to the VM config of Colima in order to use them.
To do that, you should add mount points to the Colima VM template:
```
subl ~/.colima/default/colima.yaml
```
A folder should also exist on your home folder (`mkdir ~/colima-data`).

example:
```
mounts:
- location: /Volumes/Media
writable: true
- location: ~/colima-data
writab
```

### User ID and Group ID

With the user you're running docker run:
```sh
$ id -u
```
returns UID for the user, and
```sh
$ id -g
```
returns GID for the user.

## Problems

Permissions on *data/acme.json* are too open then run:
```sh
$ chmod 600 acme.json
```

Written by [@snackk](https://github.com/snackk)