Dr Michael McBride and Dr Ronan Glynn have also asked employers to try and facilitate employees working from home.
In a joint statement, they appealed to the public across the island to continue following public health advice.
The move follows a rise in case numbers in Donegal and the north west.
Tighter Covid-19 restrictions are set to come into force in County Donegal – the level three restrictions will be
imposed at midnight and will be in place until 16 October.
Acting chief medical officer for the Republic Dr Ronan Glynn and chief medical officer for the North of Ireland Dr Michael McBride said they realised the advice would “not be welcome news for those living in border areas”.
“Given the current number of new cases in Donegal and neighbouring areas we would appeal to everyone to avoid all but necessary travel across the border,” they said.
“It is also recommended that employers on both sides of the border make every effort to facilitate employees to work from home in so far as is possible.”
The chief medical officers also noted specific concern about the significant proportion of cases in young people in both Donegal and Derry.
They appealed to teenagers and those in their 20s and 30s to reduce their social contacts.
Both Dr McBride and Dr Glynn said there would be “close collaboration” between the relevant authorities in the coming days “to address the concerning trend in case numbers on both sides of the border, not alone in Donegal and Derry, but also in other areas along the border.”
Donegal now has the highest rate of Covid-19 in the Irish Republic.
Dr Martin Coyne, a GP in Lifford, told BBC Radio Foyle his practice had experienced a three-fold rise in cases over recent weeks.
“Between the start of the Covid crisis and 10 September in Lifford we had 17 positive Covid cases. Since then, until yesterday, we’ve had another 54,” he said.
The majority of new cases are aged under 35, he added.
The county shares a border with the Derry and Strabane Council area in Northern Ireland, which has Northern Ireland’s fastest-rising Covid-19 caseload.
Dr Coyne said restricting movement between Northern Ireland and the Irish Republic is “probably a good idea”.
“The virus doesn’t see the border, the virus moves south, it moves north,” he added.
On Friday, the Department of Health’s daily dashboard reported no new coronavirus-related deaths and 273 more positive cases. The death toll in NI remains at 577.
The 273 new cases is the highest number of people testing positive under the current testing system.
The dashboard also shows 46 people are in hospital with Covid-19, with five patients in intensive care units.
The new restrictions on the Irish county will also impact on businesses that rely on cross-border tourism and trade.
President of Derry Chamber of Commerce Redmond McFadden said that is ” the price we have to pay”.
“We have to get on top of this. We cannot be complacent. People must do the right thing, it is that simple,” he said.
“Businesses are accepting of that.”
Foyle MP Colum Eastwood said the restrictions in Donegal “will be difficult for people in Derry and Strabane”.
“We have friends and family across the border, travelling to see them, or travelling for work is a part of our lives,” he said.
Further clarity, Mr Eastwood said, on how the new measures will impact cross border workers is also needed.
The Mayor of Derry and Strabane Brian Tierney has asked people to respect the new restrictions in the county.
“That also means you are not allowed into Donegal unless for essential business, people in Derry and Strabane need to stick to that,” he said.
The tighter restrictions mean people are again being asked to work from home where possible and only to make essential journeys on public transport.
Visitors to private homes and gardens should be limited to a maximum of six people from one other household.
There are to be no organised indoor gatherings and outdoor gatherings are to be up to a maximum of 15 people.
Meanwhile, one of the north west’s biggest employers has closed part of its factory after five staff tested positive for Covid-19.
A further 21 employees are currently self-isolating “as a precautionary measure”, Strabane-based sportswear firm O’Neills said.
The factory is in the process of a deep cleaners and owners hope to reopen it on Monday, September 28.