Smart Home

Change Default Port Number in Home Assistant

Change the port Home Assistant listens on by setting server_port under http: in config.yaml, then restarting.

· 1 min read
Illustration of an Ethernet port beside a house with connected smart devices

Whether for security, running a lab or purely cosmetic its quite a simple task to modify the port number your Home Assistant instance uses.

This is quite a simple task.

To start, navigate to config.yaml in file editor. If file editor is not available please see this guide for how to enable it.

Select File Editor from the Left Navigation Menu and then open config.yaml from the folder icon as shown below

Home Assistant File Editor with the folder icon in the top left Home Assistant File Editor list with config.yaml selected

You will likely already have a line for http:. You could also already have a port reference under this heading that is set to 8123 (which is the default port number).

If the line is not there add the below code and amend the number to whichever port number you require. remeber to get the indentations exact as this can sometime cause errors. If you already have an entry for https: and server port simply change the number as desired.

http:
  server_port: 8124

Don’t forget to click save once complete!

Home Assistant File Editor with the Save button

For good measure now restart your home assistant instance by going to Settings > 3 dots in the top right corner > Restart Home Assistant.

Home Assistant menu with the Restart Home Assistant option

Your new port should now be applied.

IanA proven thought leader across multiple IT disciplines, Ian has always had a strong passion for technology and its application in an ever evolving digital world.

Keep reading