"This morning I tested positive for Covid 19," he wrote. "I feel ok, I have no symptoms so far but have been isolated since I found out about my possible exposure to the virus.
"Stay home people and be pragmatic. I will keep you updated on how I’m doing No panic," Elba, 47, added.
The "Luther" star also shared a two-minute video of himself with his wife, Sabrina. Elba said she hasn't been tested for coronavirus (COVID-19) but she's doing OK.
"I got tested because I realized I was exposed to someone who also tested positive," he explained. "I found out last Friday that they were tested positive. I quarantined myself and got a test immediately and got the results back today."
Elba continued: "Look, this is serious. Now is the time to really think about social distancing, washing your hands. Beyond that, there are people out there who aren't showing symptoms and that can easily spread it. OK. So, now is a real time to be really vigilant about washing your hands and keeping your distance."
Elba went on to say that the couple, who tied the knot last April, has told their families and colleagues.
"Transparency is probably the best thing for this right now. If you're feeling ill or you feel like you should be tested or you've been exposed -- do something about it. It's really important," he said.
Elba added: "Look we've lived in a divided world right now. We can all feel it. It's been bulls--t, but now is the time for solidarity. Now is the time for thinking about each other. There are so many people whose lives have been affected, from those who have lost people they loved to people that don't even have it and have lost their livelihoods. This is real."
Elba also noted that he will keep his social media followers updated on how he's doing.
"Stay positive and don't freak out," he concluded.
Elba isn't the first Hollywood star to test positive for the novel virus.
Last week, Tom Hanks and his wife Rita Wilson also announced that they had coronavirus. Hanks and Wilson were in Australia filming an untitled Elvis Presley biopic directed by Baz Luhrmann, with Hanks playing Presley's manager, Colonel Tom Parker.
For most people, the new coronavirus has caused only mild or moderate symptoms, such as fever and cough. For some others, especially older adults and people with existing health problems, it could cause more severe illness, including pneumonia.
The Associated Press contributed to this report