A system of self-gravitating massive fermions is studied in the framework of the general-relativistic Thomas-Fermi model. We study the properties of the free energy functional and its relation to Einstein's field equations. We then describe a self-gravitating fermion gas by a set of Thomas-Fermi type self-consistency equations.