Come to the right place (mostly) because I actually used to host my website in my house on my home internet and on a Raspberry Pi 4
(it still is on my home internet but now it's on an old desktop so I can also host a few other things at once and basically just have a beefier workhorse machine). So I know a thing or two about doing most of those things. Keyword,
most, not that much about security or JS or getting the multiplayer three.js game to work so heh you're going to have to figure out those parts or other smarter people can explain all that (I just do the basics, use stable stuff, keep that stable stuff updated when I remember, and hope for the best because I'm not like, important enough to have military grade encryption or whatever else).
First of all, most importantly, if you haven't check this already you wanna make sure that your home internet gives you a stable ip. Mine does luckily, specifically with the purpose of hosting things if you want to. If its dynamic (Ie changes out every certain amount of time), then there
are ways of getting around it with services like no-ip but I don't know anything about that. If it's stable, usual drill of hooking it up, point domain to that IP address, portforward, etc. That's the MAIN roadblock you're going to run into when trying to host something out of your house. Also worth to note if the IP is dynamic, that means that they're actively trying to prevent people from doing something like hosting something out of their house and probably have other checks to see to it that you aren't doing that. So if they see the bandwidth of your server and it indicates something is going on, they
might hit you up and say "Hey you can't do that" depending on how mean they are about that sort of thing. Very very rare, I've never really seen anything like that but for very extreme cases which is mostly when they get noticed, but it's worth noting regardless.
Is it a good idea to host a web server on your home internet, or is it more trouble than it's worth?
Yes. Not only is it cheaper, it is is also a LOT easier to manage a machine that is literally in your house, sometimes even right next to you. From myself doing it, it's a lot easier to get it online than you would think (usually as quick as a sudo apt get install after you connect it to the internet). You know absolutely everything that is going on with the machine at any given time. No unexpected downtime, no wondering about where the data on your VPS is being stored, it's all right there and cozy. Plus, a major feeling of independence.
(But it being cheaper is the best part to be honest)Would a raspberry pi be capable of handling the task?
Depends on the pi and what you're doing. If it's just the webserver, PHP, more complex JS frameworks, basic small things like that, easy for a Raspberry Pi 3 and up and my Pi 4 wouldn't even blink (possibly a 2 as well but I think that might have a couple of issues at that point) but a Raspberry Pi Pico might be getting pushed to it's limits. If you're going to be trying to be running some of those more complicated three.js processes it probably depends on how many there are and how much RAM there is (and also what your Raspberry Pi is because a Raspberry Pi 5 would be able to take it no problem I think but 4 and under might start to hitch a little).
That being said though, take that with a grain of salt. Pi's are pretty hardy. I once hosted an MC server for a discord server on my Pi 4 and while it would chug with more than two people on at a time, it took it like a champ and didn't explode (though it did get pretty hot even with a fan). They can do a bit more than you'd expect at times.