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.

27 points
*

Caddy! It has HTTPS built in and provides simple but powerful configuration with sane defaults.

Example Caddyfile for a static file server:

example.com {
	root * /var/www
	file_server
}

I used nginx in the past, but didn’t like it’s verbose config files.

permalink
report
reply
9 points

The first open source contribution I made was to caddy!

permalink
report
parent
reply
9 points

+1 for Caddy. It’s my default webserver and reverse proxy. Built-in Https and the fact that I can get it up, running and configured in a matter of minutes are the main reasons.

permalink
report
parent
reply
17 points

Nginx! Simplex essential and easy.

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

permalink
report
reply
8 points

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.

permalink
report
reply
8 points
*

Apache, the OG HTTP server. Fast, well documented, battle-tested, FOSS and community-led (unlike nginx which is corporate-led). People will tell you that nginx is “faster” but never point to actual benchmarks. Both are ok.

permalink
report
reply
2 points

Yeah apache is awesome. Lots of settings if u want, and every question I’ve ever asked and probably am yet to ask has already been answered on stack with multiple duplicates aha

permalink
report
parent
reply
1 point

Check out mod_md - this module allows getting certificates from Let’s Encrypt (or any other ACME cert provider) automatically. Just set this anywhere in your config, reload apache and you’re set. No more fiddling around with certbot.

MDCertificateAgreement accepted
MDContactEmail me@example.org
MDomain my.example.org

Also other comments make it look like only nginx supports FastCGI (e.g. php-fpm), apache has supported talking to FastCGI since 2005:

  <FilesMatch \.php$>
    SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost"
  </FilesMatch>
permalink
report
parent
reply
1 point

Yeah I use php-fpm, I didn’t know much about it the first time I installed it, I just needed it for HTTP 2.

For ssl I just install certbot and let it autorun LetsEncrypt, I haven’t had any issues with any of my ssl certs, it’s pretty nice.

The age old LAMP stack is pretty solid, except for me it’s LAPP cuz I don’t wanna use mysql.

permalink
report
parent
reply
7 points
1 point

There is a NPM (nginx proxy manager) with rly nice GUI that you can run in docker container

permalink
report
parent
reply

Selfhosted

!selfhosted@lemmy.world

Create post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

Community stats

  • 4.9K

    Monthly active users

  • 3.5K

    Posts

  • 75K

    Comments