The film was adapted from the story "Pandey Kaun Kumati Tohe Laagi" in Kashinath Singh's book "Kashi Ka Assi" (2004). The story was first published as part of a series published in the literary magazine "Hans". The series was eventually compiled in "Kashi Ka Assi" published by Rajkamal Prakashan. The film opened with an acknowledgment - "A tribute to all the characters of 'Kashi Ka Assi".
The film's release was plagued by many problems. It was completed in 2011 and was scheduled to be released the same year. However, the release was stalled after it was reported that the film's crew, including director Chandraprakash Dwivedi, had not been paid their dues by producer Vinay Tiwari. Dwivedi registered a complaint with the Indian Film and Television Director’s Association (IFTDA) and sought their intervention in the matter. Tiwari maintained that he had made all the payments. It looked like the issue was resolved when the film's trailer was released in June 2015. Producer Vinay Tiwari announced that the film would be released later that year. However, a controversy erupted over the trailer - many found it disrespectful of the city of Varanasi and its traditions and offensive to Hindus. A scene featuring an abusive character dressed as Shiva was found to be particularly objectionable. The trailer triggered a series of legal complaints against the makers of the film. A Delhi court issued an injunction order against CBFC and the filmmaker restraining them from releasing the film "till further orders". A Bihar court ordered an FIR against the filmmakers as well as the lead actor Sunny Deol. The Lucknow bench of the Allahabad High Court issued a notice to CBFC seeking clarification on whether the trailer was approved by them. Taken aback by the sharp reaction against the trailer, director Chandraprakash Dwivedi disowned it and claimed that it was made up of illegal, pirated footage. He claimed that the leaking of the "trailer" was an attempt to malign him and sabotage the film and that he would take up the matter with the authorities. In 2016, the filmmakers submitted the film to the CBFC for review but the board refused to certify it. In a letter, the CBFC said that the film was not being given a certificate since it was full of abusive words and because it would hurt the sentiments of some people and cause a law and order problem. Interestingly, Dwivedi himself was a member of CBFC. It was speculated that the film was being blocked due to his run-ins in the past with the board chairperson Pahlaj Nihalani. An appeal with the Film Certification Appellate Tribunal (FCAT) resulted in an order asking the filmmakers to make 10 modifications and resubmit the film for review. The filmmakers refused to accept the cuts and fought a long legal battle against the CBFC to overturn the order. They won the case in January 2018. The court ordered the CBFC to give the film an 'A' certificate with just one cut. The film was released in November 2018.
Ameesha Patel was the original choice for the film's female lead. She did not come on board since she was not happy with the fee offered to her. It was reported that Sunny Deol, on the other hand, did not charge any fee for the film.