Desert cacti are masters of drought tolerance. Their tough skins, thick roots and squat shape all contribute to their survival under dry conditions. When grown in pots, it's even more important to give them quick-draining--even rocky--soil because the pots themselves can hinder drying.
The major issue with soil for cacti is drainage. Water should move through the soil quickly, leaving air space around the roots. If roots sit in wet soil, they will rot. The soil must also retain a certain amount of moisture as well as air to avoid the need to water frequently. So, having a soil that drains quickly but keeps some moisture is important. Cacti also need nutrients and it's essential to use materials that will hold these and release them slowly.
Inert materials that allow water to drain through freely include pumice, perlite, nonsoluble cat litter and sand. Vermiculite, a type of expanded mica often used in potting soils, is not suitable for cacti because it holds too much water and will break down over time. The best sand is washed construction sand that is free of small particles that would clog the spaces in the soil.
Organic materials include fine bark, coir (coconut fiber), leaf mold, aged manure and peat moss. Though commonly added to commercial bagged cactus soil, peat is difficult to wet once it dries and should be avoided.
Many growers add a slow-release pelleted fertilizer to the soil mix to avoid the need for frequent fertilization.
Just because cacti grow well in a sandy mix doesn't mean they need to starve. A nutrient-rich soil is important, too. The materials that hold nutrients and slowly release them to the roots are coir, humus and leaf mold as well as less desirable substances such as clay, vermiculite and peat moss. Coir has the advantages of being fibrous and decaying slowly, making it an ideal addition to a potting mix.
Store Bought vs. Mixing Your Own
Many nurseries sell bags of soil labeled as "cactus soil" but these often turn out to be a combination of peat moss and sand, usually for a higher price than you'd pay for the individual ingredients. The tendency of peat moss to repel water once it dries completely makes these a poor choice. You may need to look around for the ingredients to make your own but you can fine tune the mix to your own humidity and the needs of each cactus.
While no one mix is perfect for every cactus, many growers use approximately half inert materials, such as gravel or pumice, a quarter regular potting mix (not cactus mix) and a quarter coir. You can use sterilized topsoil instead of the potting mix, or a bagged compost. If the humidity in your area is high, use about 60 percent pumice. If you have trouble finding pumice, you can use vermiculite, but add extra sand to balance the increased water-holding capacity.