Multiple Plex docker instances on server with multiple real IPs

server-docker

#1

Hi guys,

i have a server with 6 real ips and currently running on ubuntu and of course plex uses all of them.

I want to move it inside a docker instance so it will bind only to a specific IP.

After I do that I want to run a second docker instance that will bind to a different real IP so that I set it up for a friend of mine.

How would I start docker to bind to a specific IP?
My interfaces are eth0,eth0:1...eth0:5

Thanks!


#2

Before even going to that point, you have to contend with PMS's reserved ports and how clients (if on a LAN) are going to find them. Port 32400 is hard coded and not movable as are several others. You must remember, Docker is a container, not a VM. As such, there are ports which PMS uses for its own use and these are reflected in the host's port list. It is strongly recommended you look at all the ports documented in the firewall ports list and determine the mapping you need. If you need full functionality on each server (local clients, discovery, etc), I can save you the time now and tell you it won't work.

With respect to your question about Docker and specific IPs, I refer you to the Docker documentation. You'll need to know the PMS Docker container will be Ubuntu based with PMS running 'on Ubuntu'


#3

Looks like what you want is in here: https://docs.docker.com/engine/userguide/networking/default_network/binding/ It appears that -p IP:host_port:container_port will accomplish what you want.

That aside, you definitely want to match up the host_port and container_port values as several don't operate correctly when moved. If you bind two different containers to different IPs, it should allow you to use the same port numbers, but I've not tested this.


#4

@gbooker02 said:
Looks like what you want is in here: https://docs.docker.com/engine/userguide/networking/default_network/binding/ It appears that -p IP:host_port:container_port will accomplish what you want.

That aside, you definitely want to match up the host_port and container_port values as several don't operate correctly when moved. If you bind two different containers to different IPs, it should allow you to use the same port numbers, but I've not tested this.

Yes it worked!

Now running two docker instances on same server on different IPs....


#5

Yes it worked!

Now running two docker instances on same server on different IPs....

I would love to see how you did this. I've been trying for days to get 2 pms-docker containers running on the same VM but haven't been able to "claim" the second server. My first pms-docker container is running fine.

I've created an SSH tunnel and logged into the web interface at http://127.0.0.1:32400/web/index.html, but I only see my original server and my Plex Cloud server. I'm not able to claim a new server.

Both of my containers have all of the usual Plex ports bound to 2 different IPs on the host using the -p option, although the second server probably doesn't need all of them. I don't even need it to have external access, but I will want to connect 1 or 2 clients to it occasionally.


#6

@matt2079
Use macvlan, create docker network with your subnet, start plex two times with static IP

docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.254 -o parent=eth0 LAN192-168-1

then test it with:
docker run -ti --rm --network LAN192-168-1 --ip 192.168.1.1 alpine:latest /bin/sh

you should be able to see (ping) the container on 192.168.1.1 from your subnet. Just change 192.168.1.0/24 to your subnet you are using. eth0 is the network interface you want to use, if you have VLANs on that interface, you need to activate promiscuous mode on your NIC.


#7

@11notes
Thanks! I'll try that out. It'll take me a while to get to it but when I get a chance I'll post my results back here.

I've currently got it working by setting up a second Plex account, which allowed me to claim the server, but that's more of a pain than it's worth.