In 1987 Serre conjectured that any mod $\ell$ $2$ -dimensional irreducible odd representation of the absolute Galois group of the rationals came from a modular form in a precise way. We present a generalization of this conjecture to 2-dimensional representations of the absolute Galois group of a totally real field where $\ell$ is unramified. The hard work is in formulating an analogue of the weight part of Serre's conjecture. Serre furthermore asked whether his conjecture could be rephrased in terms of a “mod $\ell$ Langlands philosophy.” Using ideas of Emerton and Vignéras, we formulate a mod $\ell$ local-global principle for the group $D^*$ , where $D$ is a quaternion algebra over a totally real field, split above $\ell$ and at $0$ or $1$ infinite places, and we show how it implies the conjecture.