As indicated by its alternate name, the gatekeeper butterfly prefers the habitat of meadow margins and hedges; field gates are often in such locations, and thus the gatekeeper can be found much more frequently in such locations than the meadow brown for example.
As a result of recent expansion, the gatekeeper is found in a wide variety of habitats.