Jump to content

Running Emby Server Behind VPN


Guest 004940

Recommended Posts

Guest 004940

So after the recent privacy controversy with Plex I've started looking elsewhere for media servers with remote access. It seems Emby is a decent alternative however I'm having issues using it with a VPN.

 

I've had these issues with Plex so I'll explain further. The problem Plex had with the VPN is that it had the wrong IP address for me (it was displaying the VPN IP, as it should do) and because of that, when I was attempting to connect remotely via the VPN IP it could not find the Plex server. The way to get around this was to set up a static port with my VPN provider, which they did, then enter this port into the "Manually specify public port" setting on Plex. After this, the server was remotely accessible, as the VPN provider would listen for incoming connections on the specified port, forward it to my server and all was good.

 

I'm not having any success running this with Emby. I can see that there are settings where I can manually set the public and local ports to access the server (it is listing my VPN IP rather than my real IP, just as Plex did) but I may not be entering my static VPN IP in the right box? I've tried remote access without the VPN running and it worked (though I did have to set up port forwarding in my router). I've tried entering my static VPN IP in the "Public HTTP port number" box in Advanced Settings but this hasn't worked.

 

To be clear, as I seem to be different to most others, I am looking to run Emby behind the VPN and not bypass it. Can anybody assist? There must be some way to do this as it works fine with Plex.

Link to comment
Share on other sites

Happy2Play

As long as your vpn service allows the port request to passthru, then yes you can get it to work

Link to comment
Share on other sites

Guest 004940

My fault, this wasn't working because I'd forwarded my allocated port from the VPN to the wrong Emby port (was still using Plex's 32400 rather than Emby's 8096).

 

I set up a new static port with the VPN provider and forwarded to 8096 at their end, then set public HTTP port to the one provided by the VPN and left the local HTTP port as 8096 and it has worked ok.

Link to comment
Share on other sites

  • 3 weeks later...

My fault, this wasn't working because I'd forwarded my allocated port from the VPN to the wrong Emby port (was still using Plex's 32400 rather than Emby's 8096).

 

I set up a new static port with the VPN provider and forwarded to 8096 at their end, then set public HTTP port to the one provided by the VPN and left the local HTTP port as 8096 and it has worked ok.

 

I have a related question.   What do you mean when you say "set up a new static port with the VPN provider"   I am using a company called VPN UNlimited, I do not think I can request a Static port(?) from my VPN provider. 

 

I would like to use my VPN if possible, but the only way I was able to connect remotely to the Emby server was to shut off my VPN on my HTPC, running the server.  

 

Thanks for any advice

Link to comment
Share on other sites

Guest 004940

I have a related question.   What do you mean when you say "set up a new static port with the VPN provider"   I am using a company called VPN UNlimited, I do not think I can request a Static port(?) from my VPN provider. 

 

I would like to use my VPN if possible, but the only way I was able to connect remotely to the Emby server was to shut off my VPN on my HTPC, running the server.  

 

Thanks for any advice

 

Woops, only just seen this.

 

Emby identifies your server by it's IP address, so when you attempt to connect to it remotely, either using the IP or an assigned Emby account, it will attempt to find the server using the IP address and server port. If you have a VPN running, Emby will pick up your VPN IP and not your real one, so when you attempt to connect remotely it will try to reach your server using the disguised IP, which is of course wrong. There are two ways to get round this, either you stop the VPN running or try to set up a bypass for Emby to get around the VPN (so it will run using your real IP address), or you can try to set up a static port with your VPN provider.

 

The second option means the VPN provider will allocate you a port number, you will need to provide them with the local Emby port number (it will be 8096 if you haven't changed it, can be found in Server Settings > Advanced > Local HTTP port number). They will then redirect any traffic coming in on your allocated port to your real IP address and local port number. For example (yes these IP addresses are nonsense):

 

My real IP is 123.321.123.321, local Emby port is 8096. My VPN IP is 456.654.456.654, and I've been allocated port 12345 by my VPN provider. When working remotely I would need to connect to 456.654.456.654:12345, which then goes through to the VPN provider, who identify port 12345 as yours, and redirect the traffic to 123.321.123.321:8096, which Emby then picks up and communicates back using the same route.

 

I too have used VPN Unlimited before and I couldn't find any way to set up a static port with them.

Link to comment
Share on other sites

  • 5 months later...
bernado99

Emby identifies your server by it's IP address, so when you attempt to connect to it remotely, either using the IP or an assigned Emby account, it will attempt to find the server using the IP address and server port. If you have a VPN running, Emby will pick up your VPN IP and not your real one, so when you attempt to connect remotely it will try to reach your server using the disguised IP, which is of course wrong. There are two ways to get round this, either you stop the VPN running or try to set up a bypass for Emby to get around the VPN (so it will run using your real IP address), or you can try to set up a static port with your VPN provider.

 

The second option means the VPN provider will allocate you a port number, you will need to provide them with the local Emby port number (it will be 8096 if you haven't changed it, can be found in Server Settings > Advanced > Local HTTP port number). They will then redirect any traffic coming in on your allocated port to your real IP address and local port number. For example (yes these IP addresses are nonsense):

 

My real IP is 123.321.123.321, local Emby port is 8096. My VPN IP is 456.654.456.654, and I've been allocated port 12345 by my VPN provider. When working remotely I would need to connect to 456.654.456.654:12345, which then goes through to the VPN provider, who identify port 12345 as yours, and redirect the traffic to 123.321.123.321:8096, which Emby then picks up and communicates back using the same route.

 

 

 

Bit of a rave from the grave but this thread describes perfectly my scenario, i.e. Emby server is behind a VPN running on the same machine (Ubuntu in my case) as in the bold above.

I can connect remotely typing the IP address of the VPN and the allocated port in a browser just fine, it would be nice though if I could connect remotely via Emby Connect as I used to be able before.

 

Is this possible via some tinkering with the Emby server settings rather than me having to remember the VPN address and port number if I'm outside the LAN?

 

Thanks

Edited by bernado99
Link to comment
Share on other sites

bernado99

@@bernado99 have you tried setting up emby connect?

 

Hello Luke,

 

I've tried setting Emby connect again via my user name field in the server dashboard, it had my user name already noted so tried entering my associated email address in case that reset the process but it errors.

 

I get as far as the select server screen via Connect remotely but on selection it times out.

 

I feel I'm missing something in the public server settings regarding incoming port numbers though don't know what.

 

The VPN provider didn't need to know my Emby port which seems odd so this may be the element that's missing, does this suggest my external Emby server traffic is passing through the VPN server rather than being redirected back to my IP adress/port number?

Edit: Forget the above, the local port is listed in the VPN configs so more a case of me being forgetful rather than voodoo!

 

The biggest challenge here is my limited understanding how these things work to be honest, so thanks in advance for your patience!

 

Thanks

Edited by bernado99
Link to comment
Share on other sites

bernado99

Thanks for that, seems pretty much the same as how my provider config works.

 

I see the VPN address listed in Emby's remote address field so maybe I just need to re-link Emby Connect, once I've figured how to do that!

I'm assuming the public port should remain at the default listening port and not the allocated forwarded port from my VPN?

 

Thinking this through more now could this be a firewall issue? I guess I need to check incoming traffic rules for the allocated port number which is something I haven't done.

 

Thanks

Link to comment
Share on other sites

bernado99

I didn't change anything in the server. It's all default.

 

It's got to be a firewall thing then, I stupidly didn't consider that but pretty obvious really

Link to comment
Share on other sites

Guest asrequested

Thanks for that, seems pretty much the same as how my provider config works.

 

I see the VPN address listed in Emby's remote address field so maybe I just need to re-link Emby Connect, once I've figured how to do that!

 

Thanks

Your account needs to be linked.

Link to comment
Share on other sites

bernado99

Your account needs to be linked.

 

My account is already linked via Emby connect, shouldn't any change to server IP address be adjusted by Connect automatically once that change is noted by the Emby Server itself (the server's public IP field has the VPN server IP address entered)?

 

I think I'm confusing myself with the firewall thing as it clearly is letting traffic in remotely, albeit via the IP address rather than Emby Connect, so it can't be that after all.

Link to comment
Share on other sites

Guest asrequested

The address in the dashboard is the address emby connect, uses. Can you connect using the VPN address, manually? Or can you not connect, at all?

Link to comment
Share on other sites

bernado99

The address in the dashboard is the address emby connect, uses. Can you connect using the VPN address, manually? Or can you not connect, at all?

Yes I can connect remotely just fine using the VPN address + allocated port.

Link to comment
Share on other sites

Guest asrequested

If you turn the VPN off, restart the server, and restore the original IP, are you able to connect through emby connect?

Link to comment
Share on other sites

bernado99

I'm happy to say I've sorted it now.

 

For the benefit of anyone as dumb as me if happening upon this thread when looking for solutions - on Emby server the public IP address and public HTTP port do need to be set to the VPN Server address/allocated port number.

 

I'm pretty sure I had tried that but maybe I didn't restart the server when I did, however now all is well.

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...
t34wrj

I've been trying to get Emby remote access working whilst running the PIA VPN.

 

Without any VPN connection active, I am able to access Emby remotely. I have since tried to set-up the VPN with Emby as follows:

 

  1. Port forwarding is enabled on the PIA VPN client, with local port set to 8096;
  2. In Emby server settings, public HTTP port is set to the forwarded port in PIA VPN (e.g. 32281);
  3. In Emby server settings, external domain is set to the PIA VPN ip address (e.g. 203.123.4.89).

In the dashboard, the remote WAN access address is shown as 203.123.4.89:32281 - However, this doesn't allow my Emby server to be accessed remotely,

 

Does anyone know where I'm going wrong here?

 

Thanks for your help.

Link to comment
Share on other sites

d00zah

I've been trying to get Emby remote access working whilst running the PIA VPN.

 

Without any VPN connection active, I am able to access Emby remotely. I have since tried to set-up the VPN with Emby as follows:

 

  1. Port forwarding is enabled on the PIA VPN client, with local port set to 8096;
  2. In Emby server settings, public HTTP port is set to the forwarded port in PIA VPN (e.g. 32281);
  3. In Emby server settings, external domain is set to the PIA VPN ip address (e.g. 203.123.4.89).

In the dashboard, the remote WAN access address is shown as 203.123.4.89:32281 - However, this doesn't allow my Emby server to be accessed remotely,

 

Does anyone know where I'm going wrong here?

 

Thanks for your help.

 

I use PIA (on demand, in a VM) & port forwarding has some restrictions. You might want to read this:

 

https://www.privateinternetaccess.com/forum/discussion/22323/which-servers-support-port-forwarding-and-which-have-auto-port-fw

 

& do some experimenting to see how it would apply in this case.

Link to comment
Share on other sites

t34wrj

I use PIA (on demand, in a VM) & port forwarding has some restrictions. You might want to read this:

 

https://www.privateinternetaccess.com/forum/discussion/22323/which-servers-support-port-forwarding-and-which-have-auto-port-fw

 

& do some experimenting to see how it would apply in this case.

 

Thanks for this. I have already connected to a server that allows port forwarding and when I move my mouse pointer over the PIA VPN client icon, it confirms the port that is being forwarded (which is port 32281 in the above post).

Link to comment
Share on other sites

d00zah

I just tested/verified my VM PIA config & it's similar to yours, but I don't open my Emby server to external access so I can't test directly.

I do, however, have some observations you might want to verify...

 

- The server IP's last octet changes each time the PIA client connects... make sure the Emby config is current.

- In my VM, 'Connection type' is set to 'UDP', which works for P2P. Have you tried 'TCP'? Unsure what Emby requires.

- Occasionally, it can take ~ a minute for the P2P client to report an open port... how quickly are you trying to

   connect after connection is established?

 

'fraid that's all I've got. Good luck!

Link to comment
Share on other sites

t34wrj

I just tested/verified my VM PIA config & it's similar to yours, but I don't open my Emby server to external access so I can't test directly.

I do, however, have some observations you might want to verify...

 

- The server IP's last octet changes each time the PIA client connects... make sure the Emby config is current.

- In my VM, 'Connection type' is set to 'UDP', which works for P2P. Have you tried 'TCP'? Unsure what Emby requires.

- Occasionally, it can take ~ a minute for the P2P client to report an open port... how quickly are you trying to

   connect after connection is established?

 

'fraid that's all I've got. Good luck!

 

Thanks for this. I have tried switching to TCP, put it won't connect when I set the local port in the VPN client options as 32281.

 

The Emby config is current and I've tried to connect for a long period of time now without success.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...