This guide will teach you how to set up a google cloud server to run different services. Follow the procedure below to set up a Virtual machine on the google cloud.
You need a google account (Gmail Id) to use the cloud services. Go to the official website to register yourself and use the services free of cost for a limited time, about three months.
Click the Go to Console button to go to the dashboard for the cloud services. Now we’ll set up a virtual machine service. Click the three dots icon for the Navigation menu at the top left corner of the screen. Scroll to the Compute section, point your cursor on the Compute Engine tab, and click the VM Instances option.
Now to create a new server, click the plus icon representing “Create Instance”.
Now enter the details like the instance’s Name, Label, Region, and Zone; on the machine configuration section, you can choose a configuration depending on your purpose and requirements. Four configurations are available, i.e. General-Purpose, Compute-optimized, Memory-Optimized and GPU. Choose a Higher CPU machine if your application is CPU intensive.
Then select the boot disk (operating system) for the virtual machine, select boot disk type like Balanced, SSD and set the disk space to at least 20 GB.
After that, choose the Firewall, and there are two options HTTP(port 80) and HTTPS(port 443). Check the boxes for both options and press the create button.
Once the virtual machine is created, you’ll get the External IP address. To make any changes, stop or suspend the VM, click the instance’s name, and all details will be visible.
Click the dropdown arrow for the SSH button in the Connect column to access or open the SSH terminal differently.
Now open the SSH terminal on the browser and execute commands to check the machine’s working. If you want to connect it to the system’s terminal, add the SSH key to this server. First, create an SSH key if you haven’t created one. Open the terminal on your system and print the SSH key to copy it using the following command:
Now come back to the virtual machine and create a new directory by running the following command:
Now paste the public key into the Authorized_keys file inside the ssh folder. Save and exit the file using this command;
Come to the system’s terminal and run the following command to connect to the server.
“Tech_work” is the username assigned by Google cloud.
Now you can control the virtual machine, add a new user and install the software. The default account provided by google cloud can only have temporary login access, so it is mandatory to create a new account once you log in using the default account. So, setting up a virtual machine on the google cloud platform is quite simple and useful.