Lugiato-Lefever (LL) equations in one and two dimensions (1D and 2D) accurately describe the dynamics of optical fields in pumped lossy cavities with the intrinsic Kerr nonlinearity. The external pump is usually assumed to be uniform, but it can be made tightly focused too-in particular, for building small pixels. We obtain solutions of the LL equations, with both the focusing and defocusing intrinsic nonlinearity, for 1D and 2D confined modes supported by the localized pump. In the 1D setting, we first develop a simple perturbation theory, based in the sech ansatz, in the case of weak pump and loss. Then, a family of exact analytical solutions for spatially confined modes is produced for the pump focused in the form of a delta-function, with a nonlinear loss (two-photon absorption) added to the LL model. Numerical findings demonstrate that these exact solutions are stable, both dynamically and structurally (the latter means that stable numerical solutions close to the exact ones are found when a specific condition, necessary for the existence of the analytical solution, does not hold). In 2D, vast families of stable confined modes are produced by means of a variational approximation and full numerical simulations.