In this paper, we introduce the notion of variational free boundary problem. Namely, we say that a free boundary problem is variational if its solutions can be characterized as the critical points of some shape functional. Moreover, we extend the notion of nondegeneracy of a critical point to this setting. As a result, we provide a unified functional-analytical framework that allows us to construct families of solutions to variational free boundary problems whenever the shape functional is nondegenerate at some given solution. As a clarifying example, we apply this machinery to construct families of nontrivial solutions to the two-phase Serrin's overdetermined problem in both the degenerate and nondegenerate case.