We determine the universal deformation ring, in the sense of Mazur, of a residual representation $\bar \rho :G_K\to {\rm GL}_2(k)$, where k is a finite field of characteristic p and K is a local field of residue characteristic p. As one might hope for, but is not proven in the global case, the deformation ring is a complete intersection, flat over W(k), with the exact number of equations given by the dimension of $H^2(G_K,{\rm ad}_{\bar \rho})$. We then go on to determine the ordinary locus inside the deformation space and, using ideas of Mazur, apply this to compare the universal and the universal ordinary deformation spaces. Provided that the universal ring for ordinary deformations with fixed determinant is finite flat over W(k), as was shown in many cases by Diamond, Fujiwara, Taylor–Wiles and Wiles, we show that the corresponding universal deformation ring – with no restriction of ordinariness or fixed determinant – is a complete intersection, finite flat over W(k) of the dimension conjectured by Mazur, provided that the restriction of $\det (\bar \rho)$ to the inertia subgroup is different from the inverse cyclotomic character.