Shantaram is a novel influenced by real events in the life of the author, Australian Gregory David Roberts. In 1978, Roberts was sentenced to 19-year imprisonment in Australia after being convicted of a series of armed robberies of building society branches, credit unions, and shops. In July 1980, he escaped from Victoria’s Pentridge Prison in broad daylight, thereby becoming one of Australia's most wanted men for the next ten years.
The protagonist Lindsay (according to the book, Roberts' fake name) arrives in Mumbai carrying a false passport in the name of Lindsay Ford. Mumbai was only a stopover on a journey that was to take him from New Zealand to Germany, but he decides to stay in the city. Lindsay soon meets a local man named Prabaker whom he hires as a guide, but soon becomes his best friend and renames him Lin (Linbaba). Both men visit Prabaker's native village, Sunder, where Prabaker's mother decided to give Lin a new Maharashtrian name, like her own. Because she judged his nature to be blessed with peaceful happiness, she decided to call him Shantaram, meaning Man of God's Peace. On their way back to Mumbai after a night out, Lin and Prabaker are robbed. With all his possessions gone, Lin is forced to live in the slums, giving him shelter from the authorities and free rent in Mumbai. After a massive fire on the day of his arrival in the slum, he sets up a free health clinic as a way to contribute to the community. He learns about the local culture and customs in this crammed environment, gets to know and love the people he encounters, and even becomes fluent in Marathi, the local language. He also witnesses and battles outbreaks of cholera and firestorms, becomes involved in trading with the lepers, and experiences how ethnic and marital conflicts are resolved in this densely crowded and diverse community.
The novel describes a number of foreigners of various origins, as well as local Indians, highlighting the rich diversity of life in Mumbai. Lin falls in love with Karla, a Swiss-American woman who does not love him back, befriends local artists and actors, landing him roles as an extra in several Bollywood movies, and is recruited by the Mumbai underworld for various criminal operations, including drug and weapons trade. Lin eventually lands in Mumbai's Arthur Road Prison, where he endures many beatings and other physical and mental abuse by guards, while existing under extremely squalid conditions, along with hundreds of other inmates. However, thanks to the protection of Afghan mafia don "Abdel Khader Khan", Lin is eventually released, and works in black market currency exchange and passport forgery. Having travelled as far as Africa on trips commissioned by the mafia, Lin later goes to Afghanistan to smuggle weapons for mujahideen freedom fighters in Afghanistan. When his mentor Khan is killed, Lin realizes he became everything he grew to loathe and falls into depression after he returns. He decides that he must fight for what he believes is right, and build an honest life. The story ends with him planning to go to Sri Lanka which lays the premise for the sequel to this book.