Because they're succulents, aloe vera plants (Aloe barbadensis) store water and nutrients in those thick, fleshy leaves. Because they hold a lot of water, they prefer soil that does not. This means your aloe vera plant will do best in soil that drains quickly and doesn't stay damp or soggy for long. Without proper drainage, your aloe vera plant will likely develop root rot and die. You can amend most types of soil to improve the drainage and make it suitable for aloe vera.
The most important characteristic of a good soil mix for aloe vera is that it drains quickly and doesn't store excess water. Stores sell cactus and succulent potting mixes designed to do just that. These mixes usually contain sphagnum moss, sand and/or perlite. Some mixes may contain other organic material, such as compost. Commercial mixes are usually meant for containers only. If your plants are used to a lighter mix, you can use commercial mixes as a base to create your own mix.
Making Your Own Mix
Cacti and succulent enthusiasts pride themselves on their potting mix recipes. Hobbyists plant their aloe vera in soils that contain everything from cat litter to crumbled concrete. If you'd like to create your own mix for aloe vera, the Cactus and Succulent Society of San Jose recommends adding equal parts commercial potting soil, sand and grit. The sand should be chunky horticultural-grade sand or sharp builders sand rather than beach sand or play sand. The grit can be pumice, perlite or gravel.
Checking for Drainage
If you're new to mixing potting soils or you're experimenting with a new recipe, it's a good idea to test your soil for drainage. Fill a pot similar in size to the pot in which you'll place your aloe vera. Make sure the pot has holes in the bottom for drainage. Water the soil in the pot until excess water begins to drain from the holes. Check for puddling on the surface or soil that looks muddy rather than moist. These are signs of poor drainage. Leave the pot in a location similar to that in which you plan to place your aloe vera. In a few days, grab a handful of soil. It should be light, crumbly and mostly dry to slightly moist. If the soil is still wet or if it feels heavy, clumpy and muddy, it's not well-draining enough for aloe vera and you'll need to add more grit and sand to improve drainage.
Once you pot your aloe vera, maintaining proper soil moisture is critical. Water your plant until excess water begins to drain from the drainage holes, then don't water again until the soil is close to dry. You can check the soil moisture by sticking your finger into the top few inches of the soil. In spring and summer, this may mean watering once or twice per week. In winter, this may mean watering once per month. Your watering schedule will depend on the size of your plant and the temperature and other conditions, either indoors or outdoors. Aloe vera grows outdoors in U.S. Department of Agriculture plant hardiness zones 9 through 11. Aloe vera can take some neglect and, as a rule of thumb, it's better to under-water than over-water.