Hornby was born in 1785, the son of Geoffrey Hornby, rector of Winwick, and his wife Lucy Stanley.
In 1797, Britain was embroiled in the French Revolutionary Wars, and Hornby's ship became caught up in the Nore Mutiny just weeks after he joined her.