Skip Navigation

Which web server software do you recommend?

I want to host my website in my raspberry pi, I've read that I would need a web server software for this. Which one do you recommend? It won't be a complex website.

50 comments
  • Nginx! Simplex essential and easy.

    Unless you need to rely a lot on CGIs then apache maybe is better.

  • nginx

    Not sure why others are suggesting a Raspberry Pi and nginx would cause problems? I run three public facing websites on a single Raspberry Pi 4 with 2GB RAM. Has been working flawlessly for 2 years. Typical uptime is measured in multiple months.

    Running Wordpress, fail2ban and certbot. Booting and running of a USB drive - have considered SSD but no need as I cache to RAM for performance.

  • Caddy was my first and it's very easy to use. I use nginx nowadays because I heard it scales better. It's harder to use but manageable enough.

    Depending on the type of website you're hosting, you can probably just use Cloudflare pages or Netlify instead of hosting it at home with a Pi.

  • I would honestly go with Apache here. I use NGINX in my environment mainly as a reverse proxy. I do use NGINX to serve my static blog.

  • I only use nginx now, the out of box footprint is tiny.

    add this deb https://packages.sury.org/nginx/ bookworm main to your /etc/apt/sources.list to install the latest stable

  • Is your site static or dynamic? If your site is made of good old HTML and CSS or your site is a SPA, any web server will serve it well.

    I prefer Nginx as it is performant and versatile enough for most use cases.

    • Static mostly, I will have a few dynamic pages though.

      • If your dynamic pages leverage PHP, Nginx can be configured to support that via FastCGI. If your site has its own server runtime (e.g. a site written with NodeJS or Go), Nginx reverse proxy is literally its strength. So yeah give Nginx a try. I bet you won't regret it.

  • I always love Flask for this, it's a super simple python web server that is basically fully batteries included, just write a couple lines of python and throw your html in either /static or /templates, depending on whether it's dynamic or not, and you're live. It's not gonna move mountains but it's not meant to.

    • How is the performance compared to nginx or apache?

      • Much lower and you shouldn't care. As long as you're serving less than one request per second, you will not need to care about performance. If you do, sanic and vibora are drop-in flask replacements and they are both much more performant.

50 comments