How do I host my localhost:8080 application on the cloud behind a VPN?

212 views Asked by At

Sorry in advance for asking for such a large amount of hand-holding. This is not my domain and I am having a slow time learning the tools of the trade.

What I have

I have a nifty wt application wrapped in a docker image. I am able to connect to it with localhost:8080 and it runs smoothly.

What I want

I want to create a simple cloud server that runs this application. I want my coworkers to be able to connect to it and no one else. This will not be high traffic so I do not plan to consider scaling issues for now.

Naive Plan

  1. Spin up a VM on google cloud with public IP?
  2. Run my application on the VM on port 8080?
  3. Run OpenVPN on the same VM and somehow point it at 8080?

I don't know anything about steps 2 or 3 so any pointers will be helpful. Don't worry about coming off condescending because I can assure you that I know nothing about networking. Thanks for your patience in dealing with a novice.

1

There are 1 answers

3
David Min On

I don't see how a VPN helps you achieve access control. Usually you would secure the connection by setting up network rules on your virtual network that your VM is connected to. Otherwise, you could have a server that runs on that VM (e.g. nginx) that have rules (nginx config) that will filter incoming requests.