In this paper and its follow-up [Merkulov and Vallette, J. reine angew. Math.], we study the deformation theory of morphisms of properads and props thereby extending Quillen's deformation theory for commutative rings to a non-linear framework. The associated chain complex is endowed with an L ∞ -algebra structure. Its Maurer-Cartan elements correspond to deformed structures, which allows us to give a geometric interpretation of these results. To do so, we endow the category of prop(erad)s with a model category structure. We provide a complete study of models for prop(erad)s. A new effective method to make minimal models explicit, that extends the Koszul duality theory, is introduced and the associated notion is called homotopy Koszul . As a corollary, we obtain the (co)homology theories of (al)gebras over a prop(erad) and of homotopy (al)gebras as well. Their underlying chain complex is endowed with an L ∞ -algebra structure in general and a Lie algebra structure only in the Koszul case. In particular, we make the deformation complex of morphisms from the properad of associative bialgebras explicit. For any minimal model of this properad, the boundary map of this chain complex is shown to be the one defined by Gerstenhaber and Schack. As a corollary, this paper provides a complete proof of the existence of an L ∞ -algebra structure on the Gerstenhaber-Schack bicomplex associated to the deformations of associative bialgebras.