The transverse spatial distribution of weakly interacting Bose gas in a narrow channel is found. The corresponding analytical solution of the Gross-Pitaevskii equation has the form of a cnoidal wave. The possible physical realization of the model is a system of cold atoms or quasiparticles, e.g., excitons, cavity photons, exciton polaritons. The obtained formula is used for the numerical calculation of the spectrum of excitations and the critical velocity of the condensate. These numerical results do not coincide with the Bogoliubov spectrum, and we show that the strongly inhomogeneous condensate density leads to larger values of the critical velocity. We also make numerical estimation of the critical velocity for various types of considered particles or quasiparticles.