ORIGINAL REDDIT POST
Multi-users without an online server?
Hello folks, 'I'm new as a developer, and I'm having some trouble to pay for an online server for my stuff, so, is there a way to keep users connected without an online server? I did browse through the web, but I didn't find many resources regarding this…
Hello folks, 'I'm new as a developer, and I'm having some trouble to pay for an online server for my stuff, so, is there a way to keep users connected without an online server? I did browse through the web, but I didn't find many resources regarding this subject.
Collected discussion
Define "connected" "User A post a comment, user B can see that comment" is wildly different than a live chatroom, a video call or a game lobby
A message board is just a standard CRUD app. There are like a bazillions hosting provider that let you host a backend like that for free. Cloudflare workers, Fly.io, render, railway,... Pair them with a database, a bunch of databases services like neon, turso, supabases,... Offer a ton of free tier capabilities
both are basically the same thing though just different timing expectations. for the comment thing you can use something like gun.js or orbitdb where each user hold a copy of the data and sync when they come online. not real time but it works without paying for server the live stuff is harder. you would need to punch holes through NAT somehow, maybe with webrtc and a free stun server. but someone still gotta be the host that is always online for others to connect to
GUN author here! :) thanks for the mention, if anybody needs help LMK. :)
Well, not necessarily a real time connection, a message board or an online turn-based game like yatzi would work nicely.
For turn by turn stuff you don’t need to pay for anything. Supabase free tier gives you Postgres plus realtime subscriptions, so player A writes a move and player B gets it pushed instantly. That covers a yahtzee style game completely and you never touch a server. Cloudflare Workers free tier works too if you’d rather write the logic yourself. Durable Objects are basically made for game rooms. The VPN answers above solve a different problem, that’s for you and your friends on your own machines, not for random users on the internet.
You could set up a small public server (like 1 core, 2GB RAM) with Wireguard and join your PC:s together with VPN, then someone can run the game server on a home PC, and you all communicate with the game server via the Wireguard server without letting the home PC accept connections from the internet. I do something like this to connect my Steam Deck to my home PC server when I'm not at home. You need to understand firewalls and some basic networking concepts to set this up securely though, so you might want to find a tech savvy person and pay them to help you set it up. I think there are some commercial solutions for this too, like I want to say TailScale?
Unfortunately for you, the typical workflow make it so you usually need internet. At best, either: - Your users* are all within the same network (which can be your private lan network, at home for example) - The applications is self contains** or/and rely on 3rd party content on the internet. *You could have multiple group of users where each group has it own private network (eg. house1, house2, house3). But, the assumption here is that each group aren't sharing their data with another group. In this case, you can install one server at each user group location. ** User won,t share their generated data, or if they does, you managed to use a 3rd party. ------------------------------------ Host it yourself If you have no money, you can let your computer on 24/7 and host it yourself. That assume also you have an ok internet. Just 2 warnings here: - Security isn't optional, you will get attacked. Read about VMWare (eg. Oracle VMWare which is free) and how to harden your server (fail2ban, file system permission). Don't forget to have a copy of everything (your app and your app data generated overtime). Ideally you want to restrict the traffic to your trusted users only (via a VPN) - Your ISP may be a dick in many way (CGNAT, blocking web ports (typical)) and as such you will need a 3rd party to route from the internet. There are free tier. Like Cloudflare Tunnel (I don't quite remember the name). That 3rd party may offer built-in traffic filtering, acting like a firewall to restrict to some specific trusted users. You will need to search how to "port forward" (configure NAT) your port on your ISP modem at a minimum Host it yourself - on the lonely island I have been a kids curious in this field for a long time, having no money. So it hasn't been a real surprise I end up doing a lot of work... for myself... nobody would be able to easily access it. At best, access it in a wierd way (eg. using a custom http(s) port, because I'm still lucky to be able to be reacheable from the internet (No CGNAT)). You can still learn a lot even if it isn't publically available on the internet. Learn VMs (or/and dockers) to create various servers. So create your own "datacenter". One thing you may learn rapidly here is that most servers (paid or not) are on linux. And linux is case sensitive. So "including" files, or sometime, other features (like database or tables name in database) may be case sensitive on linux system while you, if you are a developper on Windows, won't be. Another one is that linux use way more users permissions than on Windows. But you will be the online user of your applications. ------------------------------- Look for free tier (forever) If I remember some cloud provider nowday offer some free tier for some products. It may be ugly for your applications, and not secure at all but if you have no money, you no have money. AWS offer some tiny small ec2 for free if I remember. Same for Google. It may be limited in total hours unfortunately. That can host _anything_. There are virtual machine. If I remember Google have a free tier for a database (or no-sql?). It may be ugly, and not secure at all, but maybe you want your web application to connect into the database straight if money is an issue to have a proper back end server That are just the big name, if you do php, I hope there are still some free host here and there :( like the good old time. -------------------------------- Small budget. Somebody already mention it, but "small public server" aka VPS (virtual private server). They are usually cheap as hell. It is a shared server with many other user. Good for backend stuff, you can install anything you want. I just don't know how pain in the ass it will be to be able to use the port http/https ports. It is likely to be unavailable. So you may still need a web hosting provider to forward your traffic to that VPS :/
If you don't want a dedicated server, you can call Cloudflare workers from the browser. Anything that supports multiple user's where they can "interact" will require at minimum a database and a backend layer to connect to the DB.
There are distributed servers.
wireguard sounds like a solid workaround for keeping things connected without breaking the bank
Wow, thanks for all the possibilities folks, I'll check what works best with a screen reader.
P2P connections i guess.....