He promised no elections would be held "under the barrel of a gun" and they would have to take place according to international standards.
The vote is part of a plan for special status in the separatist-held east.
Nationalists rallied in Kiev with banners demanding "no capitulation".
Large parts of Luhansk and Donetsk, in the Donbas region in eastern Ukraine, were seized by Russian-backed separatists in 2014 after Russia captured and annexed Ukraine's Crimea region.
Conflict broke out as Ukraine's army tried to recapture rebel-held areas and some 13,000 people have since died and another 40,000 have been wounded. An estimated 1.5 million people have been internally displaced in the past five years.
Violence is now at a lower level but 15 people have been killed this year and Ukrainian military officials say separatists violated an existing ceasefire 13 times on Tuesday by firing on army positions.
What has Ukraine agreed?
The so-called "Steinmeier formula" is a plan to break the impasse over a 2015 peace deal between Ukraine and the Russian-backed separatists and decide who should do what and in what order.
Proposed in 2016 by Germany's then-foreign minister, Frank-Walter Steinmeier, the plan details free and fair elections in the east under Ukrainian law, verification by the OSCE international security organisation, and then self-governing status in return.
Mr Zelensky told a news conference that the elections would be held under Ukraine's constitution, and only when no "troops" remained in the separatist areas. This has been taken to mean Russian troops, although Russia denies that its soldiers are present in the east.
A gamble for Ukraine's president
By Jonah Fisher, BBC Kiev correspondent
President Zelensky made bringing peace to eastern Ukraine his number one election promise. And he's certainly trying.
Last month there was a significant prisoner swap with Russia and now the former comedian has publicly agreed to the Steinmeier formula. That should pave the way for talks with Russia, Germany and France in what's known as the Normandy Format.
The most sensitive aspect of the Steinmeier formula is that it allows local elections to take place in the occupied parts of Ukraine before Russian-backed forces have withdrawn, and Kiev has control of the border.
Though elections in Donetsk and Luhansk would be monitored by observers from the OSCE and would in theory be under Ukrainian law, it's hard to see how they would be fairly contested.
Most people with strongly pro-Ukrainian views have long ago left the occupied areas for their own safety. So it seems almost inevitable that the elections would consolidate the position of the Russia-aligned leaders who are currently in place, granting them the recognition Moscow has long craved.
With Ukraine having allowed the election to go ahead, and then granting the region's special status, it would then be up to Russia to honour its part of the deal, withdraw its weapons and hand over control of the Ukrainian side of the common border.
It's not hard to see why President Zelensky's critics see this as a major concession, if not a capitulation.
What reaction has there been?
Russia has backed the Ukrainian move and Kremlin spokesman Dmitry Peskov said he expected a summit to take place soon.
Mr Zelensky's predecessor as president, Petro Poroshenko, was damning of the deal, referring to it as "Putin's formula", while ex-Foreign Minister Pavlo Klimkin was dubious about the chances of free and fair elections.
"Society will be demanding answers, and these answers should not be solving the issue of Donbas occupation at Ukraine's expense," he said.
One former Ukrainian negotiator warned it was a "path to war, not to peace", while rock singer Svyatoslav Vakarchuk, who leads the Voice party in Ukraine, called on the president to explain the concessions he was ready to make.
Follow us at @OfficeWeek on Twitter and The Ukrainian Week on Facebook