dockerdocker-for-windowsplex

Running plex as a docker container, cannot access web UI


I am trying to set up my Plex server using docker. I have followed the steps on the LinuxServer.io docker page. When I run the docker command, it says that it is running find and I get no errors. However, when I try to access the web UI through localhost:32400/web, all I get is "Problem loading page"

I am using docker for windows with Linux containers.

docker command:

docker run -d --name=plex --net=host -e PUID=1000 -e PGID=1000 -e TZ=Europe/London -e VERSION=docker -v D:\plex\config:/config -v D:\media\tvseries:/data/tvshows -v D:\media\movies:/data/movies -v D:\media\transcode:/transcode --restart unless-stopped linuxserver/plex

when I use docker ps the plex container looks like it is running.

I am new to docker. I have looked around and cannot find why I cannot access the UI.

Please me know if you require additional information.

docker inspect:

"NetworkMode": "host",
"PortBindings": {
    "32400/tcp": [
        {
            "HostIp": "",
            "HostPort": "32400"
        }
    ]
},

please let me know if you require more information


Solution

  • --net=host not work for docker-for-windows.

    Reasons:

    Linux container need to share a linux host' kernel.

    In order to achieve this, when docker for windows run a linux container, it will had to setup a hyper-v machine. If you open the Hyper-V manager, you will see a MobyLinuxVM running.

    So, when you use --net=host, the container will just use the network of MobyLinuxVM, not the windows. So, localhost will not work.

    Suggestion:

    For your scenario, I suggest you to remove --net=host, add port mapping in command line:

    docker run -d --name=plex -p 32400:32400 -e PUID=1000 -e PGID=1000 -e TZ=Europe/London -e VERSION=docker -v D:\plex\config:/config -v D:\media\tvseries:/data/tvshows -v D:\media\movies:/data/movies -v D:\media\transcode:/transcode --restart unless-stopped linuxserver/plex
    

    Then, magic will happen here, docker for windows will map the windows's 32400 port to your container using windows route mechanism. And you can visit container's service from windows.