Live data from Hacker News

How I built this website on a Raspberry Pi

mirawelner.com

71–80 of 94 posts

Re: How I built this website on a Raspberry Pi

#72
post #52

I did something similar in 2016 https://www.e-tinkers.com/2016/11/hosting-wordpress-on-raspb... . Instead of having Apache, I use Nginx. Instead of serving webpage from SD card, I setup a 512MB hard disk except booting still done via the SD card. The site is still running on a Raspberry Pi 3 till this day from my living room.

I checked out your tutorial, its very cool! Do you think the 512MB harddisk makes your site more robust for when there are many queries? My site was crashed last night because of the hackernews hug of death and I may have to upgrade.

Re: How I built this website on a Raspberry Pi

#73
Great article—thanks for sharing! I did something similar nine years ago with a Raspberry Pi 3 Model B. It stayed online for nearly a decade until it went offline at the end of 2024, following Google's decision to sunset my OnHub router.

Initially, I used it as a CUPS server to turn a non-networked Brother printer (HL-2240) into a wireless printer after Google discontinued Google Cloud Print.

The printing project was a lot of fun and inspired me to dive into another challenge: self-hosting. Along the way, I learned a great deal about Apache, SSL certificates, security, and just how fragile SD cards can be!

The print server still works well, though I’ve since downsized to a Raspberry Pi Zero W.

Re: How I built this website on a Raspberry Pi

#74

I really enjoyed this but at the same time find it completely perplexing - I can't place where the author is coming from - they are either really good at explaining things from the point of view of someone who knows almost nothing about this stuff or they genuinely started this without knowing most of it. I'm not sure which would be more impressive.

Haha I think the latter assumption is more correct. I really know next to nothing about web design. I do data science and machine learning, which is quite different really. I started this project as a Freshman in undergrad and it was originally on WordPress. I have been gradually itterating over it for the past few years and now I'm 2 years out of college. I just have issues and then fix them and learn via that proccess.

So for example when my router was hacked I installed fail2ban, when a friend told me my mobile view was terrible I read about CSS, I have just been working on it gradually but I have never worked in webdev. Just today, a commenter here suggested I implement an RSS feed so I had to look up how to do that and now I have an RSS feed! I'm just learning things on the fly. I'm glad you find it impressive, I just find it as being the lazy way to learn.

Re: How I built this website on a Raspberry Pi

#77
post #58

To the OP: Make sure you have updated firmware to latest, plus added active protection against the following known vulnerabilities. https://nvd.nist.gov/vuln/search/results?form_type=Basic&res...

Thank you! I will look into that - it's linked to my home wifi so secruity vulnerabilities would be really bad for me. Much appreciated!

Re: How I built this website on a Raspberry Pi

#79

This is a wonderful project and an even more wonderful write-up, I wish I came across more in this tone! I'll just add to anyone following in these footsteps: be careful what type of website you host on your Pi. Self-hosting is great, but if you expose services on your home network to the internet, expect people to try to hack you. What type of site you host will either make this very hard or very easy. The differenc…

Thank you very much and I'm glad you enjoyed it! I'll absolutely look into cloudlfare now that my site is getting more traffic - I need to learn more about security anyways so this is a great opportunity for me!

Re: How I built this website on a Raspberry Pi

#80

Very cool, very accessibly written. Thanks for sharing. Curious how you handle your router’s public IP changing as (I believe?) this is pretty common depending on the ISP, no?

I am glad you like it!

Theoretically, routers have public IPs that change often and you have to buy something to make sure they don't.

In practice, this has only ever happened once to me when my router got hacked and I had to get firmware replaced. So while its a major issue if you have a huge site that needs to be reliable, if it is just a personal site it can be okay to just assume it will never change, and if it does you can always just get your domain name to point to the new IP.

It may be worth it to look into something to make it more stable, but right now it just isn't worth the extra fee.

Post reply on HN