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
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.
Don’t forget to click save once complete!
For good measure now restart your home assistant instance by going to Settings > 3 dots in the top right corner > Restart Home Assistant.
Your new port should now be applied.