  We prove the existence of the dualizing functor for a separated morphism of
algebraic stacks with affine diagonal; then we explicitly develop duality for
compact Deligne-Mumford stacks focusing in particular on the morphism from a
stack to its coarse moduli space and on representable morphisms. We explicitly
compute the dualizing complex for a smooth stack over an algebraically closed
field and prove that Serre duality holds for smooth compact Deligne-Mumford
stacks in its usual form. We prove also that a proper Cohen-Macaulay stack has
a dualizing sheaf and it is an invertible sheaf when it is Gorenstein. As an
application of this general machinery we compute the dualizing sheaf of a tame
nodal curve.
