Microfauna
Bugs and other tiny creepy crawlies will eventually find their way into your viv. The best way to keep undesirable things out of there is to fill it with desirable things to eat all the food. Plants drop leaves, soil molds, animals poop, leaves decay. You can't stop any of this from happening, and you can turn it into a good thing with the right planning.
They base layer and substrate layer of your terrarium are a kind of a biological filter. Bacteria the eat waste and other 'by products' grow in the soil, and in the water in your base layer. In turn, their end product is a very good fertilizer for plant life. This is especially true with animal waste. The urates and solids are quickly broken down into usable nitrogen for your plants. Rather than removing the animal waste, use it to your advantage! If you followed my substrate recipe earlier, you have everything ready for a bacterial super colony to get things started. If not, it's pretty easy to add a pinch or two of pesticide and fertilizer free backyard dirt or compost and work it into your substrate mix. Add a few clean dead hardwood leaves and you're ready for bugs.
Springtails
Little tiny white bugs that hop and float around on the top of your substrate are likely springtails. They are your best friends. Small animals eat them with gusto, and they live to eat mold and fungus. I highly recommend ordering a culture of them online and keeping your viv well stocked with them at all times.
Isopods
Roly polies, potato bugs, woodlice, whatever they are called in your neck of the woods are a type of isopod. A beneficial type. They break apart and eat animal wastes, passing droppings that springtails will clean up quickly. Lots of species of lizards and amphibians eat them and they are a great source of extra calcium for them. Adding 20-30 of them to a small terrarium will keep a pretty constant supply of them rooting around and doing their thing. If you can't find these under a log somewhere, you can order them online as well. Another must have.
Millipedes
They do pretty much the same thing as the isopods, but like to climb and eat things up off the ground. Great to have for cleaning poop and decaying matter from wood or leaves. The big African Giant millipedes work fine in a big terrarium with big geckos, but the smaller ones are better most of the time. Every once in a while I see some for sale online, but these are really easy to catch in rotten logs or leaf mulch. No, they don't bite, but can excrete a nasty tasting juice, so wash your hands before you eat that sandwich. Another of those things I know first hand
Setting up the microfauna in a new terrarium
After everything is planted, lights and heat sources are working, get everything nice and wet. Sprinkle some cheap fish food (just a pinch) on the floor of your viv. Add your springtails. When you don't see anymore fish food, add some more. Doing this for a week or two without any other tank inhabitants will guarantee a massive colony of springtails ready to tackle an abundance of messes.
Give the viv a few weeks to settle and add your isopods. I like to add them along with whatever animals I'll be keeping so the clean up crew is ready and waiting for droppings. For a terrarium with a small footprint but lots of height, I like to add a few millipedes at this time as well.
Adding bugs to an established Viv
Start off by adding some clean compost or soil. Just a small handful. This will be full of beneficial bacteria to colonize your substrate layers. There is really no bad side to this. The areobic bacteria (think of these as the "good kind" ) will colonize any area with a supply of O2. The anerobic bacteria (some call this the "bad kind") will colonize areas with little or no O2. You NEED both in a terrarium. This is not an aquarium where spots with little or no current develop anerobic bacteria and become a ticking time bomb. The spots in your terraria that don't get a flow of fresh O2 never will, and vice versa. Just add it and let them do their thing - which is convert waste to fertilizer.
Next add some groundcover. The best method anyone has come up with so far is hardwood leaves. You can buy these already prepared online at any number of places. I use Elm leaves from the yard, and have for years with no bad results. Without groundcover your springtails and isopods will be sitting targets for a hungry gecko or frog.
Next step - feed your animals. Get their bellies full, then add in a few more feeders to keep them interested. This will give the tiny critters you're going to dump in a fighting chance to get under the groundcover.
Pick a corner of the viv, and place a few pieces of rice or uncooked pasta on the floor of the viv. The food stash will get your bugs breeding and populating your terrarium much faster.
Then just add your bugs. Do it with the lights on, so they are more inclined to scurry away rather than sit in a big delicious looking ball of food.
Keep the floor nice and moist. You'll probably see some white hairy fungus, especially if you put in a food pile for the bugs, but ignore it. The little critters you added will make short work of all the fungus you see, as well as things you don't see.
IMO this is the key to long term success in a naturalistic vivarium. The right microfauna will make a self balancing ecosystem inside your terrarium, and things should run smoothly for a very long time.