wernight / docker-plex-media-server

Dockerized Plex Media Server
https://registry.hub.docker.com/u/wernight/plex-media-server/
MIT License
129 stars 34 forks source link

Cannot get remote access without --net=host…? #10

Closed hedefalk closed 8 years ago

hedefalk commented 8 years ago

Sorry if this is a super-newbie question, but do I understand it correctly that I either need to run with--net=host so that Avahi broadcast works OR need to open up port 32400 on my router?

Everything works fine for me with --net=host, but If I remove it I can't seem to enable remote access from settings in the web ui and therefore can't reach the server from my other plex clients (other than the web ui directly against this container).

I have currently not opened up port 32400 and can't try it right now since I'm remote.

hedefalk commented 8 years ago

One more question related to Docker: Do you know if it is it possible to restart an existing container with different --net settings? I can't seem to make it work. If I use restart or stop+restart on the same container and add --net=host as option I get:

viktor@i7:~$ sudo docker start --net=host plex
flag provided but not defined: --net
See 'docker start --help'.

Seems like I have to create a new container for every restart and if I name it I need to cleanup all the time:

viktor@i7:~$ sudo docker ps -a
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                       PORTS                    NAMES
888f76e48e87        wernight/plex-media-server   "/entrypoint.sh /bin/"   20 minutes ago      Exited (137) 3 minutes ago                            plex
8b33ae9740ec        wernight/plex-media-server   "/entrypoint.sh /bin/"   16 hours ago        Exited (137) 5 hours ago                              high_turing
24658f7cb61e        wernight/plex-media-server   "/entrypoint.sh /bin/"   16 hours ago        Exited (137) 16 hours ago                             elegant_carson
…
JigSawFr commented 8 years ago

It work very well without --net for me ! Check https://github.com/wernight/docker-plex-media-server/issues/9 Tested and approved :)

hedefalk commented 8 years ago

@JigSawFr I can't seem to extract any info from there that I understand. I DO get the server settings. That discussion is about IP series allowed to use the media server WITHOUT login, right? I'm not interested to allow any usage of my server without login at all. I just want to have it reachable. Screens in swedish locale:

Without --net=host:

screen shot 2016-01-05 at 14 35 27

It says "Not reachable outside your network".

With --net=host:

screen shot 2016-01-05 at 14 46 34

Here it says "Fully reachable from outside your network"

So I can't reach this server from the Android app say if I don't run it with --net=host. Unfortunately I can't test to open up 32400 right now, but my question is:

Do I need to either continue run with --net=host or will it work if I just open up 32400?

Thanks!

JigSawFr commented 8 years ago

Without net host you need to map your port, for example mine docker run is :

docker run -d --name plex --restart=always -p 911:32400 -v /data/config/plex:/config -v /data/medias:/medias -e PLEXPASS_LOGIN='my@email.com' -e PLEXPASS_PASSWORD='myPassword' wernight/plex-media-server:autoupdate

So as you can see, i've mapped 32400 to 911 port, so i need to enter manual port in Plex for 911. And i use a personnalized URL (not ip)

hedefalk commented 8 years ago

@JigSawFr

I have mapped 32400 to 32400 and tried to manually set 32400 in the config there, but it doesn't help.

My startup

sudo docker run -d --restart=always -name plex -v /var/lib/plex-config:/config -v /var/lib/media:/media -v /var/lib/transmission:/transmission -p 32400:32400 wernight/plex-media-server
JigSawFr commented 8 years ago

Is your server connected to plex.tv ? Do you tried four or five to apply port number ?

hedefalk commented 8 years ago

Connect to plex.tv is what I'm trying to achieve. That happens automatically when I log in to this server with my plex account. But it doesn't work currently if I do not set --net=host

"Do you tried four or five to apply port number ?"

Sorry, I do not understand this question? Number of digits of port number? Should I try a low port number like your 911:32400 and set 911 in the config you mean? I'll try!

JigSawFr commented 8 years ago

Ok, sorry for misunderstood, how many times did you tried to set your port number ? Sometimes i needed to apply (click) fives times before succeeded

wernight commented 8 years ago

Your main issue seems to be related to your first question:

Sorry if this is a super-newbie question, but do I understand it correctly that I either need to run with--net=host so that Avahi broadcast works OR need to open up port 32400 on my router?

You need both (updating the FAQ may also be a good option):

The first is to access Plex from your LAN, the second is for Plex to be reachable from the Internet (the error you see above in Plex settings).

hedefalk commented 8 years ago

Well, thing is I didn't have any port open at all in my router but running with --net=host still made it reachable from the Internet. It just auto-worked, I don't know how that shit works, but I guess the server acts TCP client just like a browser or whatever behind a NAT?

So either

works.

wernight commented 8 years ago

It's not an or. However I think Plex may try UPnP for routers who enabled it, so that might explain it (https://support.plex.tv/hc/en-us/articles/200931138-Troubleshooting-Remote-Access)