Although astrobiology studies how life functions and evolves, ecology is still largely overlooked in astrobiology research. Here we present an argument for astroecology, a merger of ecology and astrobiology, a self-aware scientific endeavour. Ecology is rarely mentioned in influential documents like the NASA Astrobiology Strategy (2015), and terms such as ‘niche’ can end up being used in a less precise fashion. As ecology deals with sequential levels of organization, we suggest astrobiologically-relevant problems for each of these levels. Organismal ecology provides ecological niche modelling, which can aid in evaluating the probability that Earth-like life would survive in extraterrestrial environments. Population ecology provides a gamut of models on the consequences of dispersal, and if lithopanspermia can be validated as a form of space dispersal for life, then metabiospheres and similar astrobiological models could be developed to understand such complex structure and dynamics. From community ecology, the discussion of habitability should include the concept of true vacant habitats (a misnomer, perhaps better called ‘will-dwells’) and contributions from the blossoming field of microbial ecology. Understanding ecosystems by focusing on abiotic properties is also key to extrapolating from analogue environments on Earth to extraterrestrial ones. Energy sources and their distribution are relevant for ecological gradients, such as the biodiversity latitudinal gradient – would tropics be species-rich in other inhabited planets? Finally, biosphere ecology deals with integration and feedback between living and non-living systems, which can generate stabilized near-optimal planetary conditions (Gaia); but would this work for other inhabited planets? Are there ‘strong’ (like Earth) and ‘weak’ (perhaps like Mars) biospheres? We hope to show ecology can contribute relevant ideas to the interdisciplinary field of astrobiology, helping conceptualize further levels of integration. We encourage new partnerships and for astrobiologists to take ecology into account when studying the origin, evolution and distribution of life in the universe.