 McGhee was born in Lurgan, County Armagh in January or early February 1851, the son of a tenant farmer who later became a shopkeeper.McGhee was educated at the local school in Lurgan and then went to Glasgow to become an engineering apprentice.In 1880 he married Mary Campbell, who lived until 1949.