Based on the studies of confinement of quarks, we introduce a linear scalar potential into the relativistic quantum dynamics of a scalar particle. Then we analyze the linear confinement of a relativistic scalar particle in a Gödel-type spacetime in the presence of a topological defect. We consider a Gödel-type spacetime associated with null curvature, i.e., the Som-Raychaudhuri spacetime, which is characterized by the presence of vorticity in the spacetime. Then we search for analytical solutions to the Klein-Gordon equation and analyze the influence of the topology of the cosmic string and the vorticity on the relativistic energy levels.