Nostoc can be found in soil, on moist rocks, at the bottom of lakes and springs (both fresh- and saltwater), and rarely in marine habitats. It may also grow symbiotically within the tissues of plants, such as the evolutionarily ancient angiosperm Gunnera[2] and the hornworts (a group of bryophytes), providing nitrogen to its host through the action of terminally differentiated cells known as heterocysts. These bacteria contain photosynthetic pigments in their cytoplasm to perform photosynthesis.

When it is on the ground, a Nostoc colony is ordinarily not seen, but after a rain, it swells up into a conspicuous, jellylike mass, which was once thought to have fallen from the sky, hence the popular names, star jelly, troll’s butter, witch's butter (not to be confused with the fungus Tremella mesenterica), and witch’s jelly.