How can I set up a webserver with Ubuntu?

Hello,

I want to build my own API with Graphhopper at DigitalOcean for example.
I have only found instructions to install Graphhopper locally. What all do I need to set up my own web server? The end result is that I want to build a server that outputs JSON.

Thanks

The hardest part might be to make sure your machine is accessible from the www - in a more or less secure way. This involves firewalling, one of the ever going-on chases between securers and crackers.
If that hurdle has been taken, install a package like apache or nginx - instructions on the www are plenty.