You don'tt need a fancy insect terrarium to raise a caterpillar. Just about any container large enough to accommodate the caterpillar and its food plant will do the job. A gallon-sized jar or old fish tank will provide a luxurious and easy to clean home. Once you have a suitable container, you'll need to add a few things to give the place a "homey" feel.
Since some caterpillars burrow in the soil to pupate, it's a good idea to line the bottom of your container with about an inch of slightly moist sand or soil. The soil should not be too wet – you don't want to end up with condensation on the sides of your jar. Other caterpillars hang from twigs or other surfaces to pupate. Add a stick or two, secured in the soil and leaning against the side. This also gives the caterpillar a way to climb back on its food plant, should it fall off.
To keep the caterpillar's food plant fresh, place the stems in a small jar of water. Fill any space between the stems and the lip of the small jar with wadded paper towels or cotton balls to prevent your caterpillar from falling into the water and drowning. Put the small jar with the food plant into the caterpillar jar.
When the butterfly or moth emerges, it will need a place to cling while it unfurls its wings and dries them (like in these time lapse photos of a monarch unfurling its wings). Once the caterpillar pupates, you can tape a paper towel to the wall of the jar or aquarium to give the adult a place to cling. Place the tape at the top, and allow the paper towel to hang freely to the bottom. Sticks also work well for giving the butterfly or moth a place to hang.
You don't need to provide water – caterpillars get their moisture from the plants they consume. Cover the jar opening with a fine mesh screen or cheesecloth, and secure it with a rubber band.