In its native Europe Alliaria is an edge species, growing in hedges and fencerows (Fitter et al. 1974, Martin 1982) and in open woods (Wilmanns and Bogenrieder 1988). Alliaria is disturbance adapted, and is frequently a component of ruderal communities (Swies and Kucharczyk 1982), including open, highly disturbed forests (Klauck 1986).
In North America Alliaria invades wet to dry-mesic deciduous forest (Cavers et al. 1979, Nuzzo 1992a, 1993a), and also occurs in the partial shade characteristic of oak savanna, forest edges, hedgerows, shaded roadsides, and urban areas, and occasionally in full sun (Nuzzo 1991a). Alliaria is rarely found under coniferous trees in the Midwest, but has been reported from under seven species of coniferous trees in Ontario (Cavers et al. 1979). Alliaria grows on sand, loam, and clay soils, and on both limestone and sandstone substrates, but has been observed only once growing on a drained peat soil, and does not occur on muck soils. Alliaria frequently grows in well-fertilized sites (Cavers et al. 1979), and is described as a nitrophile by Passarge (1976) and Wilmanns and Bogenrieder (1988). In Europe, Alliaria increased in cover with deposition of air-borne industrial emissions, which increased soil nitrogen, nitrate, phosphorous and pH (Wilmanns et al. 1986, Wilmanns and Bogenrieder 1988).
Alliaria is common in river-associated habitat, particularly in the Northeast (Nuzzo 1993a). It may preferentially invade drier forest communities in the Midwest than it does in the northeast (Nuzzo 1993a). This is supported by the higher presence along railroads in the Midwest (Nuzzo 1993a), which are generally indicative of drier habitats. Byers and Quinn (1987) reported that Alliaria, once considered a plant of floodplains and moist woods in New Jersey, had become common in a wider range of habitats. In the Great Plains Alliaria is most frequently recorded from moist, usually riverine, habitat and waste ground (Kansas and Oklahoma), while on the eastern edge of the Rocky Mountains Alliaria has been recorded along hiking trails (Utah), and on hotel grounds and around a beaver pond (Colorado).