I would highly recommend integrating your application to an existing chat solution. Whether you use Slack, Jabber, or any other robust chat solution you no longer have to worry about the persistence problem and you don't have to maintain a custom solution. I realize that Chat doesn't feel complicated, but the bottom line is that there are more things to consider than you think.
Your stated requirement:
I do need a dedicated server ran ... that can then delivers the messages when the user connects
That requires a piece of persistent architecture that exists when the application is not currently running. Your potential solutions are:
- Integrate with an existing chat solution (does not restrict you to your application, and can easily expand to new requirements you have)
- Persist using your database (I maintain an application with a poor-man's custom chat feature that does exactly that)
- Create a custom server to administrate and deliver chat messages
I would also look very hard at the reasons you are wanting to add Chat to your application. The app I am maintaining with a custom poor-man's chat was created because a chat service didn't exist on that particular private network. Rather than getting a proper chat server approved (and there are many), the original developers implemented their own. In the context of what that application does, it is the most superfluous feature that should have been a completely separate service.
You may have very good reasons, and chat may be a more integral part of your application. However, certain chat applications like Slack have an API that allows a level of integration that you wouldn't be able to accomplish on your own. Take a good hard look at the decision to build another version of a chat server.