Here's my system:
I gather eggs and keep them in a plastic container until they hatch. Then, I keep the caterpillars in small plastic containers with paper towel at the bottom. Each day I give them fresh leaves and clean out the frass.
When the cats get bigger, about third instar, I transfer them to a huge glass aquarium I was lucky enough to pick up for free. The lid is just a big window screen I hung onto after we had our windows replaced. I keep the tank inside, out of direct sunlight. My husband is a good sport who helps me carry the tank up from the basement each year, puts up with having it at one end of our living room for a couple of months at least, and then helps me lug it back down to the basement.
I line the bottom of the tank with paper towels and have one end of the tank lined with a mesh laundry bag. When the cats form a chrysalis on the mesh lid, I give them a couple of days to fully harden and then move them to the end of the tank with the mesh lining. When the butterflies emerge, they climb up the mesh and hang to dry. I let them go the next day just to be sure they are completely ready to fly. With this system, I rarely had problems.
At the start of the summer I lost a few caterpillars and a couple of chrysalis, but now things are going very well. The only drawback to my system is the difficulty in feeding the caterpillars and cleaning up after them when I have 50 butterflies also flapping around in the tank.