Guadarrama is a town and municipality in the Cuenca del Guadarrama comarca, in the Community of Madrid, Spain.