If you can get to the web UI, then you can modify this setting under Administration > Settings > Ports and Addresses.
If you can't, then run a curl command to update it via the API, while ssh'd in to the host (so your firewall doesn't get in the way):
curl -X PUT -u "admin:admin" -i \
-H "content-type:application/json" \
-d '{ "items": [
{
"name": "HTTP_PORT",
"value": 8080
}
] }' \
http://<cm_host>:7180/api/v3/cm/config