  We study the impact of an additional $U(1)'$ gauge symmetry with
flavour-dependent charges for quarks and leptons on the LHC flavour anomalies
observed in $B \to K^* \mu^+\mu^-$, $R(K) = B \to K \mu^+\mu^-/B \to K e^+e^-$,
and $h \to \mu\tau$. In its minimal version with two scalar doublets, the
resulting model naturally explains the deviations from the Standard Model
observed in $B \to K^* \mu^+\mu^-$ and $R(K)$. The CMS access in $h \to
\mu\tau$ can be explained by introducing a third scalar doublet, which gives
rise to a prediction for $\tau \to 3\mu$. We investigate constraints from
flavour observables and direct LHC searches for $pp \to Z' \to \mu^+\mu^-$. Our
model successfully generates the measured fermion-mixing matrices and does not
require vector-like fermions, unlike previous attempts to explain these
anomalies.
