Revolt is the most Discord-like FOSS chat app; it’s very easy to use and customizable. Rocket.chat and Mattermost do similar things and are more oriented toward organizations (the Slack/Teams Classic use case).
A Matrix server with a nice web based client, hosted on premise. People are then free to choose the mobile or desktop apps they want.
Matrix is missing the entire voice chat, video chat, and streaming aspect of Discord.
It has meetings and calls, but those are much less convenient to use compared to persistent voice channels, and the streaming had a lot of latency when I tried it last.
Didn’t they change that? Check Elements Nightly
Nightlys are not things you should recommend for production use. Especially for (potentially) non tech savvy teachers and students.
I don’t have experience using it, but it is worth looking at BigBlueButton.
I do have experience using it, and it’s not worth looking at BigBlueButton.