Soil bacterium Bradyrhizobium diazoefficiens is an N2-fixing symbiont of soybean that helps to improve grain quality. With two flagellar systems, it swims in water-saturated pores, but its motility, potentially crucial for root nodulation competitiveness, remains unclear. We designed and fabricated microfluidic soil-on-a-chip (SOC) devices, offering sustainable agriculture an innovative tool to directly visualize bacteria confined-behavior. We measured velocities and changes of direction for two strains, wild-type and a mutant with one flagellum, and found a reduction in speed and an increase in 180o changes of direction for both strains in channels of decreasing microscopic cross-section. Although the wild-type swims faster in unconfined spaces, this advantage disappears in SOCs. Furthermore, we used the measured motility parameters to model and simulate B. diazoefficiens motion in SOC devices for extended periods and larger scales, enabling further predictions of diffusion in real soils.