Welcome to the Linux Foundation Forum!

Can't Access Nginx in Docker on Google Cloud VM

Options

I've created a Google Cloud VM (Ubuntu 24.04)

Installed Docker and successfully ran Nginx containers:

__docker run -d -p 8080:80 nginx
Verified Nginx is running inside containers:

__curl -v http://localhost:8080 # Works in SSH
The Issue:

Can't access Nginx from my local browser using:

http://:8080 → Connection refused tho I've used the External IP address of the instance

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Answers

  • Lab 2. Getting Started with Docker

  • Im facing a lot of troule due to location and region in using VM Google cloud provider what other solution can I use

  • Posts: 2,352

    Hi @norahalrajhii,

    What course is this related to?

    Regards,
    Flavia
    Linux Foundation Education

  • Posts: 2,481
    edited July 15

    Hi @norahalrajhii,

    Make sure you use the public IP of the GCE VM, and not the private IP. That should work in your local browser, and from your local terminal as well.
    Is the workstation your own, or a company workstation? Are you behind a firewall or a proxy (company/work, school/university, ISP)?

    You can use other cloud providers such as AWS, Azure, Digital Ocean, Alibaba cloud, Vultr cloud, IBM cloud, Oracle cloud - or any other cloud provider that offers the VM as a service.
    You can also run docker on a local VM, with hypervisors such as VirtualBox, QEMU/KVM, VMware Workstation/Player, etc...

    Regards,
    -Chris

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training