We study the thermodynamics near the generic (density-driven) superfluid--Mott-insulator transition in the three-dimensional Bose-Hubbard model using the nonperturbative renormalization-group approach. At low energy, the physics is controlled by the Gaussian fixed point and becomes universal. Thermodynamic quantities can then be expressed in terms of the universal scaling functions of the dilute Bose gas universality class while the microscopic physics enters only via two nonuniversal parameters, namely, the effective mass ${m}^{*}$ and the ``scattering length'' ${a}^{*}$ of the elementary excitations at the quantum critical point between the superfluid and Mott-insulating phases. A notable exception is the condensate density in the superfluid phase which is proportional to the quasiparticle weight ${Z}_{\mathrm{qp}}$ of the elementary excitations. The universal regime is defined by ${m}^{*}{a}^{*}{}^{2}T\ensuremath{\ll}1$ and ${m}^{*}{a}^{*}{}^{2}|\ensuremath{\delta}\ensuremath{\mu}|\ensuremath{\ll}1$ or, equivalently, $|\overline{n}\ensuremath{-}{\overline{n}}_{c}|{a}^{*}{}^{3}\ensuremath{\ll}1$, where $\ensuremath{\delta}\ensuremath{\mu}=\ensuremath{\mu}\ensuremath{-}{\ensuremath{\mu}}_{c}$ is the chemical potential shift from the quantum critical point $(\ensuremath{\mu}={\ensuremath{\mu}}_{c},\phantom{\rule{0.28em}{0ex}}T=0)$ and $\overline{n}\ensuremath{-}{\overline{n}}_{c}$ the doping with respect to the commensurate density ${\overline{n}}_{c}$ of the $T=0$ Mott insulator. We compute ${Z}_{\mathrm{qp}}$, ${m}^{*}$, and ${a}^{*}$ and find that they vary strongly with both the ratio $t/U$ between hopping amplitude and onsite repulsion and the value of the (commensurate) density ${\overline{n}}_{c}$. Finally, we discuss the experimental observation of universality and the measurement of ${Z}_{\mathrm{qp}}$, ${m}^{*}$, and ${a}^{*}$ in a cold-atomic gas in an optical lattice.