Place 2 inches of perlite in the bottom of a 6- to 8-inch-diameter container. Add about 1/2 inch of sphagnum moss on top of the perlite. Mix together equal parts of perlite, sand and peat moss. Add this mixture to the container up to within 1 inch from the container edge. Make a hole in the center of the medium deep and wide enough for the roots of the cobra lily. Place the roots in the hole up to the base of the stem and cover with the medium.
Place the container plant in a location where it will receive filtered, not direct, sunlight. In the wild, the cobra plant receives some sunlight, but most of the day, the plants are shaded by tree leaves.
Water the plant with cold water daily to keep the medium wet to mimic the natural boggy conditions of its habitat. Rainwater will work best; you may also use tap water that has been set out for 24 hours so the chemicals dissipate.
Give the plant at least one insect each month. Flies are the easiest to drop into the pitcher with a tweezers. Do not fertilize the plant. Insects are the best food for the carnivorous plant from spring to fall. During the winter, the plant will rest and will not need to be fed. During the spring, summer and fall, you can keep the potted cobra lily outdoors in a shady location so the plant can catch its own insects for food.