Let k be a field of characteristic zero, \CO be a dg operad over k and let A be an \CO-algebra. In this note we define formal deformations of A, construct the deformation functor \DefA:\dgar(k)→\simpl from the category of artinian local dg algebras to the category of simplicial sets. In the case \CO and A are non-positively graded, we prove that \DefA is governed by the tangent Lie algebra TA (defined as derivations of a cofibrant resolution of A). A very easy example shows that the result does not hold without this condition.