Costarainera is a comune located in the Province of Imperia within the Italian region of Liguria. It is situated approximately 100 kilometres southwest of Genoa and about 9 kilometres southwest of the city of Imperia.
As of December 31, 2004, the municipality had a population of 775 residents and covered a total area of 2.4 square kilometres.