Accessing Plex Server Running on Docker Container 'Connection Refused'

I’m trying out Plex Server on a docker container for the first time. I’ve followed the instructions on the github site, but I can’t seem to be able to access the web interface. I keep getting a ‘connection refused’ error. I’ve tried my macbook as the host and I’ve also spun up a VM running ubuntu 16.04 as the host and I keeping getting the same message. I was hoping someone might share some suggestions so I can get this going!

Here is my first attempt with a docker run command:

docker run \
--name plex \
--network=host \
-e TZ="America/Denver" \
-e PLEX_CLAIM="claim-#############" \
-v $PWD/config/plex:/config \
-v $PWD/transcode:/transcode \
-v $PWD/media:/data \
plexinc/pms-docker

My second attempt using docker-compose.yml file:

version: '2'
services:
  plex:
    container_name: plex
    image: plexinc/pms-docker
    restart: unless-stopped
    environment:
      - TZ=America/Denver
      - PLEX_CLAIM=claim-#############
    network_mode: host
    volumes:
      - $PWD/config/plex:/config
      - $PWD/transcode:/transcode
      - $PWD/media:/data

I’ve tried accessing the site by going to http://localhost:32400 on my macbook pro and on my ubuntu VM. I’ve tried running the following command from both hosts and this is the results.

curl -k "http://localhost:32400"
curl: (7) Failed to connect to localhost port 32400: Connection refused

Docker on the Mac runs in a VM. As a result, host networking for the container will be the VM’s network, not your Mac’s. You need to use a different form of networking than host.

Edit: didn’t see you were using an explicit Ubuntu VM and tried within that VM.

Usually the connection refused is a result of the inability to read/write in the /config directory. I noticed you didn’t set the UID/GID variables so it’s likely the permissions of /config are such that the plex user in the container cannot read-write this dir.

gbooker2;
Thank you for the explanation. I wasn’t aware how docker worked for the Mac. I did as you recommended and I managed to get it running! :slight_smile:
When I first logged in, I couldn’t see the new server. I had to get a new plex claim number and recreated the container and everything worked like a charm! Very cool. Thx for your assistance and contribution!

version: '3'
services:
  plex:
    container_name: plex
    image: plexinc/pms-docker:beta
    restart: unless-stopped
    environment:
      - TZ=America/Denver
      - PLEX_CLAIM=claim-###############
      - PLEX_UID=1000
      - PLEX_GUID=1000
    network_mode: bridge
    hostname: PlexDockerBeta
    ports:
      - "32469:32469"
      - "32400:32400"
      - "32401:32401"
      - "3005:3005"
      - "8324:8324"
      - "1900:1900/udp"
      - "32410:32410/udp"
      - "32412:32412/udp"
      - "32413:32413/udp"
      - "32414:32414/udp"
    volumes:
      - $PWD/config/plex:/config
      - $PWD/transcode:/transcode
      - $PWD/media:/data