How to open port 80 on Windows 10 machine?


#1

Hi my name is Pavel! I’m new on Paperspace. I’m trying to setup R server with my trained model on Windows 10 machine. On localhost all works well, but I can’t connect to server with public IP (IP was paid).

I tried to setup firewall rule, disable firewall and defender — it is not working for me.
Do you have any tutorial about it?


#2

@pavelkuligin I can’t think of anything obvious but here are a few things to check:

  • Confirm the instance is responding to ping
  • Double check you are using the public IP (be sure you’re not using the private IP)
    image
  • Another thing to check is the port (if specified). You can actually see what ports are open using a port checker. Just make sure the server is actually listening when testing the ports.

#3

Hi Daniel!

Unfortunately, all your points were checked…

  1. Ping is OK
  2. I’m using Public IP address
  3. Portchecker said that: “Port 80 (and 8080) is closed”. Port is listening also.

Any thoughts?


#4

If the machine is responding to ping, than it looks like it’s a software configuration issue. I can try to do a bit of testing if I have some time. Could you send along the install steps?


#5
  1. Install R and RStudio
  2. From RStudio run Plumber on port 80
  3. Go to Chrome: http://localhost/predict — all works fine
  4. Go to Portchecker, check 80 and that said “Port 80 is closed”
  5. Go to http://184.105.162.108/predit from another computer — no answer
  6. Tried some tricks with Firewall and Windows Defender — no lucky

#6

@pavelkuligin Got it working. Plumber only listens on 127.0.0.1:8000 for security reasons.

You need to specify a host:

library(plumber)
r <- plumb(“api.R”)
r$run(host = “0.0.0.0”, port = 8000)

FYI, I did need to create an inbound firewall rule to allow TCP traffic on that port, in this case 8000. That takes two seconds under the “Windows Firewall with Advanced Security” > “Inbound Rules” > “New Rule…”