Dabbling with web services as a hobby

This is more of a matter with how to get deploying your web backends/services than anything else. Sure, the easiest path would be to rent or pay for a server to deploy backend into. But as much as possible I'd look for a free alternative first then paid service if needed, regardless of usage limit since I would only have my long distance friends try it. I have had thought of port forwarding but unfortunately I am behind a CGNAT and suspiciously getting your own static ip costs a lot (vs local minimum wage)

Recently I have been developing web services on my MacBook via a Cloudflare tunnel Pricing for free, Basically you register for a free plan at Cloudflare, create a tunnel and run the tunnel software they give you on your local machine.

Likely you will need a domain name to go with that, which Cloudflare will sell you for a couple of dollars.

Then one port on your local machine is available to the web at large, punches through NAT and everything. No messing with port forwarding and such. All very simple.

If you don't want to worry about the security of running this on your personal machine just use some old PC dedicated to your web services.

Just now I have Cloudflare tunnels leading to half a dozen different machines each with its own subdomain. For example this experiment in "programming" without Javascript, only HTML and CSS. https://mac2.conveqs.uk

Oh, and Cloudflare tunnels operate over HTTPS and take care of all that for you. No messing with certificates and such.

Thanks, looked it up and its pretty neat. Though, I'd have to start investing in small boards like raspberry pi. Also discovered something called "bitbucke"t or something along that, could probably be used as a convenient playground for whatever projects could use on a storage like that, probably a personal repo

It gives error 'Bad gateway' on your machine. So it looks like you do an additional checking.

I would highly recommend buying a small cheap VPS and using that for two reasons:

  1. If it gets hacked it doesn't hit your home network
  2. If it gets DDoSed it doesn't hit your home network

Self-hosting is fun but the Internet is a pretty brutal place with the background noise and you really don't want it at your doorstep.

CloudFlare tunnels help with #2, #1 is more manageable if you use a separate device and make sure to firewall and secure it. But you're still subject to things like power outages.

If you're just doing this to learn, I would recommend self-hosting with a machine like a Raspberry Pi and maybe a tunnels approach for IPv4 and see if your ISP gives you a static IPv6 address block. Then you could have native IPv6 and tunnelled IPv4.

Ah sorry. I closed the terminal that was running that example. Try again, I have no additional checking. It's just my laptop where anything can happen :slight_smile:

It works now. I would recommend to use Raspberry Pi as 24/7 server and free your work laptop from the duty. RPi consumes just a bit electricity and it's completely friendly to Rust.

That is exactly what I do. I have some Raspberry Pi and some Nvidia Jetson Nano on Cloudflare tunnels.

Problem is developing Rust on those little machines is a pain. Compilation is so slow. So I risk it at do my dev in the comfort of a MacBook. What could possibly go wrong!