This sounds like a problem for Bob.
https://github.com/OokTech/TW5-Bob
If you don't want to use Bob than you use command line arguments. If I remember correctly the first argument after the wiki path is the port. It defaults to 8080 but you can give other numbers. Just remember that anything under 1024 required administrator access.
If you installed it globally than you would use:
tiddlywiki /path/to/wiki --server 8080
where you change /path/to/wiki to actually be the path to the wiki and 8080 to be the port you want to use.