This article studies socially optimal allocations, in the first-best sense, in environments characterized by fixed resources and endogenous fertility. Individuals in our environment are fully rational and altruistic toward their descendants, the social planner is benevolent, and there is full information. Our model allows for rich heterogeneity of abilities, preferences for children, and costs of raising children. We find that efficient allocations in the endogenous fertility case differ significantly from its exogenous fertility counterpart. In particular, optimal steady-state population is proportional to the amount of fixed resources and to the level of technology while steady state individual consumption is independent of these variables, a sort of Malthusian stagnation result. Furthermore, efficient allocations exhibit inequality, differential fertility, random consumption, and a higher population density of poorer individuals. We prove a version of the second welfare theorem: efficient allocations can be decentralized through competitive markets and an initial distribution of property rights over the fixed resources.