We study a generic leptophilic $U(1)_X$ extension of the standard model with a light gauge boson. The $U(1)_X$ charge assignments for the leptons are guided by lepton universality violating (LUV) observables in semileptonic $b to sellell$ decays, muon anomalous magnetic moment and the origin of leptonic masses and mixing. Anomaly cancellation conditions require the addition of new chiral fermions in the model, one of which acts as a dark matter (DM) candidate when it is stabilised by an additional $mathcal{Z}_2$ symmetry. From our analysis, we show two different possible models with similar particle content that lead to quite contrasting neutrino mass origin and other phenomenology. The proposed models also have the potential to address the anomalous results in $bto cell u_{ell}$ decays like $R(D), R(D^*)$, electron anomalous magnetic moment and the very recent KOTO anomaly in the kaon sector. We also discuss different possible collider signatures of our models which can be tested in future.