Direct numerical simulations of the turbulence of a Herschel–Bulkley (HB) fluid in a rough channel are performed at a shear Reynolds number $Re_{\tau } \approx 300$ and a Bingham number ${Bn} \approx 0.9$. For the type of rough surface used in this study, the results indicate that Townsend's wall similarity hypothesis also holds for HB fluids. However, there are notable differences compared with the effect of roughness on Newtonian fluids. More specifically, the effect of roughness appears to be slightly stronger for HB fluids, in the sense that the bulk Reynolds number, based on the viscosity at the wall, is reduced further due to the increase in viscosity in the troughs of the roughness surface induced by the low shear. At the same time, for the simulated rough surface, the contribution of form drag to the total pressure drop is reduced from 1/4 to about 1/5 due to the persistence of viscous shear in the boundary layer, reducing its shielding effect. As for the friction factor, due to the nonlinearity of the HB constitutive relation, its use with the wall shear rate from the mean wall shear stress underpredicts the minimum viscosity at the wall by up to 18 %. This inevitably leads to uncertainties in the prediction of the friction factor. Finally, it is observed that the rough surface is unable to break the peculiar near-wall flow structure of HB fluids, which consists of long persistent low-speed streaks occupying the entire domain. This means that the small-scale energy is significantly reduced for HB fluids, even in rough channels, with the energy more concentrated in the lower wavenumber range, implying an increase in the slope of the power spectrum to $-7/2$ in the inertial range, as shown by Mitishita et al. (J. Non-Newtonian Fluid Mech., vol. 293, 2021, 104570).