If you want to make a server that can be accessed anywhere, then you need to be prepared for quite a journey. Making an accessible server is not very easy, although not impossible.
The server itself
Getting just a server is not difficult, you just need a machine that
can run all day long. Raspberry Pi
is a good option, it's relatively cheap and doesn't consume much electricity,
though you'll probebly need to buy additional cooling for newer models.
You can already use it as a server in a local network, but it's not very
interesting if it can't be connected from the Internet.
...or you can rent a server, that's an easy option
NAT so easy
Some might warn you about having to open/forward ports on your modem. This might be needed at home, but in some cases it might not work. There can be three cases:
- If you use a rented server, you probably don't have to do anything. Though you should check the control panel for that server to see if there's an option to open ports;
- If you use one of your machines as a server and you're in a small house, then you probably just have to do that forwarding thing, after which your server can be accessed through your external IP;
-
...probably, because it might fail, especially in multi-apartment houses,
because you technically would have to do port forwarding on your router
and your ISP's router (because why would they assign external IPs
to every single apartment when one can be enough, there aren't many free
IPv4 addresses), which is unreachable by you.
You have few other options then:- Ask ISP to provide you with a dedicated IP (which I wouldn't do because I don't think I'll use the correct terminology);
-
Use ngrok
which is proprietary thing and is basically a variant of the next option; -
Rent a server to be a VPN router and proxy connections though
this tunnel to your server.
Which is what I did.
Kind of defeats the reason for having your server, but it might be reasonable if you don't want to rent a powerful machine but rather use your own.
Claim the domain
If you have a dynamic IP, you should get a dynamic DNS to have access to your
server in case IP changes. You can also use it as a free domain for a static IP,
but if you want a fancy name for it, some money must be spent.
.ru and .xyz seem pretty cheap 🤔
[lock emoji 🔐]
...and it would be good idea to additionally encrypt connection to that server. Certificates are free, there's no much reason not to get one
Usage
And now your server's set. Host a website/cloud/game, make an app, use an app... whatever you wanted a server for.
PS. Still having a fever of accomplishment
eeeeeeeee i finally got online