Modi prayed at a temple before arriving at the election office in the north Indian city, flanked by Amit Shah, president of his Hindu nationalist Bharatiya Janata Party (BJP), and several state chief ministers.
Thousands of BJP activists, some carrying party flags and sporting saffron caps, waved at Modi who responded with a smile. People also showered rose petals on him.
Many were perched on the road dividers and many more watched the show from windows and roofs of homes on both sides of the roads.
With around 1.7 million voters, Varanasi will go the polls on May 19. The election is seen as a referendum on Modi and his party.
“For the first time in India there is no anti-incumbency wave,” Modi told cheering, charged-up party workers before he filed his nomination.
Modi had won the Varanasi constituency by a margin of over 580,000 votes in 2014 and is looking to improve his performance with opposition parties failing to put up a strong candidate against him.
Rumours of the country’s main opposition Indian National Congress party’s Priyanka Gandhi contesting against him were scotched on Thursday, with the party announcing local leader Ajai Rai as its candidate.
Priyanka Gandhi is Congress president Rahul Gandhi’s sister.
Varanasi is one of the holiest cities for Hindus and is based at the banks of the river Ganga. Hindus believe Varanasi is the centre of the world and anyone who dies in the city attains salvation.
Invoking Hindu symbolism, Modi told party workers before filing his nomination papers: “Mother Ganga will take care of me.”
On Thursday, Modi took out a road show in the city in a huge show of strength by the BJP.
The campaigning in the Indian general election has been marred by accusations, insults and unprecedented use of social media to spread false information.
While Modi’s supporters say he has improved the nation’s standing, critics accuse his party’s Hindu nationalism in aggravating religious tensions in India.
In his five years as prime minister, Modi has pushed to promote the nation of 1.3 billion people with multiple religions as a distinctly Hindu state.
He has rallied his support base with Hindu mega projects across India, including in Varanasi, but has also been blamed for rising attacks by Hindu mobs against minorities, mainly Muslims who number about 170 million.
Modi and his party also adopted aggressive nationalism, using the disputed Himalayan region of Kashmir to pivot away from his economic record and playing up the threat of rival Pakistan.
The approach was employed especially after a suicide bombing in Kashmir on February 14 killed 40 soldiers, causing brief fighting with Pakistan and allowing Modi to portray himself as a strong, uncompromising leader on national security.
Voting in three of the seven phases of the staggered elections has finished. In total, some 900 million people are registered to vote for candidates to fill 543 seats in India’s lower house of parliament, called the Lok Sabha. Voting concludes on May 19 and counting is scheduled for May 23.