Kiran said: @Pat
The problem isn’t opening ports on your router, it’s about what risk a compromised Raspberry Pi on your local network poses to everything else.
Yes, but as long as you don’t open ports it can’t operate as a server on the wider internet.
@Dex
That doesn’t really tell us much. How often are the 300 clients using the site? A step up would be a mini PC with a Celeron, which you can get for around $100. I’d opt for that over an RPi.
Vin said: @Dex
That doesn’t really tell us much. How often are the 300 clients using the site? A step up would be a mini PC with a Celeron, which you can get for around $100. I’d opt for that over an RPi.
It’s for a very niche project. Overall around ~15MB PHP files. Clients register an account, save to SQL DB, that’s it. Maybe clients come back to change something/account settings. What do you think?
@Dex
Sounds like an RPi would handle it no problem. If we’re talking about under a thousand rows, and only like a dozen daily active users, it should be fine. Keep track of the CPU usage and realize when you need to upgrade.
That said, you can get a VPS for like $3/mo that’ll run laps around an RPi.
So if you have one already, there’s no harm in trying. If you’re looking to purchase one to host something, I’d look elsewhere…either a VPS or at least an x86 mini PC.
Many developers vastly overestimate the server hardware & network requirements necessary to run a site. It all depends on concurrent load/traffic.
A Pi can support potentially hundreds of concurrent requests, depending on what the site is doing. A heavy application might drop that down to a couple dozen.
The first bottlenecks you’ll likely encounter on a Pi will be its own RAM and network throughput.
More RAM is better… depending on what you’re doing, 2GB might not be enough. 4GB is a safe starting point.
A server doesn’t need a desktop environment occupying RAM.
Older Pis that route Ethernet activity over the USB bus have limited network throughput.
Web servers and databases have decently performant defaults, but expect to optimize them for your specific environment and use case.
Security depends on the Pi’s access controls and your local network.
Only expose the absolutely necessary Pi ports (80, 443, etc.) outside your LAN.
Don’t use the default pi user.
Set the Pi’s root password.
Put the Pi in a DMZ configured on your local router.
There are many guides to setting up a local Pi server (web or otherwise). Jeff Geerling on YouTube probably has several relevant videos.
Honestly, it’s doable, but I wouldn’t recommend it for anything serious. Main issues:
Your home IP becomes public, making you more vulnerable.
Power/network outages = site down.
Pi’s aren’t really built for sustained heavy loads.
If it’s just a personal project for learning, go for it. But for anything you want reliable/secure, stick with a VPS - they’re cheap these days anyway (~$5/month).