Todo list for building a solar powered web server
Sections
I want to build a solar powered web server! First off, let’s draft a todo list.
Build the server and website#
I’ll use Debian Stable, because I have a life, and don’t constantly want to upgrade the system. The static build system will be Hugo, because that’s what I’m familiar with. The web server will be Apache or nginx. I don’t know much about either of them, so I’ll go with the one for which I find the best howtos.
Todo#
- Install the base OS on the Raspi’s MicroSD card. Best do this on the Raspi 400 that’s kicking around here – it’s just faster. Get the wifi working.
- Make sure ssh access works. Create an ssh key specifically for the target machine. Copy the private key to all machines I’m likely to be posting from.
- Set up the web server. Make sure it works on the local network.
- (Optional) Configure the web server so that it can serve more than one website.
- In my domain hoster’s interface and my router, configure dyndns so that blog.slothrop.org points to my server. (Also check out what I need to do in DNS terms if I host more than one website on the server.)
- Obtain and install LetsEncrypt certificates.
- Install git and Hugo on the server. Configure repo access for the blog.
- Configure the machine so that all necessary services are brought up on startup.
Success criteria#
- The machine is reachable over the internet and serves a Hugo-based blog.
- I can create posts using the same git-based workflow I have now. Using Hugo, I can build the blog posts on the server.
- The machine and all services survive a dirty shutdown, and come up intact on reboot. The website is reachable over the internet again.
Hardware & system#
We’re using a Raspberry Pi Zero, which draws 2W of power. No speed queen, but hopefully sufficient for our purposes. It has WiFi, so no running extra cables.
Todo#
- Once the SD card is ready, put it in the Raspi Zero, and put that in its case.
- Do a test with a fully charged power bank. For how long will the Raspi keep running on a single charge?
Success critera#
- After assembly, the machine works and remains reachable.
Get the solar power working#
We’re planning to mount solar panels on our balcony anyway. The idea is to use (some of) the power from those to charge a battery, which then powers the server. The battery could be a power bank or an old car battery. I want to use stuff I have lying around anyway (power bank) or can easily access for free (car battery, hopefully).
Todo#
- find a suitable solar panel. We have a small one around here somewhere.
- Find something that delivers solar power to a battery, with a USB input and output.
- use that to charge the power bank.
- use the power bank to power the Raspi.
Success criteria#
- The power bank gets charged when the sun shines.
- The Raspi starts up when connected to the power bank.
- The power bank (or battery) provides enough power to achieve 90% uptime per day.
Installation & housing#
Probably some old tupperware box or something? There’s plenty of those around here.
Todo#
- find a good box
- drill the necessary holes (but not more)
- install the Raspi and power bank in the box
- confirm that the wifi connection still works
- place the box somewhere near the solar panels, but protected from too much rain and direct sunlight. (Maybe use some foam for thermal insulation?)
Success criteria#
- Wifi works when Raspi is in box.
- No water entry into box after rain
- No overheating during sunny days
- Doesn’t fly away in high winds