Mr Johnson said there was little hope of sending the Royal Navy to rescue grain from Russian President Vladimir Putin’s blockade.
He planned to have talks with Turkey on the matter to prevent famine.
There are concerns in Kyiv that Germany and France will push President Volodymyr Zelenskyy to accept a ceasefire deal that would mean he conceded land to Russia.
Mr Johnson, who is at a summit of Commonwealth leaders in Rwanda before talks with G7 and Nato allies in Europe in coming days, said there was “no question there is a lot of Ukraine fatigue now in the world”.
“But I think they are going to win," he said in Kigali. "I know they are going to win. It is their country. They are fighting for it desperately hard. But they need to be properly supported.
"So, my message to colleagues at the G7 and at Nato in particular is going to be [that] now is not the time to settle and encourage the Ukrainians to settle for a bad peace, for a peace by which they are invited to give up chunks of their territory in return for a ceasefire.
“I think that would be a disaster. It would be a trigger for further escalation by Putin whenever he wanted. That would do much further economic damage to the world.”
Ukraine foreign minister talks Russia sanctions, economy and grain supply at Davos - video
A key feature of Nato’s talks in Madrid will be freeing more than 20 tonnes of grain from Ukraine before it rots, a crisis gaining extra importance because farmers are harvesting their 2022 crops with a shortage of storage space.
Foreign Secretary Liz Truss will use talks in Turkey on Thursday to raise the possibility of safe passage for ships to rescue the grain.
Mr Johnson said there was a “strong moral case” for getting the grain out of Odesa and through the Black Sea, a perilous task because of Russian ships and mines.
He was focusing on the Turkish talks to find a way to safely ship the grain but conceded “we are a long way off” sending in British boats on a retrieval mission.
“A lot of the countries we are about to see depend on that type of grain," Mr Johnson said. "Some of the poorest countries in the world absolutely depend on grain from Ukraine.
“What’s happening now in Ukraine is not solely responsible for the price spikes in food around the world. That would be a gross exaggeration to think that. But it is a factor.
“We need to do whatever we can to get it out. Under the Montreux Convention we can’t. No navy can now go into the Black Sea, the Turks won’t allow that to happen.
“But we certainly need to find a way of getting the grain out that’s not subject to Putin’s control.
“That requires a great deal of care and thought, and we are working with the Turks and other European partners to see what we can do.
“But we are a long way off trying to send the navy through the Bosporus and into the Black Sea.”