Nothing replaces the sun. Whenever you have the opportunity to take your chameleon outside for exposure to natural sunlight, please do so. Even 2-3 times a week between the hours of 10:00 am and 2:00 pm, will prove extremely beneficial. Make sure the cage is placed in partial sun/shade to avoid overheating.
Chameleons manufacture vitamin D3 from exposure to natural sunlight and store it for future use. D3 is an essential vitamin used in the absorption of calcium. Without vitamin D3 in the diet, chameleons can suffer from Metabolic Bone Disease (MBD), a crippling disease that is irreversible. With that said, keeping chameleons indoors is 100% possible, but with artificial means in place.
During periods of time when regular sunlight exposure is not possible, indoor setups should have two lighting sources in place. One should provide for UVA/UVB exposure and the other is a basking site for heat regulation. These are two separate requirements that should not be confused. Our #1 recommended UVA/UVB light is ZooMed's ReptiSun 5.0 fluorescent bulb. An important WARNING to mention is to NEVER use a 10.0 bulb on a chameleon. "More" is not better in this case. The phosphorus levels that are emitted are much too high for a chameleon, and this output of UV can actually harm or even kill your chameleon! Change the UVA/UVB bulbs periodically as recommended by the manufacturer. The life span of the bulb will vary according to its usage. UVA/UVB lighting sources do not emit adequate heat for your chameleon to warm up under, so you will need to provide a separate basking site for this purpose.
Basking sites can be created using a spot lamp fixture and an incandescent light bulb. The wattage you use will depend on the size of enclosure and species you are working with. For very large enclosures, more than one basking site may be required. You will need to provide the correct basking temperature your species needs. The only way to know whether or not the temperature range is adequate is by checking with a thermometer. One of the biggest problems in the proper care and maintenance of chameleons and other reptiles, is incorrect temperatures. You won't know unless you check, so please invest in an inexpensive thermometer. It's truly a necessity.
Lights can be put on timers so they come on and off automatically. We have our lights on a 12 hour cycle during the warmer months and a 10 hour cycle through winter, when the days are shorter. It is important to turn lights off at night so your chameleon has a chance to cool down and sleep. Indoors, we do not use any night time heat source since our ambient temperatures rarely fall below 65 degrees.