The purpose of this work is to define a derived Hall algebra $\mathcal{DH}(T)$ , associated to any differential graded (DG) category $T$ (under some finiteness conditions), generalizing the Hall algebra of an abelian category. Our main theorem states that $\mathcal{DH}(T)$ is associative and unital. When the associated triangulated category $[T]$ is endowed with a t-structure with heart $\mathcal{A}$ , it is shown that $\mathcal{DH}(T)$ contains the usual Hall algebra $\mathcal{H}(\mathcal{A})$ . We also prove an explicit formula for the derived Hall numbers purely in terms of invariants of the triangulated category associated to $T$ . As an example, we describe the derived Hall algebra of a hereditary abelian category