Open In App

How to Install Go on AWS EC2?

Improve
Improve
Like Article
Like
Save
Share
Report

EC2 or Elastic Compute Cloud is a scalable computing service launched on the AWS cloud platform. In simpler words, EC2 is nothing but a virtual computer on which we can perform all our tasks and we have the authority to configure, launch or even dissipate this virtual computer.Go is an open-source, statically typed, compiled programming language developed by Google. It is also referred to as Golang. It should be clear, assertive, legible, and strong.

 Go on AWS EC2:

You must first understand how to establish an EC2 instance on AWS in order to install GO on AWS EC2.

Steps to create EC2 Instance:

For this article, we will set up an Amazon Linux EC2 instance.

Step 1. Login to your AWS account. In case you don’t have one, create a free-tier account and get started.

sign in console

 

Step 2. After successful sign-in, search EC2 in the search space and hit enter.

search ec2

 

Step 3. After opening the EC2 instance, click on Launch Instances.

launch instance

 

Step 4. After Clicking Launch Instances, enter a name for your instance and select ubuntu for Linux EC2 instance.

Naming instance

 

Step 5. For key-pair use the default one,

key pair

 

Step 6. And let all other options be set to default. Changing other values unnecessarily may void the free tier and may be charged based on usage.

 

Step 7. After checking all the details, click on Launch Instance in the bottom right.

 

Step 8. We successfully created an Amazon Linux Ec2 instance on AWS. It can be checked by clicking on Instances, here all the created instances would be featured. Checking for running status for confirmation.

Now you can connect to the created instance by checking on it and clicking on connect.

 

Step 9. Connect to Instance my_server-linux.

 

                                                        Voila!!!! So with this our Linux EC2 instance is set and running on AWS.

Install Go on this EC2 instance:

On the EC2 Linux instance terminal, run the following command :

$ sudo apt install golang-go

Type YES when prompted. 

In case you get an error, run the below command and try again:

$ sudo apt-get update
Go installed

 

To confirm the installation you can try checking the GO version:

$ go version
GO version

 

We successfully installed GO on the Amazon EC2 instance.


Last Updated : 28 Mar, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads