Ministers are seeking 16m tablets in packets of up to 100 as part of a £35m contract put out to tender on Friday.
The drug is currently being tested by government scientists, health officials said. They are securing additional supplies so it can be distributed among the population if required.
The contract, which was uploaded to a government website on 15 May, is an “open opportunity” for pharmaceutical suppliers to supply more than 33m tablets of various drugs between June and next January.
There is no evidence hydroxychloroquine can prevent coronavirus, and regulators have warned the drug could cause heart problems.
However, there were concerns that Trump’s endorsement would prompt a worldwide shortage of the drug, which can be used to treat lupus and other conditions.
Trump told a White House press conference: “I’m taking it for about a week and a half now and I’m still here, I’m still here.”
According to the contract, the government is asking for the drug to be supplied in either 220mg or 250mg form.
“In accordance with the terms of this invitation to offer the authority may accept offers for alternative strengths of tablets,” the contract says.
Studies are under way across the UK, Europe and the US to examine if the drug and a similar one, chloroquine, are effective against the coronavirus.
UK scientists have been examining whether the drug can be used to treat the disease, rather than prevent it. The UK does not at present recommend its use.
Other drugs being bought as part of the £35m contract include 1.4m tablets of lopinavir-ritonavir, which is used to treat people who are HIV positive; dexamethasone as an oral solution; and 20m azithromycin capsules in packs of up to six.
A Whitehall source said the purchase of hydroxychloroquine was related to current clinical trials to evaluate it as a treatment for people with Covid-19, adding that it should only be taken on prescription or as part of a controlled clinical trial.
The World Health Organization has said it is concerned by reports of individuals self-medicating and causing themselves serious harm.
Trump was hosting a meeting about the struggling restaurant industry on Monday when he caught reporters unawares by revealing he was taking the drug.
“You’d be surprised at how many people are taking it, especially the frontline workers before you catch it, the frontline workers, many, many are taking it,” he told reporters. “I happen to be taking it.” The drug was also endorsed by the Brazilian president, Jair Bolsonaro.
The Guardian disclosed last week that the UK government had entered into 16 contracts for chloroquine, hydroxychloroquine, and chloroquine phosphate, and placed orders for lopinavir-ritonavir.
Contracts with British-based firms were entered into without going to tender on the grounds of “extreme urgency”, according to an online record of the deals.
A Department of Health and Social Care spokesperson said: “The UK is leading the way on research in the race to find and fast-track potential treatments, and clinical trials are under way to assess whether existing medicines are safe and effective for treating Covid-19.
“This includes hydroxychloroquine, lopinavir, dexamethasone and azithromycin, and we have procured these medicines to support clinical trials.
“But until we have clear, definitive evidence these treatments are safe and effective, we do not recommend the use of hydroxychloroquine outside of a clinical trial.”