Bacteria in the natural environment exist as interface-associated colonies known as biofilms. Complex mechanisms are often involved in biofilm formation and development. Despite the understanding of the molecular mechanisms involved in biofilm formation, it remains unclear how physical effects in standing cultures influence biofilm development. The topology of the solid interface has been suggested as one of the physical cues influencing bacteria-surface interactions and biofilm development. Using the model organism Bacillus subtilis, we study the transformation of swimming bacteria in liquid culture into robust biofilms in a range of confinement geometries (planar, spherical and toroidal) and interfaces (air/water, silicone/water, and silicone elastomer/water). We find that B. subtilis form submerged biofilms at both solid and liquid interfaces in addition to air-water pellicles. When confined, bacteria grow on curved surfaces of both positive and negative Gaussian curvature. However, the confinement geometry does affect the resulting biofilm roughness and relative coverage. We also find that the biofilm location is governed by oxygen availability as well as by gravitational effects; these compete with each other in some situations. Overall, our results demonstrate that confinement geometry is an effective way to control oxygen availability and subsequently biofilm growth.