Genome-scale metabolic modeling has become widespread for analyzing microbial metabolism. Extending this established paradigm to more complex microbial communities is emerging as a promising way to unravel the interactions and biochemical repertoire of these omnipresent systems. While several modeling techniques have been developed for microbial communities, little emphasis has been placed on the need to impose a time-averaged constant growth rate across all members for a community to ensure co-existence and stability. In the absence of this constraint, the faster growing organism will ultimately displace all other microbes in the community. This is particularly important for predicting steady-state microbiota composition as it imposes significant restrictions on the allowable community membership, composition and phenotypes. In this study, we introduce the SteadyCom optimization framework for predicting metabolic flux distributions consistent with the steady-state requirement. SteadyCom can be rapidly converged by iteratively solving linear programming (LP) problem and the number of iterations is independent of the number of organisms. A significant advantage of SteadyCom is compatibility with flux variability analysis. SteadyCom is first demonstrated for a community of four E. coli double auxotrophic mutants and is then applied to a gut microbiota model consisting of nine species, with representatives from the phyla Bacteroidetes, Firmicutes, Actinobacteria and Proteobacteria. In contrast to the direct use of FBA, SteadyCom is able to predict the change in species abundance in response to changes in diets with minimal additional imposed constraints on the model. By randomizing the uptake rates of microbes, an abundance profile with a good agreement to experimental gut microbiota is inferred. SteadyCom provides an important step towards the cross-cutting task of predicting the composition of a microbial community in a given environment.