In the past I've used pebbles (rinsed thoroughly) for the bottom layer, then a thin layer of horticultural charcoal, then my potting medium. I once used a very old cookie sheet and baked the soil in the oven for a few minutes (something I read should be done to kill any pathogens in the soil) but I only did it that one time because it smelled up the kitchen. I only keep two terrariums nowadays, a 10 gallon rectangular aquarium and an old 85 gal. hexagonal aquarium but I didn't use the pebbles or charcoal in either. Moisture builds up quickly in enclosed glass or plastic containers but I haven't had issues with mold because I open or remove the lids on occasion, leaving them off for a few days to allow for air circulation and to give the soil time to dry out a bit.
Some older photos of my two current terrariums:
And, my glass container plantings from a few years ago :