Farrelly was born in Newcastle-under-Lyme, Staffordshire, the son of an Irish gas pipe-laying foreman and a former nurse.
He was educated at the Wolstanton Grammar School (which later became Marshlands Comprehensive High School) on Milehouse Lane in Newcastle-under-Lyme, before studying at St Edmund Hall, Oxford where he obtained a BA in PPE in 1984.