Avoid containers made of things like cardboard, or any containers lined in fabric. These surfaces will be easy for the worms to latch onto and climb up, which could allow them to get out. As long as the container is at least 8 centimeters deep and has slippery sides, you can probably get away without putting a lid on it. But, if you want a lid, just make sure you poke small airholes in the top. Try using cheesecloth as an alternative, as this will also help keep other insects out of the container. [2] X Research source

You can try a mixture of these different items, as well. Use a food processor to grind up larger pieces to make the substrate more consistent in texture and size. You can layer the lining to be about 4 centimeters deep in the container.

Don’t put any water in the container. Mealworms will crawl into a water dish and end up drowning. Use the fruit and vegetables as a source of moisture and water. Switch out dried or molded pieces of fruit and vegetables for fresh ones as needed.

You can use a sifter to gently separate the worms from the bedding when you need to change it, or even when you need to remove the worms for any other reason.

If you don’t plan to keep the mealworms into the next stages of life, keep in mind that they usually remain at the larval (worm) phase for 8-10 weeks. If you purchase the worms and they are already fully grown, you may have less time than that. [9] X Research source

If you notice pupae in your container, transfer them into another container that is lined with a paper towel rather than the bedding. This will give the pupae something to hold onto while they transition into their next life stage, which will take anywhere from 6-24 days. [11] X Research source

On the other hand, if you have a large amount of larvae and want to use them as food for pets, you can refrigerate the larvae in a container with holes in the lid and they will last longer. But, temperatures lower than 40 degrees (F) may cause the worms to die.