Recently, in Zhang et al. (Phys. Rev. Lett., vol. 124, 2020, 084505), it was found that, in rapidly rotating turbulent Rayleigh–Bénard convection in slender cylindrical containers (with diameter-to-height aspect ratio $\varGamma =1/2$) filled with a small-Prandtl-number fluid (${Pr}\approx 0.8$), the large-scale circulation is suppressed and a boundary zonal flow (BZF) develops near the sidewall, characterized by a bimodal probability density function of the temperature, cyclonic fluid motion and anticyclonic drift of the flow pattern (with respect to the rotating frame). This BZF carries a disproportionate amount (${>}60\,\%$) of the total heat transport for ${Pr} < 1$, but decreases rather abruptly for larger ${Pr}$ to approximately $35\,\%$. In this work, we show that the BZF is robust and appears in rapidly rotating turbulent Rayleigh–Bénard convection in containers of different $\varGamma$ and over a broad range of ${Pr}$ and ${Ra}$. Direct numerical simulations for Prandtl number $0.1 \leq {\textit {Pr}} \leq 12.3$, Rayleigh number $10^7 \leq {Ra} \leq 5\times 10^{9}$, inverse Ekman number $10^{5} \leq 1/{\textit {Ek}} \leq 10^{7}$ and $\varGamma = 1/3$, 1/2, 3/4, 1 and 2 show that the BZF width $\delta _0$ scales with the Rayleigh number ${Ra}$ and Ekman number ${\textit {Ek}}$ as $\delta _0/H \sim \varGamma ^{0} Pr^{\{-1/4, 0\}} {Ra}^{1/4} {\textit {Ek}}^{2/3}$ ($\{{\textit {Pr}}<1, {\textit {Pr}}>1\}$) and with the drift frequency scales as $\omega /\varOmega \sim \varGamma ^{0} Pr^{-4/3} {Ra}\,{\textit {Ek}}^{5/3}$, where $H$ is the cell height and $\varOmega$ the angular rotation rate. The mode number of the BZF is 1 for $\varGamma \lesssim 1$ and $2 \varGamma$ for $\varGamma = \{1,2\}$ independent of ${Ra}$ and ${Pr}$. The BZF is quite reminiscent of wall mode states in rotating convection.