This paper analyzes sociohistorical and biological factors that shape olive–oleaster agroecosystems (hereafter OOAs), in northern Morocco and their continuing roles in olive domestication, diversification and food security. Forests are cleared and oleasters (wild olive trees) are preserved by farmers for their valuable oil and for use as rootstocks to graft olive. This practice is among those that have shaped olive domestication in the Mediterranean region. It contributes to the creation of forest-based olive agroecosystems and favors olive intraspecific diversity that is highly adapted to heterogeneous mountain environments. Productions contribute to food security, short trade circuits, land tenure and cultural identity. Ethnobiological studies show a continuity of classification, naming and uses between selected oleaster types and olive varieties suggesting an ongoing domestication process. This is supported by genetic analyses which show a higher concentration of genotypes selected from seedlings that propagate through sexual propagation in OOAs as compared to areas where management of oleasters for oil and as rootstocks is absent. Photointerpretation of aerial images corroborated with field-based observations, show the impacts of exogenous projects since the French and Spanish Protectorate periods to contemporary projects of the state policy “Plan Maroc Vert.” We discuss the importance of OOAs for the preservation of on-farm genetic resources, food security and as models for future agroecosystems within the context of climate change.