Grant was born at Nairn in the Scottish Highlands, where his father was the parish minister, and educated at Nairn Academy, Aberdeen Grammar School and Marischal College, Aberdeen. In 1846 he joined the Indian army. He saw active service in the Sikh War (1848–49), served throughout the Indian Mutiny of 1857, and was wounded in the operations for the relief of Lucknow.