I rent a Rug Doctor. It's about $30 for 24 hours. I use my homemade laundry detergent to clean my carpets.
I am on board for renting a carpet cleaner, you can find them at your local larger grocery stores- Rug Dr is the most popular brand. They also offer a deterrgent to use with them, not for free though. This way you do not have to worry about storing and maintaining a machine to do your carpets.
My hubby is a steam cleaner. Many customers spend lots of money, spend all day & then it takes days to dry & then flattens out. Later they call him & never do their own again. Go local with established mom & pop who use a truck mounted unit. They dry in hours. No portables. Beware of bait & switch- so many rooms for $99. Later they add on things for more than $99. Go established locals. National companies hire some folks you would not invite into your home or on probation.
Before you buy new carpet- talk to your steam cleaner for the best options. They know their stuff.