stuart was born on 7 september 1815, at dysart, fife, scotland. his father, william stuart, had been a captain in the british army. his mother was mary mcdouall. they had nine children, john mcdouall was the sixth. his parents died when he was ten years old. the children were separated and sent to live with different relatives. stuart was educated at the scottish naval and military academy in edinburgh. he studied to be an engineer and surveyor.