This website is hosted at our home in Seattle Washington, US. It does not use any fancy hosting solution since we’re not expecting major traffic to the website.

The diagram below shows a logical view of the components that are used to build this website.

Website Logical Architecture Diagram


Hardware

Netgear Wireless Router

This is a general wireless router used to provide WiFi around the house. I use it to intercept website requests on a specific port and forward these request to the Raspberry Pi which returns the content.

I do not have a static IP address assigned to my home network. This means that if I purchase a domain name and assign my home routers IP in the DNS, it will not work since the IP address is dynamic and could change anytime. I would have to update the DNS with the new IP address manually.

However, Netgear is partnered with No-IP to provide free DDNS services (Dynamic Domain Name System services). This allows us to create a free domain name (for example: trosario.com) and the DDNS automatically updates the DNS entry whenever the public IP address of my router changes.

Raspberry Pi Zero W

This is a $10 low cost Single Board Computer (SBC) that is running headless (without any keyboard or monitor connected). The total cost of the “server” if you include additional components is about $30. You do not need a case, monitor, keyboard or mouse as you can run the computer headless.

I purchased this SBC for just $5 from a MicroCenter in Columbus, Ohio during a Black Friday deal. I reused all other components, as I had them lying around at home.

Below are links and prices of all components needed.

Specification Amount
Raspi Zero W
(Actual vs Online)
$10 to $15
Micro SD Card$10
Micro USB Cable$2
5V USB Wall Charger$3
Total Cost$25 to $30

Below are the specs of this tiny little “server”.

SpecificationValue
SoCBroadcom BCM2835
InstructionsARMv6Z (32-bit)
CPUARM 1 GHz
Memory512 MiB (SDRAM)
Hard Disk32GB MicroSD card
NetworkingWiFi (b/g/n 2.4 GHz)
Power5 Volts via microUSB
Power Used~0.7 Watts
Size65 mm × 30 mm × 5 mm


Software

Raspbian OS

This is a Debian Linux distribution specifically created for Raspberry Pi computers which have ARM chipsets. The OS is installed on a 32GB Micro SDCard that plugs into the Pi .

I’ve used a lite version with no GUI support, since I do not connect a monitor or keyboard to the computer. I login to the Pi using SSH from my laptop to install / update software, making it a headless installation.

Docker

This is a program that runs a persistent process called a “daemon” in the OS. The Docker daemon listens for requests sent via the Docker Engine API and manages Docker objects. Docker uses OS-level virtualization to deliver software in packages called containers.

I chose to use docker containers instead of installing the website software directly on the OS for the following reasons:

  • Standardization – Specific versions of software can be easily managed within an image. If a component upgrade breaks the environment, we can easily rollback to a previous version of the Docker image.
  • Isolation – All dependencies can be easily managed within the image. For example if MySQL depends on v1 of some software and Apache depends on v2 of the same software, installing MySQL and Apache directly on the computer could cause conflicts with the software versions. However, with separate Docker images for Apache and MySQL we do not run into such conflicts.
  • Backup – Docker images can be copied to a new server and started in a couple of minutes since it contains all required pieces of information.
  • Compatibility – A Docker image built on my Mac laptop can also be built on the Raspberry Pi. The write once build anywhere architecture helps to create website components quickly.
  • Security – Docker ensures that applications that are running on containers are completely segregated and isolated from each other, granting complete control over traffic flow and management. From an architectural point of view, each container gets its own set of resources ranging from processing to network stacks.


Docker Containers