To create a recording of a copyrighted composition, you need a mechanical licence. It doesn't matter if you sell them, give them away or stick them in a closet. You can get it directly from the publisher or from a clearing house like Music Services. Usually there is a minimum number of licences you have to purchase, usually 200.
You can also do a "compulsory" mechanical license, which is basically record now, pay later. But that is more trouble than it is worth, usually.