Bacterial migration through confined spaces is critical for several phenomena, such as biofilm formation, bacterial transport in soils, and bacterial therapy against cancer. In the present work, E. coli (strain K12-MG1655 WT) motility was characterized by recording and analyzing individual bacterium trajectories in a simulated quasi-two-dimensional porous medium. The porous medium was simulated by enclosing, between slide and cover slip, a bacterial-culture sample mixed with uniform 2.98-μm-diameter spherical latex particles. The porosity of the medium was controlled by changing the latex particle concentration. By statistically analyzing several trajectory parameters (instantaneous velocity, turn angle, mean squared displacement, etc.), and contrasting with the results of a random-walk model developed ad hoc, we were able to quantify the effects that different obstacle concentrations have upon bacterial motility.