You don't purchase a server, you rent it from some hosting company. Which company depends on the country you're living in, and that also changes the prices.
The same companies also often offer to give you your own homepages, but for a game server you need additional (and more expensive) versions.
Here in Germany for example one of the better hosting companies is Strato, and the smallest server they rent is 29€ per month. You might be able to get away with their biggest non-server package as that also includes PHP and other functions, but that is not guaranteed as you might need some of the dedicated server functions - and even that package is 18€ per month.
And consider that you need to pay that server during playtests and bughunts on the scripts and programs, which means for a minimum of one year before people can even try to make a game for that.
Edit:
Making a peer-to-peer server might allow you to get away without that rent, but it has some other problems like how do you distribute a non-dedicated IP adress (regular PC's always chance their IP when disconnecting and reconnecting, you have to pay for a fixed IP adress (which is part of the server costs).
That said, any good and modern computer can become a server by installing the neccessary server programs. If you do that with linux they're free, but you'll have problems getting the game to run on the server.
If you do that with Windows, you'll need a Windows server system (which is more extensive than the Windows Home or Professional systems, and requires more knowledge to setup)