This paper examines the factors that influence the long-term sustainability of FLOSS projects. A model of project sustainability based on organizational ecology is developed and tested empirically. Data about activity and contribution patterns over the course of five years for 2,772 projects registered with SourceForge is analyzed. Our results suggest that the size of the project’s development base, project age and the size of niche occupied by the project are positively related to the project’s ability to attract user and/or developer resources. The ability to attract resources is an indicator of the perceived project legitimacy, which in turn is a strong predictor of the project’s future sustainability. Thus a project’s ability to attract developer and user resources is shown to play a mediating role between the demographic (size and age) and ecological (niche) characteristics of the project and its future sustainability. Our results support the applicability of tenets of organizational ecology related to the liability of smallness, the liability of newness, and population characteristics (niche size) to the FLOSS development environment. The implications of the results for future research and practice are discussed.