Density functional theory and density functional perturbation theory are used to investigate the electronic and vibrational properties of TiS$_2$. Within the local density approximation the material is a semi-metal both in the bulk and in the monolayer form. Most interestingly we observe a Kohn anomaly in the bulk phonon dispersion, which turns into a charge density wave instability when TiS$_2$ is thinned to less than four monolayers. Such charge density wave phase can be tuned by compressive strain, which appears to be the control parameter of the instability.