Learning Cloud-Deploy a web server VM instance with Startup script

Опубликовано: 02 Июнь 2026
на канале: Cyethack Solutions
289
3

In the GCP Console, on the Navigation menu (Navigation menu), click Compute Engine -- VM instances.

Click Create Instance.

On the Create an Instance page, for Name, type bloghost

For Region and Zone, select the region and zone assigned by Qwiklabs.

For Machine type, accept the default.

For Boot disk, if the Image shown is not Debian GNU/Linux 9 (stretch), click Change and select Debian GNU/Linux 9 (stretch).

Leave the defaults for Identity and API access unmodified.

For Firewall, click Allow HTTP traffic.

Click Management, security, disks, networking, sole tenancy to open that section of the dialog.

Enter the following script as the value for Startup script:

apt-get update
apt-get install apache2 php php-mysql -y
service apache2 restart
Be sure to supply that script as the value of the Startup script field. If you accidentally put it into another field, it won't be executed when the VM instance starts.

Leave the remaining settings as their defaults, and click Create.
Instance can take about two minutes to launch and be fully available for use.

On the VM instances page, copy the bloghost VM instance's internal and external IP addresses to a text editor for use later in this lab.
Click Check my progress to verify the objective.