Static websites can be viewed without a server, locally, simply by opening them up in a web browser, and you can do whole big websites this way if you want. But there are limitations and drawbacks, which is why people and systems use local servers for static websites.
One of the reasons you may be asking is because using many of the popular static site generators, like Jekyll, requires that you tell the system to
--serve (or similar) it, creating a local server for the static site. But if it's static, why do you need a server?
Here are a few reasons:
- only relative links are safe (
/ as a link to home is broken, as is referencing
/ is the root of your computer, not the site);
- relatedly, directory-level links fail (
blog/ shows the files under that directory, instead of looking for
blog/index.html or similar);
- and browsers treat local files differently among themselves and between then and hosted files (Chrome limits ajax calls, IE uses a different protocol from everyone else, etc.).
So, no, you don't need it, but you do need it if you want those things.