{"id":145,"date":"2023-04-02T16:22:34","date_gmt":"2023-04-02T14:22:34","guid":{"rendered":"https:\/\/www.mutareb.com\/?p=145"},"modified":"2023-04-02T22:10:20","modified_gmt":"2023-04-02T20:10:20","slug":"run-a-vps-on-aws-ec2","status":"publish","type":"post","link":"https:\/\/www.mutareb.com\/index.php\/2023\/04\/02\/run-a-vps-on-aws-ec2\/","title":{"rendered":"Run a VPS on AWS EC2"},"content":{"rendered":"\n<p>Go to AWS EC2, create a new instance, then on the Dashboard of this instance, click on Key pairs in the resources card and create a new ssh key pair. Just change format to pem:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"640\" src=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-4.png\" alt=\"\" class=\"wp-image-151\" srcset=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-4.png 825w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-4-300x233.png 300w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-4-768x596.png 768w\" sizes=\"auto, (max-width: 825px) 100vw, 825px\" \/><\/figure>\n\n\n\n<p>The key will be downloaded automatically. It can now be uploaded to cloud9 environment. Just switch over to cloud9, click on File and upload, then upload the new key.<\/p>\n\n\n\n<p>Now we need to open the 22 and 80 ports on the newly created VPS, go back to EC2, resources card and click on security groups and create a new security group with 2 inbound rules for ports 22 and 80:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"245\" src=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-1024x245.png\" alt=\"\" class=\"wp-image-147\" srcset=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-1024x245.png 1024w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-300x72.png 300w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-768x184.png 768w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-1536x368.png 1536w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-1568x375.png 1568w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik.png 1604w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next we need to create a spot request and ensure it&#8217;s using the newly created SSH key:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"513\" src=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-1-1024x513.png\" alt=\"\" class=\"wp-image-148\" srcset=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-1-1024x513.png 1024w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-1-300x150.png 300w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-1-768x385.png 768w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-1.png 1114w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>activate the newly created security group to be able to ssh into the server:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"746\" src=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-2-1024x746.png\" alt=\"\" class=\"wp-image-149\" srcset=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-2-1024x746.png 1024w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-2-300x219.png 300w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-2-768x560.png 768w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-2.png 1077w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>We can now find the new instance under &#8220;Instances&#8221; menu point, it&#8217;s be to rename it to be able to easily identify it later, then click on connect, which will give the instruction to connect to the VPS from cloud9 shell:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"303\" src=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-3-1024x303.png\" alt=\"\" class=\"wp-image-150\" srcset=\"https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-3-1024x303.png 1024w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-3-300x89.png 300w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-3-768x227.png 768w, https:\/\/www.mutareb.com\/wp-content\/uploads\/2023\/04\/grafik-3.png 1356w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Follow the instructions to connect via ssh to the server instance<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go to AWS EC2, create a new instance, then on the Dashboard of this instance, click on Key pairs in the resources card and create a new ssh key pair. Just change format to pem: The key will be downloaded automatically. It can now be uploaded to cloud9 environment. Just switch over to cloud9, click&hellip; <a class=\"more-link\" href=\"https:\/\/www.mutareb.com\/index.php\/2023\/04\/02\/run-a-vps-on-aws-ec2\/\">Continue reading <span class=\"screen-reader-text\">Run a VPS on AWS EC2<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[32,34],"series":[35],"class_list":["post-145","post","type-post","status-publish","format-standard","hentry","category-cloud-computing","tag-aws","tag-ec2","series-cloud-computing","entry"],"_links":{"self":[{"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/posts\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/comments?post=145"}],"version-history":[{"count":2,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/posts\/145\/revisions"}],"predecessor-version":[{"id":152,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/posts\/145\/revisions\/152"}],"wp:attachment":[{"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/media?parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/categories?post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/tags?post=145"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.mutareb.com\/index.php\/wp-json\/wp\/v2\/series?post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}