The server side must be reachable from the Internet. The details depend on how the server is connected. If it's on a DSL/cable modem, directly connected without a router, then all you need is to know your IP address and use a port that's not blocked by either your internet provider, or by firewall software on your computer. If that's your setup, check your firewall settings to make sure that incoming connections on that port are allowed. Even if it's not your setup, you still need to do that if you run a firewall.
If you use a router (most people do, these days, if only for the wireless), then that is a computer that acts as the primary network device attached to your modem. It redirects all traffic from computers in your home through that one IP address.
Outgoing client connections are handled transparently. The router has the local IP/port of the client from the connect request, plus the Internet IP/port of the server and can translate packets on the fly. (That's called Network Address Translation, or NAT.) All home routers are NAT routers.
Inbound connections are different because the router only sees its IP address plus a port number. That's not enough information to send packets to the correct computer on your home network. You supply the information with "port forwarding", which nearly all home routers support. Sometimes it is given a different name (I had a GigaFast for years that called it "virtual server"). Go to your modem's setup page with a browser and look around.
There's often an option to set up a default computer to receive all incoming request not explicitly forwarded elsewhere. (For no obvious reason, it's called a "DMZ" by some modems.) Use that with care, if at all, since that exposes every open port on the "DMZ" computer to the Internet. You've just lost the "hardware firewall" function of the router on that computer, so a software firewall is a Real Good Idea. Better is to just forward the ports or port ranges you need.
For specifics, check the router docs, or web search for "port forward" plus your router name and model. Also check docs for "firewall settings" on your OS version or distro.