Those instructions set you up with a self-signed certificate, which means you'll have to manually accept the certificate in your browser. You can follow these instructions https://docs.mattermost.com/install/install-ubuntu-1604.html#configuring-tls-on-mattermost-server which set you up with a free Let's Encrypt certificate, which is trusted by browsers and you won't have to manually accept it.
The Site URL is used for creating links in email messages that the server sends. Emails are sent for invites and for notifications. The value for Site URL needs to be something that when clicked, opens your Mattermost instance in a browser. As you discovered, an IP address is ok for this. However, if the IP address is on a private network (typically 192.168.x.x or 10.x.x.x) people outside that network won't have access. If your machine is exposed to the Internet, you can use that Internet IP address as the Site URL, and people on your private network should still be able to use links in emails.