I've been using an old HP Proliant ML110 off of ebay for the last 3 years and it has been serving me well. My workload grew so I'm looking at replacing it, but for someone learning and it's a great box and you don't have to spend much either. For a time I would have told you to use Linux, but these days if you want to get serious about stability, a consistent OS, and easy management I highly recommend getting your feet wet with FreeBSD or get started with FreeNAS (which is FreeBSD but with a pretty web interface). I think if you want to learn a real Unix-like OS do a BSD or give Devuan Linux a try. You'll want to have your server connected to a switch, not going over wifi.
For my server, I spent $120 on the box got a couple NAS hard drives (don't get consumer stuff like WD Blues/blacks or Seagate Barracuda)...I also recommend taking advantage of ZFS for your filesystem for your disks and look at ZFS mirroring.
If you want a simple "dump file here" setup, look at SAMBA. Or do something fun like Nextcloud. Or both! I use Nextcloud for most of my files but use SAMBA for a couple things still