Take me home...

Ambitious but rubbish pt1:
How to make home server on a budget

Picture this. You are a programmer. You like computers, you do things your way, you are a nerd and you'd like to have your own little corner on the Internet or maybe some game server to play with your friends.

But you are a student, which means you don't have a lot of money. So... how would you do it?

First of all, you'd need a machine for your server. I went with an old Lenovo laptop with some shitty Intel Pentium. It was my parents' but due to its age it couldn't even run Windows properly, booting up sometimes took like 10-15 min. So I did what any nerd would - I took it and set up Linux, after which it worked like a charm.

Now, how to host websites on this museum artifact? Easy, just set up PHP built-in server or some nginx and then add an appropriate exception to your router's firewall as well as port forwarding. That's all, right? Yeah, no. Turns out my ISP gave me just ipv6, no v4 so good luck visiting my page for half the population. But hey, at least no forwarding, right?

So maybe set up a proxy through Cloudflare or get some dirt cheap VPS to act as a proxy? Yeah, going back to firewall, it worked and then stopped. I tried everything, factory reset included, but it couldn't seem to work like it had. I tried contacting customer support two times two different ways and I got two mutually exclusive answers. One of them was that they do not block anything and it's my fault, while the other was that they do block every incoming connection. Which one is true? Hell if I know. All I know is I have to have a business to be able to have a sane network access.

So what, change ISP? Actually, yes, that is a good idea. These big ones are good for an average bread-eater, but when you want to have some "fun", you go to local ones. I talked to one of them and they said just for an additional 15 PLN per month (like 3 bucks or something idk) I will have a public ipv4 and I can have my own network gear I can configure myself. The ideal option.

But that's not what's going on right now. I have not yet changed the provider and yet you can visit my beautiful website, so how is that done? I got myself a very minimal VPS for one-time 5 PLN and it acts as a proxy/gateway. Nothing fancy, a quarter of GB RAM and 3 TCP ports. It's connected via wireguard tunnel to my machine at home and it reroutes appropriate traffic with iptables to me.

Oh, and about the machine itself, recently I bought an old PC from my friend at just 350 PLN. It has 16GB RAM and 3th gen i7 so it's a steal basically. Also, I went to a computer store and bought an HDD. Guy behind the counter was really surprised that someone actually still asks for such an old technology and we had a small conversation, very nice guy. Hey, btw, please respect all people working in stores and service, their job is usually already miserable enough, you don't need to make it worse.

So there you have it, an almost free VPS gateway, cheap machine, no screen because ssh exists, life's good. Or would be, if this VPS had more ports open for use. There are 3, one of which is ssh, so there are 2. What now? You use HAProxy with its content-based switch feature. Basically, it can detect what protocol is used and redirect that traffic to an appropriate server, allowing you to have multiple services on one port. Just set it up in a separate container and reroute everything as you please.

This way I got almost everything I need with minimal costs but considerable skill. Which is a good sign for my future employer. And for my wallet.

Return