When he was a youth, Bunyan led a decidedly impious life, by his own admission laced with profanity, dancing, and bell ringing. Then, in his early 20s, he married a young woman and settled down. As a young man, Bunyan joined a nonconformist sect that refused to abide by the teachings of the Church of England. He started preaching in his late 20s. The Puritans were in power and Bunyan had considerable freedom to preach. Bunyan's first book, Some Gospel Truths, was published in 1656. The following year, his second book, Vindication, came out.
His first wife died, leaving him with four children. He married again and had two more children. In the meantime, Charles II restored the monarchy in England and the Church of England became the mandatory church of the land. He was arrested for preaching without a license.
Still, Bunyan refused to conform and continued to preach in private meetings not part of the Anglicans. He was taken to court where he told magistrates "If you release me today, I will preach tomorrow." The judges had no choice but to put him in jail, where he remained for some time. He was finally released again in 1672, was licensed to preach under a new law. But then the law was withdrawn and he landed in jail again. Scholars think he began writing The Pilgrim's Progress while he was in jail, though there is some disagreement whether he began it during the first term or the second.
Bunyan also wrote an imaginary biography, The Life and Death of Mr. Badman (1680), another allegory, The Holy War (1682), and a spiritual autobiography, Grace Abounding to the Chief of Sinners (1666).
The Pilgrim's Progress, along with the Bible, was once the among most widely read and translated books in the English language. In all, Bunyan wrote about 60 books and pamphlets. Rudyard Kipling considered him the father of the novel and "salvation's first Defoe."