We show how to derive the heavy quark effective theory from QCD by carrying out the usual steps for the construction of an effective theory. Using functional methods we first integrate out heavy degrees of freedom and then give the expansion of the resulting nonlocal action functional in powers of 1/m(Q), m(Q) being the mass of the heavy quark.