Officials in New York City, which is home to more than 8.5 million people, say they are weighing ways to quickly scale the capacity for testing and epidemiological tracing. The mayor has rightly said the city would focus on getting testing to medical and other essential workers and vulnerable populations first.

Plans are underway to hire or redeploy roughly 1,000 additional workers to do the work of contact tracing, supplementing the work of the city’s roughly 150 disease detectives. City officials said they will most likely need to hire thousands more workers to help in the efforts. This work is also beginning in Massachusetts, where Gov. Charlie Baker said nearly 1,000 contact tracers would reach out to sick residents and their recent contacts.

The city is identifying locations to set up community testing sites, like parks and recreation centers, sexual health clinics, outpatient clinics at public hospitals, pharmacies and urgent-care centers, and the network of community health centers and mobile testing sites that has proved effective in the fight against H.I.V. over the past three decades. It is also exploring how to pool tests to process more samples at once.

“The goal is to ideally have hundreds of thousands of people who could take tests any day of the week,” said Emma Wolfe, Mr. de Blasio’s chief of staff and deputy mayor for administration.

This is a time to think bigger.

In Germany, mobile teams of medical workers help treat people, a model that could be useful in New York for testing seniors, disabled people and others who can’t leave their homes.

Dr. Harvey Fineberg, who leads the Standing Committee on Emerging Infectious Diseases and 21st Century Health Threats at the National Academies of Sciences, Engineering and Medicine, has suggested using the Postal Service to deliver surgical masks and hand sanitizer to every American household, once front-line medical workers are sufficiently supplied. The federal government could help hard-hit places like New York by sending a medical worker along these same postal routes to test people at their homes, either by using nasal swabs or possibly saliva samples if proven effective and approved by regulators. Another source of help may be the National Guard.

One advantage New York has is the city’s Health Department. It has been a pioneering force in public health for decades, from the AIDS crisis to antismoking campaigns and efforts to close racial disparities in health outcomes.