Let (M 3 , g, e − f dμ M ) be a compact three-dimensional smooth metric measure space with nonempty boundary. Suppose that M has nonnegative Bakry-Émery Ricci curvature and the boundary ∂ M is strictly f -mean convex. We prove that there exists a properly embedded smooth f -minimal surface in M with free boundary ∂ on ∂ M. If we further assume that the boundary ∂ M is strictly convex, then we prove that M 3 is diffeomorphic to the 3-ball B 3 , and a compactness theorem for the space of properly embedded f -minimal surfaces with free boundary in such (M 3 , g, e − f dμ M ), when the topology of these f -minimal surfaces is fixed.