Musk is one of the high-profile celebrities who will testify in the case between Johnny Depp and his ex-wife.
Musk, James Franco and Paul Bettany will give their testimonies online.
The trial will center around a defamation suit that was filed by Johnny Depp.
The bitter legal fight between Heard and the Pirates of the Caribbean star began after she filed for divorce from him.
Heard spoke out against sexual violence in a Washington Post op-ed in December.
I became a public figure representing domestic abuse, and I felt the full force of our culture's wrath for women who speak out.
The abuse allegations were false and damaged the career of Johnny Depp, who filed a $50 million defamation lawsuit against Heard.
Insider previously reported that Musk and Franco were dragged into the legal wrangle after Heard accused Depp of having two extra-marital affairs with them.
The actress told The Hollywood Reporter that she and Musk now enjoy a beautiful friendship, after dating for a while.
The testimonies of Musk, Franco, and Bettany will be given online, but the testimonies of Depp and Heard will be delivered in person.