Welcome to the Linux Foundation Forum!

Can't Access Nginx in Docker on Google Cloud VM

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

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

  • fcioanca
    fcioanca Posts: 2,364

    Hi @norahalrajhii,

    What course is this related to?

    Regards,
    Flavia
    Linux Foundation Education

  • chrispokorni
    chrispokorni Posts: 2,487
    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

  • yess is was the company firewall that was blocking it traffic thank u

  • luisviveropena
    luisviveropena Posts: 1,284

    Hi @norahalrajhii,

    I'm glad to know that the issue was solved.

    Regards,
    Luis.

Categories

Upcoming Training