In this tutorial, I will show you how to deploy app to . You will need an AWS account. . Golang Amazon EC2 You can signing up for free 1 — Setup EC2 instance Once you created you account, open the and click on : AWS Management Console EC2 Then, click on “ ” : Launch Instance Choose an ( ). We are going to choose “ ” . The exact versions may change with time. AMI Amazon Machine Image Amazon Linux AMI 2017.03.1 5 (HVM), SSD Volume Type : There are other Linux s that you can use, which have and other software pre-installed, which you may use as a shortcut later. But for our purposes, if you start with a clean installation and configure everything yourself, you’ll be able to better understand how to administer and maintain your instances in future. Note AMI Go Next, we will choose the hardware configuration for our instance. So we will go with the lowest specs and cheapest configuration “ ” which is enough for this tutorial: t2.micro Then click on “ ”. We left everything as default then click on “ ” Configure Instance Details Add Storage Next, click on “ ” to assigne a name to our instance: Add Tags Click on “ “. Then expose the port number your server will be listening on. For this demo, I have made an application which is listening on port 3000, Therefore, I enabled and I set the column to ‘ ’ . Configure Security Group HTTP port 3000 source Anywhere 0.0.0.0/0 The settings above allows access to port from , and only from 3000 anywhere SSH access anywhere. Now, click on “ ” then “ “. Review And Launch Launch When prompted for a , you can either choose an existing key pair or create a new key pair. Save the in a safe place. You’ll need to connect by to your instance later. key pair private key file SSH When you’re ready, select “ ”: Launch Instances Your instance is now launching and that may take a few minutes. Click the link and you will be redirected to your “ ” page, where you can monitor and configure your EC2 instance: View your instances on the Instances page My Instances Wait until the instance state turns to “ ” then use the to connect to your service via . running public DNS SSH 2 — Connect to AWS EC2 via SSH Now that we have connected to the instance, it’s time to install . Golang 3 — Install Golang on EC2 Once you’re connected to the instance, use configuration manager to install : yum Go sudo yum update -y sudo yum install -y golang Now you need to set up for your project. Commonly you need to set 3 environment variables as , and Go environment variables GOROOT GOPATH PATH Note: all above commands will set the environment variables for your current session only. To make it permanent add above commands in file ‘~/.bash_profile’ At this step you’ve successfully installed and configured go language on your system. Congratulation ! you have a working EC2 instance with Go. 4 — The Go Application Note: You can skip this step if you have your own Go App ready to be deployed. Put the following content in a file named “ ” : app.go Run the app using the following commands: go run app.go Finally, if you point your favorite web browser (not you IE) at your instance’s you should see : public DNS name Congratulation ! you have deployed your first App to instance. Go AWS EC2 : In case your app is listening on different port than 3000, you can always add it to the security group assigned to your EC2 instance. Just go to EC2 menu, then click on “ ” Note Security groups Click on “ ” and follow the same steps described in of this tutorial. Edit first section 5 — Clean Up your instance After you’ve finished with the instance that you created for this tutorial, you should clean up by terminating the instance.