It shouldn't be said that it is not possible to setup a server on a local Machine. However, you should make sure that this is not an easy task as the facilities available in the Datacenter won't be available for the Local machine. Also, the Security, Reliability and Connection speed matters a lot. Hence, it is always a better option to lease a server from a web hosting provider.
Hope this helps..
