  We compute the gluon beam function for jet-veto resummation to
next-to-next-to-leading order (NNLO) in the strong-coupling expansion. Our
calculation is based on an automated framework that was previously used for the
computation of the respective quark beam function, and which we significantly
extended for the present calculation. In particular, the perturbative matching
kernels are directly calculated in momentum space, without the need to perform
an additional Mellin transform. We present results for both gluon and
quark-initiated processes, which we cross-checked with an independent
semi-analytical method that exploits the similarity of the beam functions to
the more familiar case of transverse-momentum resummation. Our computation is
relevant for jet-veto resummations at NNLL$'$ accuracy.
