Buying from a provider has advantages over creating your own server infrastructure. The cost of server maintenance comprises the costs of security, ventilation, power supplies, a stable Internet connection, etc. Added to these are the cost of repairing and upgrading equipment, utility bills, and the fact that the server hardware you have once bought costs less and less every year. All these expenses add up to a sizeable amount. Plus, if the need for servers disappears, it's challenging to get back on your investment.
The average cost of buying a VPS or a dedicated server from a hosting provider is not high today. Yet, it includes all the costs listed above. The price of a server depends on the characteristics of its components: CPU, disk type and size, RAM size. If you get a server, you will not have to invest a large sum at once. If circumstances change, you can abandon the server and reduce costs.