Axquiring a resident permit

I'm Nigerian, and I've been in Ghana for 2 years now. I work remotely, and I can't seem to get a resident permit because I'm not working for any Ghanaian company.

However, I see foreigners from America and Europe working remotely who move here.

So, a question for those foreigners working remotely in Ghana, how do you guys acquire your resident permit?