Unable to configure Plex

I moved to another HA server. Because of that a new token. Deleted integration, restated, added Plex integration again, Plex web login to get the token, successfull, but then always:

No servers linked to Plex account

There is a server linked. It worked before as well.

Any ideas?

Sounds like you’re using the manual config setup. Have you tried the automatic flow which obtains a new token for you by redirecting you to Plex to login?

No. Unfortunately, above was the automatic flow.

And yes, restarted before, removed HA from former integration/server inside Plex before, … And yes, if I log into plex.tv with this credentials, the server is there. :disappointed_relieved:

Can you create a new issue at Issues · home-assistant/core · GitHub and add logs? Bumping up the log levels to debug for homeassistant.components.plex and plexapi would be a good start. Make sure you don’t share any tokens.

Thx. Did so.

I am re-posting this as I haven’t got any replies

You don’t have remote access enabled on your Plex server.

So ip based remote access won’t work

If you are serving an SSL via reverse proxy with Nginx Proxy Manager. You don’t need to enable remote access in plex

  • port forward 80 and 443 to NPM on your router, 80 so you can rewrite http → https
  • create a proxy host for plex.yourdomain.whatever → internal Plex IP, port 32400
  • create an internal dns rewrite in Adguard for your domain so you don’t leave your network just to come back in for internal requests

In HA add the integration using your fqdn and https port (you don’t need to add :443 to the end because https is native to 443)

https://plex.yourdomain.whatever

Now you can access Plex internally or externally with the same URL with a reverse proxy, and you don’t have to enable remote access on the Plex server

@Deckoz2302 I am very grateful. Not sure if you have the time to answer the below

  • port forward 80 and 443 to NPM on your router, 80 so you can rewrite http → https
    Do I also enable port 80 in NPM – currently it is disabled

  • create a proxy host for plex.yourdomain.whatever → internal Plex IP, port 32400
    I can create a proxy host – currently using duck DNS which as I understand will accept wild card sub domains. Do I also create a separate reservation on my router – currently my HA is 192.168.88.72 so should it be a reserved IP or the can I continue to use 192.168.88.72

I think I can google the rest and try to figure it out. Will post detailed instructions once I get it to work.

Thanks again

Yes, and then on the proxy host config enable https redirect.

This way you could say just type in plex.yourdomain in a browser and it will automatically forward to https://plex.yourdomain

If you don’t do this you can’t just type plex.yourdomain as that will resolve as http://plex.yourdomain which isn’t serving anything on http port 80

The only NAT ports(port forwarding) reservation on your router you should need is 80 and 443. Which will forward to your NPM host.

Let’s say you have a Plex stack, radarr, sonarr etc. You are only forwarding to NPM 80 and 443 once from your router. NPM handles the FQDN and then forwards to the backend IP and port for the service configured in the proxy config.

Now let’s say you have

  • plex.yourdomain
  • radarr.yourdomain
  • sonar.yourdomain
  • tautulli.yourdomain
  • jackett.yourdomain
  • overseerr.yourdomain

DNS records only hold records, not Ports. So all three of the above sub domains will have the same underlying A record(IP) or CNAME record(pointing to another FQDN) meaning they all resolve to the same host in a residential scenario where you have one ISP. Provider giving you one IP or one NAT

So they all navigate to your NPM proxy via port 80(http://plex.yourdomain when you type plex.yourdomain in a browser. If in NPM you have HTTPs redirect on it redirects to 443 or https://plex.yourdomain

Now on the backend your hosts might be different hosts or the same, and different ports. That’s what the proxy does, it serves a SSL certificate and acts as the front end to the backend server/microservice without actually exposing that service to the Internet, as there is a proxy in front of it.

I quoted this again. To mention IP reservations. While you only need two ports open to NPM only, not the actual service ports like Plex on 32400. You should make IP reservations and static IPs for your servers and micro services, so that your router always and only forwards 80 and 443 to a static IP where NPM resides. And then for each of your micro services, NPM always forwards to a static IP the service resides on. This way your services aren’t on DHCP and the configurations will always resolve to the correct host.

Thank you for the detailed instructions, plus the explanation how things work were amazing and insightful. I followed them in detail. I tried to setup a static IP but one of the requirements is a MAC or Client ID. So I tried and abandoned it. I setup the forwards, filters and the URL re-write. I can now access PLEX outside my network and within my network goes to my local HA IP at port 32400.

The one problem I am faced with is when I access outside my network through my Duck DNS domain then it isn’t secure. My HA instance is still secure how can I leverage to use Lets Encrypt for my plex domain. I have looked around but couldn’t find a solution

The second problem but not a deal breaker is, outside my network when I click on “open Web UI” in the Plex media Server “Add On” it resolves to myha.duckdns.org:3400 not to plexmyha.duckdns.org:3400 hence doesn’t go anywhere.

I have updated my Plex network preferences. Any ideas?

Disable duck DNS proxy relay. As the duckdns add-on only supports one proxy name as far as I know

Then install Nginx Proxy Manager, and make your proxy hosts there. :slight_smile:

After a lot of playing around. I gave up. I added Wire Guard VPN. Now when I want to play Plex I VPN in and play. Bonus of closing ports