Lobby system and host servers on vps

Hello! I have a question. I do multiplayer, in all examples of multiplayer creation there is a button “Host Server” and “Join Server”, but I want the servers to be hosted on my VPS. There would be 10 servers in total, and there would be a “Play” button and the game would connect to a free server. Also tell me how you can make the registration and the system of friends, as well as a lobby system for playing together. I am a beginner, show examples if you can, and if you can, comment well.