OK. The article here covers this pretty well:
But I found a couple of points could be better.
Install the prerequisites.
Install xhprof and php5-xhprof using apt – not using PECL. No real reason – I just prefer to use apt if possible.
Install the mongo database server as instructed – but – when installing the PHP module for Mongo install the mongodb module and not the mongo module. Otherwise the script to create the XHGUI site will fail.
Then follow the other points in the Digital Ocean document.