IMac Mini As A Home Server

I have an iMac Mini lying in my closet that I don't use often so I got an Idea.
Can I use iMac mini to be either a home server?
The only advantage I know is that it consumes less than conventional desktops.
What are the things I should know before I can set it up as a Home Server?
