Here's a step-by-step walkthrough for all three tasks. You can do this via the Console (Cloud Shell commands included as a faster alternative for each step).
Task 1: Create the Cloud Storage bucket
Console:
- Go to Cloud Storage → Buckets → Create
- Name:
qwiklabs-gcp-01-f44fa838a767-bucket - Location type: Multi-region → select US
- Leave storage class as Standard, access control as default
- Click Create
Or via Cloud Shell:
gcloud storage buckets create gs://qwiklabs-gcp-01-f44fa838a767-bucket --location=USClick Check my progress after it's created.
Task 2: Create the VM + persistent disk
Step A — Create the VM
Console:
- Go to Compute Engine → VM instances → Create Instance
- Name:
my-instance - Region:
us-west1, Zone:us-west1-a - Machine configuration: Series E2, Machine type e2-medium
- Boot disk → Click Change:
- Operating system: Debian
- Version: Debian GNU/Linux 12 (bookworm)
- Boot disk type: Balanced persistent disk
- Size: 10 GB
- Click Select
- Under Firewall, check Allow HTTP traffic
- Click Create
Or via Cloud Shell:
gcloud compute instances create my-instance \
--zone=us-west1-a \
--machine-type=e2-medium \
--image-family=debian-12 \
--image-project=debian-cloud \
--boot-disk-type=pd-balanced \
--boot-disk-size=10GB \
--tags=http-serverStep B — Create the persistent disk
Console:
- Go to Compute Engine → Disks → Create Disk
- Name:
mydisk - Region:
us-west1, Zone:us-west1-a(must match instance zone) - Disk type: Standard/Balanced (either works, requirement doesn't specify)
- Size: 200 GB
- Click Create
Or via Cloud Shell:
gcloud compute disks create mydisk \
--size=200GB \
--zone=us-west1-aStep C — Attach the disk to the instance
Console:
- Go to Compute Engine → VM instances
- Click my-instance → click Edit
- Under Additional disks, click Attach existing disk
- Select
mydisk - Click Save
Or via Cloud Shell:
gcloud compute instances attach-disk my-instance \
--disk=mydisk \
--zone=us-west1-aClick Check my progress after attaching.
Note: attaching the disk doesn't format/mount it — that's not required by the task, just attachment. If you want it usable inside the OS, you'd need to SSH in, format it, and mount it, but the lab only asks you to attach it.
Task 3: Install NGINX
- In the Console, go to Compute Engine → VM instances
- Click the SSH button next to
my-instanceto open a browser SSH session - Run the following commands:
sudo apt-get update
sudo apt-get install -y nginx
sudo systemctl status nginx- Confirm the output shows
active (running). If it's not started:
sudo systemctl start nginx
sudo systemctl enable nginxClick Check my progress.
Test the web app
- Go back to Compute Engine → VM instances
- Click the External IP link next to
my-instance(or copy it into a new tab ashttp://EXTERNAL_IP/) - You should see the "Welcome to nginx!" default page
If it doesn't load:
- Confirm you selected Allow HTTP traffic on the VM (edit the instance and check the firewall checkbox if missed — this creates a firewall rule allowing port 80 from tag
http-server) - Confirm NGINX is running (
sudo systemctl status nginx)
That covers all three tasks and the final verification. Let me know if any "Check my progress" step comes back red and I can help troubleshoot.
Post a Comment
Post a Comment