{"id":17615,"date":"2025-04-05T15:43:42","date_gmt":"2025-04-05T13:43:42","guid":{"rendered":"https:\/\/tremhost.com\/blog\/?p=17615"},"modified":"2025-04-05T15:43:42","modified_gmt":"2025-04-05T13:43:42","slug":"how-to-host-a-website-on-aws-for-free-aws-free-tier-step-by-step","status":"publish","type":"post","link":"https:\/\/tremhost.com\/blog\/how-to-host-a-website-on-aws-for-free-aws-free-tier-step-by-step\/","title":{"rendered":"How to Host a Website on AWS for Free (AWS Free Tier Step-by-Step)"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p>Hosting a website on Amazon Web Services (AWS) can be done at no cost using the AWS Free Tier. Here&#8217;s a step-by-step guide to get you started.<\/p>\n<h2>Step 1: Sign Up for AWS<\/h2>\n<ol>\n<li><strong>Visit the AWS Free Tier Page<\/strong>: Go to the <a href=\"https:\/\/aws.amazon.com\/free\/\" target=\"_blank\" rel=\"noopener\">AWS Free Tier<\/a> page.<\/li>\n<li><strong>Create an Account<\/strong>: Click on &#8220;Create a Free Account&#8221; and follow the prompts to set up your account.<\/li>\n<li><strong>Enter Payment Information<\/strong>: AWS requires a credit card for account verification, but you won\u2019t be charged if you stay within the Free Tier limits.<\/li>\n<\/ol>\n<h2>Step 2: Launch an EC2 Instance<\/h2>\n<ol>\n<li><strong>Go to the EC2 Dashboard<\/strong>:\n<ul>\n<li>Navigate to the AWS Management Console.<\/li>\n<li>Search for &#8220;EC2&#8221; in the services menu and select it.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Launch an Instance<\/strong>:\n<ul>\n<li>Click on \u201cLaunch Instance.\u201d<\/li>\n<li>Choose an <strong>Amazon Machine Image (AMI)<\/strong>. For a simple website, select the <strong>Amazon Linux 2 AMI<\/strong>.<\/li>\n<li>Choose an <strong>Instance Type<\/strong>. Select the <strong>t2.micro<\/strong> instance, which is free tier eligible.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Configure Instance<\/strong>:\n<ul>\n<li>Click &#8220;Next: Configure Instance Details.&#8221; The default settings are usually fine for a basic website.<\/li>\n<li>Click &#8220;Next: Add Storage&#8221; and proceed with the default settings.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Add Tags<\/strong> (Optional):\n<ul>\n<li>You can add tags to help identify your instance later. Click &#8220;Next: Configure Security Group.&#8221;<\/li>\n<\/ul>\n<\/li>\n<li><strong>Configure Security Group<\/strong>:\n<ul>\n<li>Create a new security group.<\/li>\n<li>Add rules to allow HTTP (port 80) and SSH (port 22) access. For HTTP, set the source to &#8220;Anywhere&#8221; (0.0.0.0\/0) for public access.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Review and Launch<\/strong>:\n<ul>\n<li>Review your configuration, then click &#8220;Launch.&#8221;<\/li>\n<li>You will be prompted to create a new key pair. Download the key pair (a <code>.pem<\/code> file) and keep it safe.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2>Step 3: Connect to Your EC2 Instance<\/h2>\n<ol>\n<li><strong>Open a Terminal<\/strong>:\n<ul>\n<li>Navigate to the directory where your <code>.pem<\/code> file is stored.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Change Permissions<\/strong>:\n<div class=\"MarkdownCodeBlock_container__nRn2j\">\n<div class=\"MarkdownCodeBlock_codeBlock__rvLec force-dark\">\n<div class=\"MarkdownCodeBlock_codeHeader__zWt_V\">\n<div class=\"MarkdownCodeBlock_languageName__4_BF8\">bash<\/div>\n<div class=\"MarkdownCodeBlock_codeActions__wvgwQ\"><button class=\"button_root__TL8nv button_ghost__YsMI5 button_sm__hWzjK button_center__RsQ_o button_showIconOnly-compact-below___fiXt MarkdownCodeBlock_codeActionButton__xJBAg\" type=\"button\" data-theme=\"ghost\"><span class=\"button_label__mCaDf\">Copy<\/span><\/button><\/div>\n<\/div>\n<div class=\"\" data-collapsed=\"unknown\">\n<pre class=\"MarkdownCodeBlock_preTag__QMZEO MarkdownCodeBlock_horizontalOverflowHidden__YPHxg\"><code class=\"MarkdownCodeBlock_codeTag__5BV0Z\">chmod 400 your-key-file.pem\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>Connect to Your Instance<\/strong>:\n<div class=\"MarkdownCodeBlock_container__nRn2j\">\n<div class=\"MarkdownCodeBlock_codeBlock__rvLec force-dark\">\n<div class=\"MarkdownCodeBlock_codeHeader__zWt_V\">\n<div class=\"MarkdownCodeBlock_languageName__4_BF8\">bash<\/div>\n<div class=\"MarkdownCodeBlock_codeActions__wvgwQ\"><button class=\"button_root__TL8nv button_ghost__YsMI5 button_sm__hWzjK button_center__RsQ_o button_showIconOnly-compact-below___fiXt MarkdownCodeBlock_codeActionButton__xJBAg\" type=\"button\" data-theme=\"ghost\"><span class=\"button_label__mCaDf\">Copy<\/span><\/button><\/div>\n<\/div>\n<div class=\"\" data-collapsed=\"unknown\">\n<pre class=\"MarkdownCodeBlock_preTag__QMZEO MarkdownCodeBlock_horizontalOverflowHidden__YPHxg\"><code class=\"MarkdownCodeBlock_codeTag__5BV0Z\">ssh -i \"your-key-file.pem\" ec2-user@your-instance-public-dns\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>Replace <code>your-instance-public-dns<\/code> with your EC2 instance&#8217;s public DNS address found in the EC2 dashboard.<\/li>\n<\/ol>\n<h2>Step 4: Install a Web Server<\/h2>\n<ol>\n<li><strong>Update the Package Repository<\/strong>:\n<div class=\"MarkdownCodeBlock_container__nRn2j\">\n<div class=\"MarkdownCodeBlock_codeBlock__rvLec force-dark\">\n<div class=\"MarkdownCodeBlock_codeHeader__zWt_V\">\n<div class=\"MarkdownCodeBlock_languageName__4_BF8\">bash<\/div>\n<div class=\"MarkdownCodeBlock_codeActions__wvgwQ\"><button class=\"button_root__TL8nv button_ghost__YsMI5 button_sm__hWzjK button_center__RsQ_o button_showIconOnly-compact-below___fiXt MarkdownCodeBlock_codeActionButton__xJBAg\" type=\"button\" data-theme=\"ghost\"><span class=\"button_label__mCaDf\">Copy<\/span><\/button><\/div>\n<\/div>\n<div class=\"\" data-collapsed=\"unknown\">\n<pre class=\"MarkdownCodeBlock_preTag__QMZEO MarkdownCodeBlock_horizontalOverflowHidden__YPHxg\"><code class=\"MarkdownCodeBlock_codeTag__5BV0Z\">sudo yum update -y\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>Install Apache<\/strong>:\n<div class=\"MarkdownCodeBlock_container__nRn2j\">\n<div class=\"MarkdownCodeBlock_codeBlock__rvLec force-dark\">\n<div class=\"MarkdownCodeBlock_codeHeader__zWt_V\">\n<div class=\"MarkdownCodeBlock_languageName__4_BF8\">bash<\/div>\n<div class=\"MarkdownCodeBlock_codeActions__wvgwQ\"><button class=\"button_root__TL8nv button_ghost__YsMI5 button_sm__hWzjK button_center__RsQ_o button_showIconOnly-compact-below___fiXt MarkdownCodeBlock_codeActionButton__xJBAg\" type=\"button\" data-theme=\"ghost\"><span class=\"button_label__mCaDf\">Copy<\/span><\/button><\/div>\n<\/div>\n<div class=\"\" data-collapsed=\"unknown\">\n<pre class=\"MarkdownCodeBlock_preTag__QMZEO MarkdownCodeBlock_horizontalOverflowHidden__YPHxg\"><code class=\"MarkdownCodeBlock_codeTag__5BV0Z\">sudo yum install httpd -y\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>Start Apache<\/strong>:\n<div class=\"MarkdownCodeBlock_container__nRn2j\">\n<div class=\"MarkdownCodeBlock_codeBlock__rvLec force-dark\">\n<div class=\"MarkdownCodeBlock_codeHeader__zWt_V\">\n<div class=\"MarkdownCodeBlock_languageName__4_BF8\">bash<\/div>\n<div class=\"MarkdownCodeBlock_codeActions__wvgwQ\"><button class=\"button_root__TL8nv button_ghost__YsMI5 button_sm__hWzjK button_center__RsQ_o button_showIconOnly-compact-below___fiXt MarkdownCodeBlock_codeActionButton__xJBAg\" type=\"button\" data-theme=\"ghost\"><span class=\"button_label__mCaDf\">Copy<\/span><\/button><\/div>\n<\/div>\n<div class=\"\" data-collapsed=\"unknown\">\n<pre class=\"MarkdownCodeBlock_preTag__QMZEO MarkdownCodeBlock_horizontalOverflowHidden__YPHxg\"><code class=\"MarkdownCodeBlock_codeTag__5BV0Z\">sudo systemctl start httpd\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>Enable Apache to Start on Boot<\/strong>:\n<div class=\"MarkdownCodeBlock_container__nRn2j\">\n<div class=\"MarkdownCodeBlock_codeBlock__rvLec force-dark\">\n<div class=\"MarkdownCodeBlock_codeHeader__zWt_V\">\n<div class=\"MarkdownCodeBlock_languageName__4_BF8\">bash<\/div>\n<div class=\"MarkdownCodeBlock_codeActions__wvgwQ\"><button class=\"button_root__TL8nv button_ghost__YsMI5 button_sm__hWzjK button_center__RsQ_o button_showIconOnly-compact-below___fiXt MarkdownCodeBlock_codeActionButton__xJBAg\" type=\"button\" data-theme=\"ghost\"><span class=\"button_label__mCaDf\">Copy<\/span><\/button><\/div>\n<\/div>\n<div class=\"\" data-collapsed=\"unknown\">\n<pre class=\"MarkdownCodeBlock_preTag__QMZEO MarkdownCodeBlock_horizontalOverflowHidden__YPHxg\"><code class=\"MarkdownCodeBlock_codeTag__5BV0Z\">sudo systemctl enable httpd\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<h2>Step 5: Upload Your Website Files<\/h2>\n<ol>\n<li><strong>Transfer Files<\/strong>:<br \/>\nUse <code>scp<\/code> to transfer files from your local machine to the EC2 instance:<\/p>\n<div class=\"MarkdownCodeBlock_container__nRn2j\">\n<div class=\"MarkdownCodeBlock_codeBlock__rvLec force-dark\">\n<div class=\"MarkdownCodeBlock_codeHeader__zWt_V\">\n<div class=\"MarkdownCodeBlock_languageName__4_BF8\">bash<\/div>\n<div class=\"MarkdownCodeBlock_codeActions__wvgwQ\"><button class=\"button_root__TL8nv button_ghost__YsMI5 button_sm__hWzjK button_center__RsQ_o button_showIconOnly-compact-below___fiXt MarkdownCodeBlock_codeActionButton__xJBAg\" type=\"button\" data-theme=\"ghost\"><span class=\"button_label__mCaDf\">Copy<\/span><\/button><\/div>\n<\/div>\n<div class=\"\" data-collapsed=\"unknown\">\n<pre class=\"MarkdownCodeBlock_preTag__QMZEO MarkdownCodeBlock_horizontalOverflowHidden__YPHxg\"><code class=\"MarkdownCodeBlock_codeTag__5BV0Z\">scp -i \"your-key-file.pem\" local-file-path ec2-user@your-instance-public-dns:\/var\/www\/html\/\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/li>\n<li><strong>Access Your Website<\/strong>:<br \/>\nOpen a web browser and enter your EC2 instance&#8217;s public DNS. You should see your website!<\/li>\n<\/ol>\n<h2>Step 6: Configure Domain Name (Optional)<\/h2>\n<ol>\n<li><strong>Register a Domain<\/strong>: Consider using a domain registrar to buy a domain name.<\/li>\n<li><strong>Point Domain to EC2<\/strong>: Update your domain settings to point to your EC2 instance&#8217;s public IP address.<\/li>\n<\/ol>\n<h2>Conclusion<\/h2>\n<p>By following these steps, you can successfully host a website on AWS for free using the Free Tier. Remember to monitor your usage in the AWS Management Console to avoid any unexpected charges!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hosting a website on Amazon Web Services (AWS) can be done at no cost using the AWS Free Tier. Here&#8217;s a step-by-step guide to get you started. Step 1: Sign Up for AWS Visit the AWS Free Tier Page: Go to the AWS Free Tier page. Create an Account: Click on &#8220;Create a Free Account&#8221; [&hellip;]<\/p>\n","protected":false},"author":1771,"featured_media":17617,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[163],"tags":[],"class_list":{"0":"post-17615","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-hosting"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/17615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/users\/1771"}],"replies":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/comments?post=17615"}],"version-history":[{"count":2,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/17615\/revisions"}],"predecessor-version":[{"id":17619,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/17615\/revisions\/17619"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/media\/17617"}],"wp:attachment":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/media?parent=17615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/categories?post=17615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/tags?post=17615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}