Your lizard's longevity is determined by how closely you can match its specific requirements for light, heat, diet, social structure and space. The needs of the 3,000+ species vary greatly, so research your individual lizard carefully.
Lizards are very active creatures and even small species such as Carolina anoles are highly territorial and fight or refuse to eat when crowded. Your lizard's natural habitat should govern the design of its terrarium. Arboreal species such as chameleons must have branches, those inhabiting rock piles (i.e. wall lizards) must have rocks, and confirmed burrowers such as the glass lizards must be able to dig.
Each individual will likely choose a favorite basking, sleeping and hiding spot, so each is required in group situations. Dominant animals will not share their spots, and visual barriers must be provided for submissive cage mates.
Substrates can be natural, such as dead leaves for five lined skinks, but larger animals (i.e. the rhinoceros iguanas) are more easily kept clean in newspaper or hoseable bare floors. Some substrates, such as corncob, readily sticks to food and can cause impactions when swallowed.
Temperatures must vary throughout the enclosure, to allow for thermoregulation (a change in temperature to assist digestion, egg formation, etc). Most require "hot spots" of 85 degrees to 110 degrees Fahrenheit (depending upon the species) in the form of incandescent heat lamps and a 10 to 20 F drop at night. To provide nighttime heat without light, use an infrared bulb, ceramic heater or subsurface heat pad (all available at pet stores).
Nearly all diurnal lizards require a source of UVB light (280 to 315 nanometers) for calcium metabolism and of UVA (315 to 400 nanometers) for vitamin D synthesis. UVA also affects activity and reproduction in the desert iguana and other desert dwellers. Such lights (available at pet stores) should be positioned within 15 inches of your pet.
Your pet's day/night cycle should mimic its natural habitat, and seasonal cycles should be established if breeding is desired.
In addition to your pet's permanent home, a simple wire cage will allow you to bring the animal outdoors for natural sunlight. Be sure to provide shade also, even for desert species.
A proper egg-laying site (the type varies greatly from species to species) must be available, or females may refuse to lay, become egg-bound and die.
Certain lizards require special consideration. Green iguanas and most monitors grow large, and need professionally built cages or small rooms. Such large animals roaming free in a house may cause fires by upsetting lamps or transmit Salmonella to their human caretakers.
The majority of lizards require five to seven feedings per week, but adult rodent eaters such as Nile monitors, need but one or two. Insectivorous species, such as fence swifts, thrive on crickets, super mealworms, wax worms, roaches and wild caught insects. Specialists rarely take anything except their preferred prey (i.e. ants for the horned lizards). Chuckwallas and other herbivores should be given calcium-rich produce such as bok choy, carrots, green beans, dandelion, turnips and blackberries. Spinach causes calcium oxalate stones and should be avoided. The omnivorous bearded dragon and other such lizards prefer a combination of plant and animal foods.
A diet with a calcium: phosphorus ratio of less than 2:1 may lead to metabolic bone disease. Feeder insects should themselves be fed tropical fish flakes with calcium powder and prey and salads should be coated with a reptile vitamin/mineral powder (about one per week for adults and three times for juveniles).
Water may be provided in a bowl for lizards such as the savannah monitor, but the tokay geckos and other arboreal species may not recognize such, and instead lap up sprayed droplets. Chameleons drink most readily from a drip system (i.e. a plastic bottle with a hole, mounted on the cage top).
Veterinary care may be hard to find, so make provisions before a problem arises. Fecal exams and cultures can detect Salmonella and internal parasites. Problems, which you should learn to recognize, include mites and ticks, vitamin A deficiencies (swollen eyes), metabolic bone disease (lumps, swollen jaw), mouth rot (bubbles at mouth, red areas), pneumonia (bubbles at nostrils) and egg binding (swollen abdomen, restless digging and straining). Chameleons are prone to jaw infections caused by lodged insect parts. All the above require veterinary care.