Jump to content

Installing Emby in docker


Radiance76

Recommended Posts

Radiance76

Hello,

 

So I want to bring my Emby to the next level and run Emby Instances in docker.

 

 

The following is a reference to Dockers info on Emby @ https://hub.docker.com/r/emby/embyserver/

 

docker run -d \
    --volume /path/to/programdata:/config \ # This is mandatory
    --volume /path/to/share1:/mnt/share1 \ # To mount a first share
    --volume /path/to/share2:/mnt/share2 \ # To mount a second share
    --device /dev/dri/renderD128 \ # To mount a render node for VAAPI
    --publish 8096:8096 \ # To expose the HTTP port
    --publish 8920:8920 \ # To expose the HTTPS port
    --env UID=1000 \ # The UID to run emby as (default: 2)
    --env GID=100 \ # The GID to run emby as (default 2)
    --env GIDLIST=100 \ # A comma-separated list of additional GIDs to run emby as (default: 2)
    emby/embyserver:latest
 
 
 
Can someone assist in breaking this down so I can get it to run?
 
 
  --volume /path/to/programdata:/config \ # This is mandatory
Where do I find this? Server is a Ubuntu 16 
 
 --volume /path/to/share1:/mnt/share1 \ # To mount a first share
I am going to run emby on a cloud VPS server with docker. The VPS has NFS access to another server that holds my content and has the share mapped through FSTAB file. This should basically be a copy of that mapping correct?
 
 
  --device /dev/dri/renderD128 \ # To mount a render node for VAAPI
Do I change this?
 
 
    --publish 8096:8096 \ # To expose the HTTP port
    --publish 8920:8920 \ # To expose the HTTPS port
I assume that for every instance I run from the Emby image, I can change the port by increments of 1 so that I can uniquely define the Emby servers?

 

 

 

   --env UID=1000 \ # The UID to run emby as (default: 2)
    --env GID=100 \ # The GID to run emby as (default 2)
    --env GIDLIST=100 \ # A comma-separated list of additional GIDs to run emby as (default: 2)
I am going to run as root for now, so I assume that all these values will be 0s?
 
 
 
 
So again, my aim is to just get this to work and then with proper understanding tweak it and test it in other ways.
 
Can I please get an assist?
Thanks in advance.
Link to comment
Share on other sites

Hi, the default values for all of those are listed there. What I would suggest doing is using those defaults, and only changing the ones that you have a reason to change. Most users don't need to change them.

 

Please let us know if this helps. Thanks !

Link to comment
Share on other sites

Radiance76

thanks for the reply.

 

When I copy and paste the whole command as is i get the following:

 

/home/ubuntu# docker run -d \
>     --volume /var/lib/emby:/config \ # This is mandatory
docker: invalid reference format.
See 'docker run --help'.
root@server-2:/home/ubuntu#     --volume 192.168.0.5/content:/nfs/content \ # To mount a first share
--volume: command not found
root@server-2:/home/ubuntu#     --volume 192.168.0.6/content2:/nfs/content \ # To mount a second share
--volume: command not found
root@server-2:/home/ubuntu#     --device /dev/dri/renderD128 \ # To mount a render node for VAAPI
--device: command not found
root@server-2:/home/ubuntu#     --publish 8096:8096 \ # To expose the HTTP port
--publish: command not found
root@server-2:/home/ubuntu#     --publish 8920:8920 \ # To expose the HTTPS port
--publish: command not found
root@server-2:/home/ubuntu#     --env UID=0 \ # The UID to run emby as (default: 2)
bash: syntax error near unexpected token `('
root@server-2:/home/ubuntu#     --env GID=0 \ # The GID to run emby as (default 2)
bash: syntax error near unexpected token `('
root@server-2:/home/ubuntu#     --env GIDLIST=0,44 \ # A comma-separated list of additional GIDs to run emby as (default: 2)
bash: syntax error near unexpected token `('
root@server-2:/home/ubuntu#     emby/embyserver:latest
 
 
 
 
Clean VPS just after pulling emby-docker image
 
 
root@docker-test:/# docker run -d \
>     --volume /path/to/programdata:/config \ # This is mandatory
docker: invalid reference format.
See 'docker run --help'.
root@docker-test:/#     --volume /path/to/share1:/mnt/share1 \ # To mount a first share
bash: --volume: command not found
root@docker-test:/#     --volume /path/to/share2:/mnt/share2 \ # To mount a second share
bash: --volume: command not found
root@docker-test:/#     --device /dev/dri/renderD128 \ # To mount a render node for VAAPI
bash: --device: command not found
root@docker-test:/#     --publish 8096:8096 \ # To expose the HTTP port
bash: --publish: command not found
root@docker-test:/#     --publish 8920:8920 \ # To expose the HTTPS port
bash: --publish: command not found
root@docker-test:/#     --env UID=1000 \ # The UID to run emby as (default: 2)
bash: syntax error near unexpected token `('
root@docker-test:/#     --env GID=100 \ # The GID to run emby as (default 2)
bash: syntax error near unexpected token `('
root@docker-test:/#     --env GIDLIST=100 \ # A comma-separated list of additional GIDs to run emby as (default: 2)
bash: syntax error near unexpected token `('
root@docker-test:/#     emby/embyserver:latest^C
 
Edited by Radiance76
Link to comment
Share on other sites

mastrmind11

dude, get rid of the comments in the command, they're there as a guide so you know what the lines mean.  You also can't use network paths in the volume lines.  Mount the shares and use those mount points as volumes.

Link to comment
Share on other sites

Radiance76

I tried to do that at the start but i could not get it to work.

Docker is a learning curve so I know it will take a while to get used to it.
 
so I decided to install docker, from scratch, on a dedicated server running ubuntu 16.
 
when I run the general install command:

docker pull emby/embyserver

 (Status: Image is up to date for emby/embyserver:latest)

 
 
When I run the general execution command:
 

docker run emby/embyserver:latest

It executes fine and without errors, but when I try to connect to the server at its IP & port, I get no web reply.
 
Looking at its logging, I do see that its binding to the network and from what I understand, by default it operates from a bridging perspective.
But calling the server IP and port for Emby, gives me a blank page.

 

Info HttpServer: Calling ServiceStack AppHost.Init
Info HttpServer: Adding HttpListener prefix http://+:8096/
Info HttpServer: Adding HttpListener prefix https://+:8920/
Info Skia: SkiaSharp version: 1.60.0.0

5ce94248fdbde41b3174d6e528fa5d3f.png
https://gyazo.com/5ce94248fdbde41b3174d6e528fa5d3f

 

 

 

 

 

 

Locally on the dedicated server I get the same.

ccd690e16f28de51395191e1f961f56f.png
https://gyazo.com/ccd690e16f28de51395191e1f961f56f

Link to comment
Share on other sites

mastrmind11

you need to map a local port to a port being exposed inside the docker container.  That's what the --publish directive does.  

 

What is the output of 

docker ps

?

Edited by mastrmind11
Link to comment
Share on other sites

Radiance76

command ran:

docker run -dit \
--publish 8096:8096 \
emby/embyserver:latest
docker ps
 docker ps
CONTAINER ID        IMAGE                    COMMAND             CREATED              STATUS              PORTS                                                  NAMES
52bb2a39d0be        emby/embyserver:latest   "/init"             About a minute ago   Up About a minute   1900/udp, 7359/udp, 0.0.0.0:8096->8096/tcp, 8920/tcp   focused_elbakyan
 
 
 
 docker images
REPOSITORY                       TAG                 IMAGE ID            CREATED             SIZE
ubuntu                           latest              93fd78260bd1        7 days ago          86.2MB
dorowu/ubuntu-desktop-lxde-vnc   latest              3dbc70328943        5 weeks ago         1.2GB
emby/embyserver                  latest              835050fb3fae        2 months ago        213MB
 

 

 

docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
d9492da3146c        bridge              bridge              local
47f9160a366b        host                host                local
e7de3c79b8ad        none                null                local
 

 

 

 

I was under the impression that when a container is ran, that the default network is bridge mode.

Link to comment
Share on other sites

Radiance76


 docker network inspect bridge


[

    {

        "Name": "bridge",

        "Id": "d9492da3146c69d5a5a3bbe33a64ac65d7a8d92a2ee7226a65a1258f7c96dc6d",

        "Created": "2018-11-26T15:06:35.519461704-05:00",

        "Scope": "local",

        "Driver": "bridge",

        "EnableIPv6": false,

        "IPAM": {

            "Driver": "default",

            "Options": null,

            "Config": [

                {

                    "Subnet": "172.17.0.0/16"

                }

            ]

        },

        "Internal": false,

        "Attachable": false,

        "Ingress": false,

        "ConfigFrom": {

            "Network": ""

        },

        "ConfigOnly": false,

        "Containers": {

            "52bb2a39d0bedff2ddf82a74bf75f0922e19800d42d8dc4de4f624d1e3ee7298": {

                "Name": "focused_elbakyan",

                "EndpointID": "91cb7d48e53c3a1ebf2e0dcde8e4c659075775bb60b6324b04c3321314bfc8df",

                "MacAddress": "02:42:ac:11:00:03",

                "IPv4Address": "172.17.0.3/16",

                "IPv6Address": ""

            }

        },

        "Options": {

            "com.docker.network.bridge.default_bridge": "true",

            "com.docker.network.bridge.enable_icc": "true",

            "com.docker.network.bridge.enable_ip_masquerade": "true",

            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",

            "com.docker.network.bridge.name": "docker0",

            "com.docker.network.driver.mtu": "1500"

        },

        "Labels": {}

    }

]
Link to comment
Share on other sites

mastrmind11

the path to the config is required too.  it doesn't matter what you put in, it's where emby will be installed, and then mapped to the internal docker container path.  here's mine as an example.  only thing you might have to change is the uid/gid/gidlist to match your emby user and the --volume for /storage, which is my local mount point of my NAS array.

 

docker run -d \
    --name emby-server \
    --restart unless-stopped \
    --network="host" \
    --volume /home/docker/emby/config:/config \
    --volume /storage:/storage \
    --device /dev/dri/renderD128 \
    --publish 8096:8096 \
    --publish 8921:8920 \
    --env UID=112 \
    --env GID=117 \
    --env GIDLIST=1000,1002 \
    emby/embyserver:latest
Link to comment
Share on other sites

Radiance76

ok question then...

 

1) Do i need to have emby installed on my dedicated server first to then have this ran via docker?

 

here is what i expected with this project and ran with from my understanding.

 

  • install OS Ubuntu
  • configure my nfs share to my content
  • install docker
  • have docker pull emby image
  • paste emby command to execute with options
  • Connect to browser for emby
  • define libraries based off network shares
  • invite test account to test content access
  • repeat with another docker container

 

is this correct?

 

 

 

 

based on your commands, this is what i understand

 

 

docker run -d \
   
--name emby-server \  name i give for my emby server
   
--restart unless-stopped \  allows the container to always restart unless i give docker stop command
   
--network="host"Tells the instance to run with host networking setup
   
--volume /home/docker/emby/config:/config \   this i do not understand, is this where my emby docker instance will store its configuration?
   
--volume /storage:/storage \  path to where my nfs share is
   
--device /dev/dri/renderD128 \  this gives me error message 
   
--publish 8096:8096ports for use but appears to work only for bridge mode
   
--publish 8921:8920 \ ports for use but appears to work only for bridge mode
   
--env UID=112 \ this should be 0 for root
   
--env GID=117 \ still looking to find out if it is also 0
   
--env GIDLIST=1000,1002 \ looking in to this still
    emby
/embyserver:latest

 

 

 

 

 

When i just ran your command:

no access via the broswer.

note dedicated server does not have emby installed on it, just OS and Docker

:~# docker run -d \
>     --name emby-server \
>     --restart unless-stopped \
>     --network="host" \
>     --volume /home/docker/emby/config:/config \
>     --volume /storage:/storage \
>     --device /dev/dri/renderD128 \
>     --publish 8096:8096 \
>     --publish 8921:8920 \
>     --env UID=112 \
>     --env GID=117 \
>     --env GIDLIST=1000,1002 \
>     emby/embyserver:latest
WARNING: Published ports are discarded when using host network mode
7d85f0dfcfbfc616df60e3d495856d073783373d85d7a44f6aa97fae0d242529
docker: Error response from daemon: linux runtime spec devices: error gathering device information while adding custom device "/dev/dri/renderD128": no such file or directory.
Link to comment
Share on other sites

Radiance76

Great news!

 

I was able to get it to work with just the following:

 
docker run -dit \ 
--name test1 \
-publish 8096:8096 \
emby/embyserver:latest
 
and again with the following on the same server
docker run -dit \ 
--name test2 \
-publish 8097:8096 \
emby/embyserver:latest

Now looking at the mapping of the content to have my libraries access them.

Link to comment
Share on other sites

mastrmind11

of course my run command wouldn't work for you, our systems are completely different.  I meant that you change the necessary information so that the command corresponded with your environment...  anyway...

 

I'm not sure why you want to detach the container in interactive mode, or at all.  I'm actually surprised that command even worked... where is it installing emby?  what user is it running emby as?  Since you're now looking into adding volumes, when using docker, the mapping is physical:container.  Your original command had your nfs share as the mount point for inside the container.  And also, as previously stated, you have to mount your nfs shares before mapping them.  Google fstab if you're unclear about how to do that.

 

fwiw, it's pretty bad practice to run anything as root.  If I were you I'd create a dedicated emby user and set the corresponding uid/gid.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
Radiance76

I made changes and it seems I am getting emby running without issues now other than performance issues.

 

 

I am looking to run everything within containers from emby, sonarr, radarr and nzbget

 

I seem to get better perfomance from the apps this way and if i make a mistake with something, its easy for me to start over in minutes, vs hours of work.

 

thanks for the assist!

Link to comment
Share on other sites

moradielle

 

Hello,

 

So I want to bring my Emby to the next level and run Emby Instances in docker.

 

 

The following is a reference to Dockers info on Emby @ https://hub.docker.com/r/emby/embyserver/

 

docker run -d \
    --volume /path/to/programdata:/config \ # This is mandatory
    --volume /path/to/share1:/mnt/share1 \ # To mount a first share
    --volume /path/to/share2:/mnt/share2 \ # To mount a second share
    --device /dev/dri/renderD128 \ # To mount a render node for VAAPI
    --publish 8096:8096 \ # To expose the HTTP port
    --publish 8920:8920 \ # To expose the HTTPS port
    --env UID=1000 \ # The UID to run emby as (default: 2)
    --env GID=100 \ # The GID to run emby as (default 2)
    --env GIDLIST=100 \ # A comma-separated list of additional GIDs to run emby as (default: 2)
    emby/embyserver:latest
 
 
 
Can someone assist in breaking this down so I can get it to run?
 
 
  --volume /path/to/programdata:/config \ # This is mandatory
Where do I find this? Server is a Ubuntu 16 
 
 --volume /path/to/share1:/mnt/share1 \ # To mount a first share
I am going to run emby on a cloud VPS server with docker. The VPS has NFS access to another server that holds my content and has the share mapped through FSTAB file. This should basically be a copy of that mapping correct?
 
 
  --device /dev/dri/renderD128 \ # To mount a render node for VAAPI
Do I change this?
 
 
    --publish 8096:8096 \ # To expose the HTTP port
    --publish 8920:8920 \ # To expose the HTTPS port
I assume that for every instance I run from the Emby image, I can change the port by increments of 1 so that I can uniquely define the Emby servers?

 

 

 

   --env UID=1000 \ # The UID to run emby as (default: 2)
    --env GID=100 \ # The GID to run emby as (default 2)
    --env GIDLIST=100 \ # A comma-separated list of additional GIDs to run emby as (default: 2)
I am going to run as root for now, so I assume that all these values will be 0s?
 
 
 
 
So again, my aim is to just get this to work and then with proper understanding tweak it and test it in other ways.
Can I please get an assist?
Thanks in advance.

 

Hi, the default values for all of those are listed there. What I would suggest doing is using those defaults, and only changing the ones that you have a reason to change. Most users don't need to change them.

Link to comment
Share on other sites

  • 4 months later...
EODCrafter

How are you all making this work? I know it works under "Host Mode" but I want to be able to navigate to Emby inside the Docker container using Docker Network....Why would this not be possible?

docker run -dit --publish 8095:8095 emby/embyserver:beta
PS C:\WINDOWS\system32> docker ps
CONTAINER ID        IMAGE                  COMMAND             CREATED             STATUS              PORTS                                                            NAMES
eafa5b7bcc56        emby/embyserver:beta   "/init"             17 minutes ago      Up 17 minutes       1900/udp, 8096/tcp, 7359/udp, 0.0.0.0:8095->8095/tcp, 8920/tcp   happy_kapitsa

Where do I navigate to to get to my Server Panel? I have tried every IP that I can find.....even the one shown lol 0.0.0.0. (Yes I disabled Firewall too)

Edited by EODCrafter
Link to comment
Share on other sites

Bridge mode will be much more complicated. I think most just use host mode because it is easier.

  • Like 1
Link to comment
Share on other sites

EODCrafter

Bridge mode will be much more complicated. I think most just use host mode because it is easier.

Just a Hobby @@Luke, Trying to Learn New Things...Good News on IPTV...Thanks!

 

Solved...Totally forgot, after Spinning up Emby, I had to stop the container and Edit Emby Config to match the New Port I published (Couldn't use 8096/8920. already in use by Main Server)...Duh-Moment....

Edited by EODCrafter
Link to comment
Share on other sites

Radiance76

lol, all good and glad you were able to get it resolved.

 

1 question, why would you want to connect to the emby container from within docker?

Link to comment
Share on other sites

EODCrafter

lol, all good and glad you were able to get it resolved.

 

1 question, why would you want to connect to the emby container from within docker?

Hmmm, Maybe I worded it wrong...I was talking about external connect.I downloaded Portainer and that has helped a lot! If your referring to 0.0.0.0, that was a slight joke.

Edited by EODCrafter
Link to comment
Share on other sites

Radiance76

:-)

 

Ok, i got you now.

 

I run several containers and I found the best way to manage them was to install the system with manually mapping the config file to a folder that resided outside the container. This way if i ever messed up with a port number, i can just issue docker stop and rm. Then run the install command again with the correct port number or a new one and i'm good to go.

 

Also, I noticed that I needed to go in to the Emby system, advanced settings, and edit the port number that is exposed to the public to ensure that Emby Connect can reach the app in the container.

 

Portainer  is a great tool also. I discovered it not too long ago and still learning it.  It sure helps with the management along with uptime robot and webhooks for notifications.

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

:-)

 

Ok, i got you now.

 

I run several containers and I found the best way to manage them was to install the system with manually mapping the config file to a folder that resided outside the container. This way if i ever messed up with a port number, i can just issue docker stop and rm. Then run the install command again with the correct port number or a new one and i'm good to go.

 

Also, I noticed that I needed to go in to the Emby system, advanced settings, and edit the port number that is exposed to the public to ensure that Emby Connect can reach the app in the container.

 

Portainer  is a great tool also. I discovered it not too long ago and still learning it.  It sure helps with the management along with uptime robot and webhooks for notifications.

 

@@Radiance76

 

There will be a new webhooks plugin with the upcoming Emby Server 4.3:

 

https://emby.media/community/index.php?/topic/77969-new-webhooks-plugin/

Link to comment
Share on other sites

  • 7 months later...
Victor Hernandez

Hi, i share my run command:

  • Windows 10 Pro
  • WSL 2
  • Docker Desktop

Under the actual limitations of WLS 2, Hardware acceleration still its not supported.

 

I have a 2 TB disk with movies an series.

I open powershell with WLS 2 installed and also Docker Desktop

Run my default distro typing: wsl

and then:

docker run -d --volume /mnt/g/emby/config:/config \
    --volume /mnt/g/emby/movies:/mnt/movies \
    --volume /mnt/g/emby/series:/mnt/series \
    --publish 8096:8096 \
    --publish 8920:8920 \
    --env UID=112 \
    --env GID=117 \
    --env GIDLIST=1000,44 \
--name embyserver \
    emby/embyserver:latest

Look how ubuntu is mapping and accesing my G: drive -> /mnt/g

 

Its a great improvement from WLS 1 the overall I/O speed and hope for the announced GPU acceleration that is coming on next weeks.

 

Metrics:
5ed5dee3313b6_performance.png

5ed5df682176b_performance_machine.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...