The widely accepted conclusion is that it came from the horse race we all know as The Derby which was first run in 1780. The race itself was named after the 12th Earl of Derby, Edward Smith-Stanley, and soon turned into a hugely prestigious occasion. It became common for many early sporting events to be called a derby, with or without the element of local rivalry involved but in more recent history the term was only ever applied to contests between teams from the same city or area. In addition to the prestige, this race was also attended each year by huge crowds, with more than half a million people flocking to Epsom Downs to watch. Therefore the word 'derby' became synonymous with big numbers of spectators. As interest in football grew, matches between local sides inevitably drew the bigger audiences, and it is thought the word was therefore appended to such games.
An alternative theory revolves around the game of football itself. From the Middle Ages, a match was contested every Shrovetide in Ashbourne, Derbyshire. The game, which was, in reality, a cross between football and rugby, saw two teams representing parishes trying to score in goals three miles apart. It was a dreadfully rough and disagreeable event, unsporting and without too many rules, and could involve anything up to 1000 villagers. At least one loss of life was recorded, and much damage to countryside property. In 1846, the Mayor successfully managed to put an end to the fixture - though only after the help of the Dragoons and the reading of the Riot Act. From a footballing point of view, this origin of the term would be better, though the horse racing connection remains the favoured and accepted option.
A third possibility is ruled out because dates do not support the story. It is said that 'derby' emanates from the Liverpool versus Everton football fixture. Their two grounds are separated by Stanley Park, owned by the Earl of Derby, and was therefore used by supporters making the short trip to their rivals ground.
In modern times of course, the local derby match for Norwich City has been against Ipswich Town. It is popularly and historically referred to as the East Anglian Derby, though some attempts have been made to apply the name of 'Old Farm Derby'. This is a twist of words (one of the most famous derbies in world football being the Old Firm meeting between Celtic and Rangers in Glasgow) and emanates partly from Ipswich using the nickname of the Tractor Boys in preference to their traditional 'Blues' or 'Town', as well as the rural and agricultural location of the two clubs. The term is applied more by supporters from elsewhere to mock the fixture, though in truth it is one of the most keenly fought derbies in English football.
Norwich City's original derby opponents came from much closer to home however, in the shape of Norwich CEYMS. The two clubs met in City's first season of existence, 1902, in the Norfolk & Suffolk League. The games are recorded as being fierce and competitive contests, with rivalry further fuelled by the fact that City had been formed by people associated with CEYMS. Early teamsheets also included players who were taken from Church (CEYMS stands for Church Of England Young Men's Society).
In recent times, some attempts have been made to consider games against Colchester United as a second East Anglian Derby. It is understandable that Ipswich may consider it a derby for them, given the small distance between the two clubs, but the idea has not caught on with Norwich City fans, not least because the gap in status has been too wide throughout history to provide many meaningful contests.