owned this note changed 2 years ago
Linked with GitHub

Guide To Serving A Website From A Raspberry Pi

two main methods in this guide:

  1. with yunohost
  2. manually
    ?

or not


with yunohost

First to explain with yunohost.
Yunohost already has some really extensive documentation.

Here is a guide for installing yunohost on a raspberry pi:
https://yunohost.org/en/install/hardware:rpi2plus
if you end up trying this and run into any gotchas, feel free to message
in particular Dynamic DNS may be tricky

once yunohost is installed,
go to domain -> add new domain (use your own domain you choose for this website, which you need to have registered with a dns provider)
go to applications -> install -> custom web application

associate the web application with the domain.

you can then upload your static website (explained more below), and yunohost will serve the website at that domain,
and on your local network using whatever your pi's IP address is.

these instructions are super short, and clearly need to be fleshed out, with screenshots etc. for a real guide, but I'm just starting with this lil outline.

something else exciting about yunohost, is once you get the swing of installing new apps, its quite empowering, because then its super easy to just try out new ones with a few clicks

manually

something beautiful about static html websites, aka sometimes known as Web0, is they are very portable. a static website is a folder containing html files, css files, and maybe some javascript files (optional). you can open the html files directly in the browers. you can serve the folder locally on your laptop using python, or you can deploy a static website to the public internet. I've even sent static websites to friends as a .zip file via signal (a super offline way to share a website lol). a static website in this form (a folder), could be deployed using github pages, using yunohost, or manually, and in any of these cases it would be the same folder of files that gets served in the end.

these are all just different ways to serve a folder

to manually serve a folder of files on a raspberry pi,
what I would do is:

  • make sure nginx is running on the raspberry pi
  • configure nginx to serve a folder containing your static website
  • set up dynamic dns (using https://www.duckdns.org/)

again these instructions are super barebones, and it would be fun to try flesh them out more

as well as including more theory/concepts in this guide about local infrastructure, and web0

web0 appendix

here are some more web0 references:

http://html.energy - also a lot of web0 inspiration in their beautiful twitter account
https://512kb.club/ - websites that are under 512kb in size
https://100r.co/site/working_offgrid_efficiently.html - merveilles.town in general is a closely aligned with web0 dreams
https://web0.small-web.org/ - and here is web0 manifesto, although in my eyes this manifesto more like came after the fact, and is not the initiator of the movement or even the best explanation of it. to me web0 is much more than just decentralization, its low-energy, its using simple tools where it can ("appropriate technology"), its dreamy, its also decentralized.

Select a repo