In April, his daughter Corrine Foxx said he had experienced a "medical complication" but the family did not share details about his health issue.
In an Instagram post on Saturday, Foxx thanked his family for keeping details about his health "airtight".
The silence led to speculations, the comedian said, but he reassured fans that he was not paralysed or blind.
Speaking for the first time since he was released from hospital, Foxx thanked his social media followers for messages of support. "I cannot even begin to tell you how far it took me and how it brought me back", he said.
He explained that although many people were eager to hear updates, he didn't want fans to see him "with tubes running out of me and trying to figure out if I was going to make it through".
"I want you to see me laughing, having a good time, partying, cracking a joke, doing a movie [or] television show," Foxx added.
"My sister Deidra Dixon, my daughter Corrine really saved my life," the 55-year-old said, adding that he was only able to make the video for his fans due "to them, to God, to a lot of great medical people".
Foxx said that privacy during his illness had been vital to him. "I cannot tell you how great it feels to have your family kick in in such a way, and y'all know they kept it airtight, they didn't let nothing out.
"They protected me, and that's what I hope that everyone could have in moments like these."
In May, his daughter said Foxx had been discharged from hospital for "weeks" and was making a good recovery. The actor was reportedly in a hospital in Atlanta, Georgia, where he had been filming Netflix's Back In Action alongside Cameron Diaz.
In his video to fans Foxx said he had been "to hell and back" and his "road to recovery had some potholes as well".
But, he added, "I'm coming back and I'm able to work".
Messages of support for Foxx have been pouring in. "Thankful to see you bro, truly", Idris Elba commented on Foxx's post. "God is good," said Viola Davis, while John Boyega and Tracee Ellis Ross also sent their love to the star.
Foxx, who stars in the recently released They Cloned Tyrone film on Netflix, also expanded his gratitude to "the people who are letting me work".
In 2024, he is due to host a new music-centric game show, called We Are Family, on US network Fox alongside his daughter, a 29-year-old actress, model and activist.
The pair said they were "thrilled" to have worked on the show.