This AMI is a LAMP Web Server with phpMyAdmin installed on Ubuntu 22.04. Package include Linux, Apache2, MySQL, and phpMyAdmin.
This AMI supports following versions.
PHP 8.1
Apache 2.4
MySQL 8.0
phpMyAdmin 8.1
Web Server
We prepared SSL/TLS so you can access to top page using http:// or https://.
Create VM instance
We recommend using minimum machine type e2-standard-8 for this LAMP server. For more machine types please refer to GCP General purpose machines documentation.
DB Server Password
You can find the password from VM management console System Log
- Go to GCP VM2 console at https://console.cloud.google.com/logs/.
- Chose your Instance and click on the three-dot menu → View logs

Get MySQL root password

Troubleshooting MySQL Root Password
If the root user’s password isn’t showing up in the console, you can reset it by following these steps:
Step 1: Switch to Root User
Open your terminal and execute the following command to become the root user:
$ sudo su -
Step 2: View debian-sys-maint User and Password
Execute this command to display the Debian System Maintenance (debian-sys-maint) user and its password:
# cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = **************
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = **************
socket = /var/run/mysqld/mysqld.sock
Note down the debian-sys-maint user’s password for use in the next step.
Step 3: Connect to the Local MySQL Server
Use the debian-sys-maint
credentials to connect to your MySQL server:
# mysql -u debian-sys-maint -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.32-0ubuntu0.22.04.2 (Ubuntu)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Note down the debian-sys-maint user’s password for use in the next step.
Step 4: Reset Root User Password
Inside the MySQL interface, execute the following command to reset the root user password. Replace 'yourpassword'
with your desired password.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword';
mysql> exit
Step 5: Verify Root User Login
Finally, validate that you can log in with the new root user password:
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 8.0.32-0ubuntu0.22.04.2 (Ubuntu)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
External IP address
Note the external IP from VM instance console

You can access to Apache Ubuntu by accessing http://{externalIP}/
.
When you access Google Chrome with warning.


Click anywhere on the browser and type thisisunsafe
to bypass when there is no danger to your connection.
Then this default welcome page will show ups

phpMyAdmin
You can access to phpMyAdmin at http://{externalIP}/phpMyAdmin.

For phpMyAdmin please refer to phpMyAdmin User Guide
Disable Unattended Upgrades
Unattended Upgrades Are Turned On by default. If you want to turn unattended upgrades off please following this instruction:
- Run sudo dpkg-reconfigure -plow unattended-upgrades and select “No” when Configuring unattended-upgrades prompted, OR
- sudo apt remove unattended-upgrades to remove
Reference
- Ubuntu
- phpMyAdmin User Guide
- How to Set up SSH Tunneling (Port Forwarding)
- GCP General purpose machines
- How to Ensure Ubuntu’s Unattended Upgrades Are Turned On
- How To Disable Unattended Upgrades On Ubuntu
- How do I stop/disable unattended upgrades from being launched automatically? [duplicate]