Website Hosting Project
Overview
This project documents the process of self-hosting a secure website (https://iamdakota.com) using an Ubuntu Server installation, NGINX web server, basic firewall setup, and manual HTML page creation. All steps were performed on personal hardware and configured from scratch as part of a technical learning initiative.
Getting Started
I began by repurposing an older laptop. I downloaded Ubuntu Server and used Rufus to image it onto a USB drive. After booting from the USB, I went through the guided installation process. One major hurdle was during the network configuration stage — I had to resolve a mismatch between my static IP settings and the subnet address format. This required understanding how subnets are written in CIDR format and adjusting values so my IP fit correctly within the subnet.
Installing NGINX & UFW
Once the server was online, I ran system updates and installed NGINX using sudo apt install nginx
. To secure the server, I enabled UFW (Uncomplicated Firewall) and allowed HTTP, HTTPS, and SSH traffic. This ensured only the necessary ports were exposed to the network.
Understanding Port Forwarding
Port forwarding was required to expose the web server to the public internet. This involved logging into my router and forwarding ports 80 (HTTP) and 443 (HTTPS) to my server's internal IP address. Port forwarding allows external traffic on specific ports to be passed through the router and directed to a device inside the local network. Without this, external users would be blocked from accessing the server entirely. It's important to note that your internet service provider assigns a public IP address to your home network — this is the address users on the internet will use to reach your server. This public IP is separate from your internal IP and is what you'll need to reference when configuring DNS records with your domain registrar.
Pointing the Domain to Your Server
To make the website accessible using a domain name like iamdakota.com
, I logged into my domain registrar and added a DNS record that points to the public IP address provided by my internet service provider. Specifically, I created an A record for the root domain (and optionally for www
) that targets the server’s public IP. This allows browsers to resolve the domain name to the actual IP of my server. It’s important to note that DNS changes can take a few minutes to propagate depending on the TTL settings.
Creating HTML Files
With NGINX serving the default page, I navigated to /var/www/html
, which is the default web root on Ubuntu. To add new pages, I created directories using mkdir
and then added HTML files inside them. It's important to note that mkdir
creates directories, not HTML files — if you attempt to open a directory directly using nano
, it will fail. You must first create the directory (e.g., /projects
), then use nano /projects/project-name.html
to create a file within it. This clarified the difference between creating subpages versus standalone files.
Switching to SSH and Local Editing
Once SSH access was working reliably, I began editing HTML files locally on my Windows machine using Sublime Text. Before committing those changes to the live server, I would open the files directly in my browser to preview them. This allowed me to test and refine the layout and styling before manually recreating or updating the files on the server using nano
over SSH. Even without syncing tools like scp
or rsync
, this method offered a much smoother editing experience.
Summary
This project served as an entry point into self-hosted web infrastructure, covering core topics like Ubuntu server management, static IP setup, firewall configuration, port forwarding, DNS setup, and simple web development. It laid the foundation for my future project pages and gave me direct experience managing a live system from bare metal to public access.