I have also been researching this topic for a while. I was using Google hangouts for a while but lately it seems to be dropping messages. Tried Skype next but it will only keep message history on the cloud for 30 days. Next evaluated Facebook. It works quite well but I want to host my own on a VPS. The top three alternatives seem to be prosody, ejabberd and openfire. I was planning to use ejabberd but the issue I have with any of the XMPP solutions is that they have issues with iOS and you need to find a way to get it to work with the push mechanism otherwise the IM clients will go offline in 10 minutes. Any suggestions for this?