My Workflow for Spinning Up a Website on AWS


my website building workflow

When I create a new website, I like to keep things clean, efficient, and secure from the very beginning. Over time, I’ve built a workflow that helps me get from a fresh AWS instance to a running test page with minimal hassle. In this article, I’ll walk through the exact steps I use, from provisioning the server to testing it with a simple web page.


1. Launching an AWS EC2 Instance

I start by spinning up an EC2 instance in AWS. I prefer using the latest version of Debian because it’s lightweight, stable, and has a huge support community. When creating the instance, I make sure to:

  • Select the Debian AMI (Amazon Machine Image).
  • Choose an instance size that fits the project (t2.micro works well for testing).
  • Configure networking and security groups (firewalls) right away.

2. Setting Up SSH Access with Keys

I don’t use passwords for server access—SSH authentication keys are safer and more convenient.

Here’s how I set it up:

  1. On my local Linux server at home, I generate a new SSH key (if I don’t already have one): ssh-keygen -t ed25519 -C "[email protected]" This creates a private/public key pair in ~/.ssh/.
  2. I copy the public key to the AWS server using: ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server-ip
  3. Now I can log in securely without typing a password: ssh user@server-ip

3. Updating and Automating Maintenance

The first thing I do on any new server is bring everything up to date:

sudo apt update && sudo apt upgrade -y

To keep it maintained automatically, I create a small script that updates the system and reboots weekly. I schedule it with cron:

sudo crontab -e

Then add:

0 3 * * 0 apt update && apt upgrade -y && reboot

This runs every Sunday at 3 AM, applying updates and restarting the server.


4. Configuring Firewalls

Security is non-negotiable. I use two layers of firewalls:

  • AWS Security Groups → to control which traffic can reach the server (e.g., only allow SSH from my home IP, HTTP/HTTPS from anywhere).
  • UFW (Uncomplicated Firewall) on Debian → to enforce rules at the server level: sudo ufw allow OpenSSH sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw enable

5. Setting Up DNS with Cloudflare

For DNS, I like Cloudflare because it’s fast, secure, and easy to manage. I simply:

  • Point my domain’s nameservers to Cloudflare.
  • Create an A record that maps my domain (e.g., brucereiss.com) to the server’s public IP.
  • Enable Cloudflare’s proxy if I want extra security and caching.

6. Installing Apache and Testing the Server

To confirm everything is working, I install Apache:

sudo apt install apache2 -y

Then I create a very simple index.html file:

<!DOCTYPE html>
<html>
  <head>
    <title>It Works!</title>
  </head>
  <body>
    <h1>Hello from my new server!</h1>
  </body>
</html>

Dropping that into /var/www/html/ lets me visit my domain in a browser and confirm the site is live.


Conclusion

That’s my standard workflow for spinning up a new website. It covers the essentials: secure access, automated maintenance, firewalls, DNS setup, and a quick test page. From here, I can build out more complex applications or host production-ready sites knowing that the foundation is solid.


One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.