In their native home range (sub-Saharan Africa), medflies are found in forests, open woodland in highland areas, and at the coast, shrublands, and dunes. Their dispersal across suboptimal habitats, such as areas where woody vegetation is dominant, is possible because of their ability to both exploit plants in dry habitats and their ability to migrate over moderate-to-substantial distances.
Ceratitis capitata hcan be found in agricultural areas where large quantities of fruit provide plenty of food. This species is widespread and may be found anywhere from sea level to mountainous areas (over 2,133 m in elevation). Its habitat use maybe be affected by other fruit fly species: when first introduced to Hawaii, medflies were found in the lowlands but since the subsequent introduction of the oriental fruit fly (Bactrocera dorsalis) in 1945, they are only found at higher elevations.
Range elevation: 0 to 2133 m.
Habitat Regions: temperate ; tropical ; terrestrial
Terrestrial Biomes: savanna or grassland ; forest ; rainforest ; scrub forest ; mountains
Other Habitat Features: agricultural