I do agree with Karsten, you'll be really happy with a Synology. I love mine, use it for a million things.
But if you're intent on building your own solution, you'll want to check out a program call FreeNAS. It's very stable, can run on just about any computer hardware, and works well if you want to build a tower with a lot of storage. I have one with 20Tb of drives in it running on an old linux server, and I haven't had to reset it once.