A snake of forest or woodland, it is the only one of Africa's cobras that will live in high forest. The Forest Cobras are snakes that are well adapted to many environments and the habitat of the Forest Cobra is strongly dependent on what part of its African range the snake originates from. Forest Cobras originating in the southern African regions are typically found in savanna and grassland, but they can also be found in broken rock country. They are mainly found in the tropical and subtropical rainforest regions of west and central Africa. It also inhabits mangroves in western Africa. The banded form of Forest Cobra in west Africa lives in savanna and grassland (but usually along streams) and well vegetated areas, especially riverine forest, up to latitude 14 N. The species' preferred habitat are lowland forest and moist savanna where it favors coastal thickets. This snake seems to be highly adaptable and will readily move into drier areas if it can. Due to its secretive habits, and fondness for living in holes, it often persists in quite well-inhabited areas, common in and around many central African towns, even long after most vegetation has gone.
The Forest Cobra is an agile, diurnal species that climbs well and is one of the most aquatic of the true cobras. It is terrestrial, but it is fast, graceful climber, known to ascend trees to a height of 10 meters (33 feet) or more. It is quick moving and alert. It swims well and readily takes to the water; in some areas its main diet is fish and could be regarded as semi-aquatic. Although it is active mostly during the day (diurnal) in uninhabited areas, it can also be active by night (nocturnal) where it goes into urban areas. When not active, it takes cover in holes, brush piles, hollow logs, among root clusters or in rock crevices, or in abandoned termite mounds at forest fringe or clearings. In certain areas, it hides along river banks, in overhanging root systems or bird holes, and in urban areas will hide in junk piles or unused buildings. When agitated, it rears up to a considerable height and spreads a long, narrow hood. It can strike quickly, to quite a long distance, and if molested and cornered, it will rush forward and make a determined effort to bite. It is an alert and agile species of cobra. This species is not able to "spit" its venom.
Forest Cobras will feed on a wide variety of prey, including amphibians, fish, other snakes, monitor lizards and other lizards, bird eggs, rodents, and other small mammals.