Recent results on b-flavour physics obtained by the CMS Collaboration will be presented. The flexible and poweful CMS trigger system allows the experiment to be sensitive to b-physics phenomena of different kinds, mostly in channels with muons in the final state. In this paper, some of these results will be reported, namely single quarkonia production, $\text{J}/\psi, \psi(2S), \Upsilon(1s,2s,3s)$, as well as observation of double prompt $\Upsilon$ production. The lifetimes of different states, $\text{B}^0\to \text{J}/\psi \text{K}^*$, $\text{B}^0\to \text{J}/\psi \text{K}_s$, $\text{B}_{\text{s}}^0\to \text{J}/\psi \pi\pi$, $ \text{B}_{\text{s}}^0\to \text{J}/\psi\phi$, $\Lambda_b \to \text{J}/\psi\Lambda$, and $\text{B}_{\text{c}}^+\to ...