{"id":11,"date":"2022-06-19T19:44:36","date_gmt":"2022-06-19T19:44:36","guid":{"rendered":"https:\/\/roblsmith.co.uk\/blog\/?p=11"},"modified":"2022-07-11T21:41:54","modified_gmt":"2022-07-11T21:41:54","slug":"moving-from-cheap-webhosting-to-a-self-hosted-solution","status":"publish","type":"post","link":"https:\/\/roblsmith.co.uk\/blog\/2022\/06\/moving-from-cheap-webhosting-to-a-self-hosted-solution\/","title":{"rendered":"Moving from cheap webhosting to a self-hosted solution"},"content":{"rendered":"\r\n<p>After ten years of using my cheap webhost I have finally took the plunge and decided to utilise my day-job skills, and move my website to AWS. If you&#8217;re interested in knowing how to self host your own blog for only \u00a33.50 per month, read on&#8230;<!--more--><\/p>\r\n<p>So firstly, I tell a lie, the hosting is only \u00a33.50 a month &#8211; which for dedicated hosted, is cheap! Usually for that price you&#8217;d be using a shared hosting solution, which can be both slow and unreliable. There is another cost, which is your domain, normally \u00a37.50 &#8211; \u00a310 per year for a basic .co.uk or .uk domain. But that extra cost equates to what, a can of coke a month? But I digress..\u00a0<\/p>\r\n<p>Firstly you&#8217;ll need to signup to AWS, and I would highly recommend that you use a STRONG password followed by using MFA. You wouldn&#8217;t want your account getting compromised and someone running some expensive EC2 instances&#8230;With that I would also setup budget alerts. An alert for $10 should be sufficient. <em>(inb4 $, yes, AWS is American<\/em>)<\/p>\r\n<ol>\r\n<li>Once you are logged in, search for the &#8220;Lightsail&#8221; service<br \/><br \/><img loading=\"lazy\" class=\"aligncenter wp-image-155 size-large\" src=\"http:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls5-1024x233.png\" alt=\"\" width=\"525\" height=\"119\" srcset=\"https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls5-1024x233.png 1024w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls5-300x68.png 300w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls5-151x34.png 151w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls5-768x175.png 768w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls5-320x73.png 320w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls5.png 1072w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><br \/><br \/><\/li>\r\n<li>We&#8217;re going to change the availability zone to London &#8211; or the country closest to you<\/li>\r\n<li>Run your image using Linux<\/li>\r\n<li>Select &#8220;Wordpess&#8221; as your install option &#8211; not multisite<br \/><br \/><img loading=\"lazy\" class=\"aligncenter wp-image-138 size-full\" src=\"http:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls1.png\" alt=\"\" width=\"533\" height=\"831\" srcset=\"https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls1.png 533w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls1-192x300.png 192w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls1-97x151.png 97w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls1-154x240.png 154w\" sizes=\"(max-width: 533px) 100vw, 533px\" \/><\/li>\r\n<li><span style=\"font-size: 1rem;\">For now, choose the $3.50 p\/month package, but you can always upgrade later if you find speeds slow or the instance is underperforming<\/span><\/li>\r\n<li>Give your instance a name.<\/li>\r\n<li>Click create (the key tags can be ignored)<br \/><img loading=\"lazy\" class=\"aligncenter wp-image-139 \" src=\"http:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls2.png\" alt=\"\" width=\"527\" height=\"605\" \/><\/li>\r\n<li>It won&#8217;t take look for AWS to spin up our instance. Under instances once created, we are going to want to ensure the IP address is static, click the hamburger menu and click &#8220;manage&#8221; and click the network tab.\u00a0<br \/><br \/><img loading=\"lazy\" class=\"aligncenter wp-image-142 size-full\" src=\"http:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls3.png\" alt=\"\" width=\"412\" height=\"220\" srcset=\"https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls3.png 412w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls3-300x160.png 300w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls3-151x81.png 151w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls3-320x171.png 320w\" sizes=\"(max-width: 412px) 100vw, 412px\" \/>There will be a big button which says &#8220;Create static IP&#8221;, click that. It should then assign that IP to the instance. Therefore if it was to ever reboot, it still has the same IP.\u00a0<br \/><br \/><\/li>\r\n<li>Using that IP we can visit the WordPress blog, but first, we need to find the password to login.\u00a0<br \/><br \/>On the previous screenshot is the hambuger menu. There is a option called &#8220;Connect&#8221; clicking that will open a terminal window. The password is stored within a file called &#8220;bitnami_application_password&#8221; is you cat this file <code>cat bitnami_application_password<\/code> it will output the password to login to WordPress (remember to change this)\u00a0<br \/><br \/><\/li>\r\n<li>\u00a0Now what good is an IP address for a website, well for humans&#8230; we&#8217;re going to need to point a domain to it. Now I use a registrar outside AWS.\u00a0<br \/><br \/>On the main Lightsail we need to click the &#8220;Networking&#8221; tab and create a DNS Zone for your domain, e.g. if it was myblog.xyz, you would type that in here.<br \/><br \/>You would then click &#8220;create DNS Zone&#8221; and take note of the nameservers it outputs, you would them use them on your domain&#8217;s registrar domain manager whoever it asks you to input them.\u00a0<br \/><br \/><\/li>\r\n<li>\u00a0On the networking tab, click the hamburger menu on the global DNS zone and click manage. Here we can add a new A Record to point the domain to the static IP.\u00a0<br \/><br \/>Click &#8220;Add record&#8221; and use <code>@<\/code> as the subdomain to point the main website, then for IP, it should automatically suggest the IP address as the static IP.\u00a0<br \/><br \/><img loading=\"lazy\" class=\"alignnone wp-image-145 size-full\" src=\"http:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls4.png\" alt=\"\" width=\"655\" height=\"226\" srcset=\"https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls4.png 655w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls4-300x104.png 300w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls4-151x52.png 151w, https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/ls4-320x110.png 320w\" sizes=\"(max-width: 655px) 100vw, 655px\" \/><br \/>Once this is saved and propagated, you should be able to visit your website through a domain.\u00a0\u00a0<br \/><br \/><\/li>\r\n<li>\u00a0Your next step would be to install HTTPS \/ SSL via LetsEncrypt! AWS have a guide on this <a href=\"https:\/\/lightsail.aws.amazon.com\/ls\/docs\/en_us\/articles\/amazon-lightsail-using-lets-encrypt-certificates-with-wordpress\">here<\/a>\u00a0<br \/><br \/><\/li>\r\n<li>Happy blogging!<\/li>\r\n<\/ol>\r\n<p>&nbsp;<\/p>\r\n<p><em>Note &#8211; my first AWS bill was 17p &#8211; this is because I was also running a couple of snapshots. These do have a minimal extra cost, and maybe a tad more outside the free tier.<\/em><\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>After ten years of using my cheap webhost I have finally took the plunge and decided to utilise my day-job skills, and move my website to AWS. If you&#8217;re interested in knowing how to self host your own blog for only \u00a33.50 per month, read on&#8230;<\/p>\n","protected":false},"author":2,"featured_media":153,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"spay_email":""},"categories":[7],"tags":[17,18,16],"jetpack_featured_media_url":"https:\/\/roblsmith.co.uk\/blog\/wp-content\/uploads\/2022\/06\/amazon_lightsail_blog_post-e1657575220778.jpg","_links":{"self":[{"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/posts\/11"}],"collection":[{"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":27,"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/posts\/11\/revisions\/159"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/media\/153"}],"wp:attachment":[{"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roblsmith.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}