Current implementation uses a server, though you can fairly easily host your own, or find another server to your liking.
There is significant work being done to get matrix working p2p too, though. There is a demo of it, but it's not production ready. See https://p2p.riot.im/
There is significant work being done to get matrix working p2p too, though. There is a demo of it, but it's not production ready. See https://p2p.riot.im/