  K2-18 is a nearby M2.5 dwarf, located at 34 pc and hosting a transiting
planet which was first discovered by the {\it K2} mission and later confirmed
with {\it Spitzer Space Telescope} observations. With a radius of $\sim 2 \,
R_{\oplus}$ and an orbital period of $\sim 33$ days, the planet lies in the
temperate zone of its host star and receives stellar irradiation similar to
Earth. Here we perform radial velocity follow-up observations with the visual
channel of CARMENES with the goal of determining the mass and density of the
planet. We measure a planetary semi-amplitude of $K_b \sim 3.5$ \mpersec\ and a
mass of $M_b \sim 9 \, M_{\oplus}$, yielding a bulk density around $\rho_b \sim
4 \, \mathrm{g \,cm^{-3}}$. This indicates a low-mass planet with a composition
consistent with a solid core and a volatile-rich envelope. A signal at 9 days
was recently reported using radial velocity measurements taken with the HARPS
spectrograph. This was interpreted as being due to a second planet. We see a
weaker, time and wavelength dependent signal in the CARMENES data set and thus
favor stellar activity for its origin. \ktwo\ joins the growing group of
low-mass planets detected in the temperate zone of M dwarfs. The brightness of
the host star in the near-infrared makes the system a good target for detailed
atmospheric studies with the {\it James Webb Space Telescope}.
