Ojacastro is a village and municipality in the province and autonomous community of La Rioja, in northern Spain. It is located in the western part of La Rioja, within the comarca of Ezcaray, near the upper course of the Oja River.
The municipality covers an area of 44.32 square kilometres (17.11 square miles). As of 2011, it had a population of 198 people, making it a sparsely populated rural community.