It is not necessary to run the Elasticsearch engine on a separate server. Nevertheless, if the server that runs Magento lacks resources, it will be a good idea to install the Elasticsearch engine on a separate server to boost overall performance.
See more details on Elastic Search for Magento 2 page
Login and Registration Form