How to port forward Google Compute Engine Instance?

Viewed 17480

I've set up a VPS using the Google Compute Engine platform. In the instance, I've established a MongoDB database that's being locally hosted at the default port 21017. I've also set up a REST API based NodeJS server with express listening in on connections at port 8080.

Right now, I can only access the NodeJS site internally. How do I expose the VPS port 8080 to the external ip address so that I can access the API anywhere?

I tried following along an answer to this post: Enable Access Google Compute Engine Instance Via HTTP Port.

But that did not solve my issue

2 Answers
gcloud compute ssh --ssh-flag="-L 10000:localhost:10000" root@machine_name
Related