I want to create my own server for Space station 13 and when I try to host the server in the hub I get the following message:

"BYOND hub reports port 8887 cannot be reached by players."
Tell me what needs to be done
What you need to do is forward a port. created an article awhile ago that explains how to do this really well, so I suggest you head over there and read it:

One of the steps involves looking in their list of routers for your router. When you click on your router's model, it'll open up a step-by-step guide on how to forward a port specifically for your router.

Once you've forwarded a port, you need to always use that port when hosting a BYOND game. Using another one that's not forwarded will not allow others to join.
In response to Spevacus
I opened the port, and the error "This port is not visible to other players" disappeared, but when my friend tries to connect, he throws an error, does this mean that I'm not sending the host correctly or the problem with the port has not disappeared?
In response to Hunter0202
Are you instead seeing "BYOND hub reports port (x) can be reached by players" (note the "can" here)? If so, the game should definitely be reachable. If you're not, then it's possible that a firewall on your end is interrupting things.

What error is your friend getting?