I would recommend a gym membership over a home gym unless you are certain you will keep at it. You could quite easily end up with a garage full of junk 2 months down the line.
If I was going to do something similar I would start with a power rack, 150kg of plates, a good solid bench, an olympic bar and an EZ curl bar.
With that you can work all the major muscle groups.
Best place to pick all that up is likely local classifieds (lots of people buy this stuff at full price, never use it and are pretty much willing to give it away) or a gym that's doing a refurb.
The issue with a home gym is you will very quickly find yourself bored of doing the same workouts. It's also really hard to workout around an injury without the isolation that machines provide.