A sporting contest between rivals from the same district. Often referring to football (soccer) matches.
It is widely reported that the phrase originates from the town of Ashbourne, Derbyshire, England. There, since as early as the 12th century, two teams from opposite ends of the town play a rough and tumble football/rugby type of game called the Royal Shrovetide Football Match. The match is between the 'uppers' and the 'downers' - townspeople from opposite sides of the river that runs through the town. The object of the game is to get a painted leather ball into the opposition's goal by fair means or foul. You might get a flavour of the scene from the fact that the goals are three miles apart and that one of the (few) rules is that 'unnecessary' violence is frowned upon. This type of game used to be common on feast days throughout England, and this example is still played out annually at Ashbourne.
In normal circumstances evidence linking an event with a phrase having a 900 hundred-year pedigree would be persuasive. Unfortunately, there's nothing apart from local folklore, which is always present when locals lay claim to a phrase, to link the phrase to the town or to the Shrovetide match. After all, the phrase isn't 'a local Ashbourne'.
The actual source is more prosaic. The Derby is the name of the premier horse race in England and the contest was founded by the twelfth Earl of Derby in 1780. Since at least as early as 1840 'derby' has been used as a noun in English to denote any kind of sporting contest. A local derby is just a sporting contest between local rivals.
Early uses of the phrase referred to football (soccer) matches and the first printed citation appears to be the Daily Express, October 1914:
"A local Derby between Liverpool and Everton".
Such matches between the two clubs are still energetically contested. Many other clubs in this and other sports now meet to contest their own 'local derby'.