Viruses are the most numerically abundant biological entities on Earth. As ubiquitous replicators of molecular information and agents of community change, viruses have potent effects on the life on Earth, and may play a critical role in human spaceflight, for life-detection missions to other planetary bodies and planetary protection. However, major knowledge gaps constrain our understanding of the Earth's virosphere: (1) the role viruses play in biogeochemical cycles, (2) the origin(s) of viruses and (3) the involvement of viruses in the evolution, distribution and persistence of life. As viruses are the only replicators that span all known types of nucleic acids, an expanded experimental and theoretical toolbox built for Earth's viruses will be pivotal for detecting and understanding life on Earth and beyond. Only by filling in these knowledge and technical gaps we will obtain an inclusive assessment of how to distinguish and detect life on other planetary surfaces. Meanwhile, space exploration requires life-support systems for the needs of humans, plants and their microbial inhabitants. Viral effects on microbes and plants are essential for Earth's biosphere and human health, but virus–host interactions in spaceflight are poorly understood. Viral relationships with their hosts respond to environmental changes in complex ways which are difficult to predict by extrapolating from Earth-based proxies. These relationships should be studied in space to fully understand how spaceflight will modulate viral impacts on human health and life-support systems, including microbiomes. In this review, we address key questions that must be examined to incorporate viruses into Earth system models, life-support systems and life detection. Tackling these questions will benefit our efforts to develop planetary protection protocols and further our understanding of viruses in astrobiology.