Hugo cannot bind to port 1313

Nov 30, 2016  

By default, hugo binds to http://127.0.0.1:1313/ when started using this command line:

hugo.exe server -w

But recently, I have no longer been able to execute the server. Every time, it complained that the port 1313 was already in use.

Digging around with TCPView I finally located the culprit. I had installed Elasticsearch as a service a few days ago (process elasticsearch-service-x64.exe) and it opens lots of ports for its intra-cluster communication.

Out of luck, port 1313 was already used by Elasticsearch.

The solution is simple:

  • Open the View Local Services control panel.
  • Locate Elasticsearch 1.5.0 (in my case).
  • Click on the stop button.
  • Launch hugo.
  • Start Elasticsearch 1.5.0 so that it will be available again.