Socerb was attested in written sources in the 14th century as propre Sanctum Servulum. The Slovene name is derived from *Sǫt-Serb: a combination of *sǫt- 'saint' plus *Serb.
Socerb is the site of two known mass graves associated with the Second World War. The Socerb Cave behind Vrh Mass Grave is located in the woods northeast of the village of Kastelec. The floor of the cave is covered with the remains of victims brought from Trieste and its surroundings and murdered here. The Cave 2 above Socerb Slope Mass Grave is a shaft in Cesarjevič Common east of Socerb. The fenced entrance to the shaft is in an area sparsely covered in pine. The grave contains the remains of an unknown number of victims. The remains of two victims that were taken from the cave in 1992 were buried in the Koper cemetery in 2004.