This one is personal.
It was a random Friday evening and I had a ‘simple’ goal: host a static website on AWS S3 with my GoDaddy domain. I mean, how difficult can it be, right? Apparently quite, considering it took 10 articles, 4 tutorials, 2 videos, and an entire day of trying everything the internet had to offer.
But fret not! Your journey will be far smoother. Let’s embark on this adventure together, starting with the first and fundamental step: snagging yourself a catchy domain.
(Learn how to acquire and set up a personal domain with GoDaddy.)
So, you’ve decided to establish your own little corner on the web. Exciting times ahead! Let’s begin with the basics: acquiring a domain.
Start by brainstorming a unique and memorable domain name that represents you or your project well. Keep it short, sweet, and easy to spell. Once you have a few options in mind, it’s time to head over to GoDaddy’s website.
On GoDaddy’s homepage, enter your desired domain name into the search bar. If your first choice is taken, don’t despair! GoDaddy will offer alternative suggestions, or you can try a variation of your initial idea. Once you find an available domain that you love, add it to your cart by clicking on the Make it Yours button.
GoDaddy will offer various add-ons and options, like privacy protection and professional email addresses (<username>@yourdomain). Review these offerings, select the ones that fit your needs, and proceed to checkout. Complete the transaction, and voila, the domain is yours!
Now, with the domain in your possession, there might be a few setup steps and changes before it shows up on your desired URL. Configure your domain settings, connect it to your hosting (which we’ll dive into next), and ensure everything is in tip-top shape for launch. For this part of the setup we’ll be visiting your domain’s DNS Records and Forwarding rules.
And just like that, you’ve successfully secured your slice of the internet pie with GoDaddy! Stay tuned as we navigate through the next phase of our digital journey: hosting with AWS S3.
(Introduction to hosting your website on Amazon Web Services’ S3.)
Welcome to the powerhouse of the internet:
AWS is vast, with a myriad of services that can be overwhelming for first-timers. Either log-in to your existing AWS account or create a new one.
Think of a bucket as a storage unit for your website. Click on the ‘Create Bucket’ button. Here, you’ll name your bucket (usually, this should match your domain name for simplicity but its fine to name it anything you like), select a region closest to your target audience, and follow through with the default settings for now.
Naming Your Bucket: Under the S3 console, click the blue ‘Create bucket’ button. A window appears prompting you for a bucket name. Select a name closely matching your domain for consistency.
Selecting Regions: Pick a region close to your audience to minimize latency. Each region corresponds to a specific geographical area. For me personally, I always prefer using US East regions since I am based in the US and also because it helps with SSL certification process on AWS (more on this in the next section).
Once your bucket is ready, it’s time for some configurations. Set the properties and permissions to make your bucket public (as it is private by default), enabling people to view your website. You’ll also set up static website hosting here by enabling the feature and designating your index and error documents.
With everything set up, you’re ready to upload your website’s files to the bucket. Simply drag and drop, or manually upload your HTML, CSS, and other files into your S3 bucket.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::YOUR-BUCKET-NAME/*"
]
}
]
}
AWS provides a unique endpoint for your hosted content. Click on this link, and if all is well, you’ll see your static website alive and kicking!
And there you have it! The initial descent into AWS might seem daunting, but with these steps, you’ve not only landed but set up base. Ready for the next adventure? We’ll delve into going live in the upcoming section.
Finally Done: Your Site is Live!
(A walkthrough of successfully hosting your website and seeing it go live.)
Congratulations, you’re almost there! Now, let’s bind everything together by pointing your shiny new GoDaddy domain to the AWS S3 bucket you’ve meticulously set up.
Click “Request” to initiate a new certificate and select “Request a public certificate”.
Add your domain names — www.your-domain.com
& your-domain.com
.
Choose “DNS Validation”.
Login to your GoDaddy account and navigate to the domain settings of your chosen domain.
Go to “Manage DNS” under “Additional Settings”.
Add the CNAME records provided by ACM. Repeat this step for both sets of values provided.
Set “Type” to “CNAME”.
“Name” is the “CNAME name” from ACM omitting the .
“Value” is the “CNAME value” from ACM (copy as is).
Set “TTL” to “Default”.
Click “Create Distribution”.
Enter the S3 bucket website URL as the “Origin Domain” (avoid using the auto-suggested link).
Under “Viewer Protocol Policy”, select “Redirect HTTP to HTTPS”.
Under “Web Application Firewall (WAF)”, select “Enable security protection”.
Add “Alternative Domain names (CNAME)” for both your preferred website URLs (www.your-domain.com
and your-domain.com
) under “Settings”.
Choose the previously created ACM certificate under “Custom SSL Certificate”.
Unfortunately, GoDaddy’s standard DNS service does not support direct ALIAS or ANAME records to CloudFront. Therefore, the best practice is to set up a CNAME for the www subdomain and then redirect the root domain to the www subdomain. You already have a CNAME for www, so let’s modify that.
CloudFront Domain Retrieval: Take note of the CloudFront domain name provided upon creating your distribution, resembling dxxxxxxxxxxxxx.cloudfront.net
.
Updating Root Domain Record: GoDaddy’s standard DNS doesn’t support ALIAS or ANAME records pointing directly to CloudFront for root domains. To address this, set up a CNAME for your www
subdomain and redirect the root to www
.
Adjusting CNAME for www: Modify the existing CNAME record for www
subdomain:
Type: CNAME
Name: www
Data: [Your CloudFront domain name]
TTL: 1 Hour (adjust as preferred)
www
subdomain:www.your-domain.com
Handling Other Records: Maintain the existing NS, SOA, and _domainconnect
records without changes.
Propagation Time Consideration: Following these DNS adjustments, propagation might require some time, potentially ranging from immediate to several hours. Utilize tools like
Once propagation concludes, accessing your-domain.com
or www.your-domain.com
should direct users to your site hosted on CloudFront securely via HTTPS.
(Guidance on updating and maintaining your newly hosted website.)
Updating your static website hosted on AWS S3 is a straightforward process. Follow these steps to ensure your site stays fresh and up-to-date:
/*
to invalidate all files).
Congratulations on successfully navigating the digital waves to launch your shiny, new website! Your virtual real estate is now up, running, and ready to welcome visitors from around the globe, securely and swiftly.
This journey, while seemingly daunting, has brought you from domain registration with GoDaddy to secure, static website hosting on AWS S3, all the way to deploying with CloudFront for that extra speed and security layer. Cheers to your success! 🚀🎉