Yes, you definitely need a server for a chat app. Because a server is required to facilitate communications between users.
However, you can still use serverless chat architecture by integrating third-party chat APIs with your web or app that allow you to host on the cloud, and you don’t have to maintain the server.