I’d like to have my own server at home sorta like a home AWS.
How to set up one and make it available to anyone over the Internet? What tech specs should I buy (RAM, CPU, # of cores, operating system, etc.)?
How much does it cost to keep one running all the time?
Be extremely careful. Plenty of people are really smart and malicious, so you need to isolate it from everything on your network. You’re giving random people remote code execution on your local network, which is like the worst case scenario for security.
Your basic requirements are:
- Some kind of domain / subdomain payed or free;
- Home ISP that has provides public IP addresses - No CGNAT BS;
- Ideally a static IP at home, but you can do just fine with a dynamic DNS service such as https://freedns.afraid.org/ (will update your domain with your dynamic IP when it changes);
- Ideally a home ISP that allows for “bridged” mode or has a ONT device + router where you can add a switch in between and have the server directly connected to the Internet, with its own public IP, outside of your home network (more bellow);
Hardware coices:
Don’t get server hardware, use regular desktop/laptop machines as they’ll be more than enough for you. Server hardware is way more expensive and won’t be of any advantage. If you’re looking to buy you can even get very good 9-10th gen Intel CPUs and motherboards that are perfect to run servers (very high performance) but that people don’t want because they aren’t good to play the latest games.
This hardware is also way more power efficient and sometimes even more powerful than any server hardware that you might get for the same price. Get this hardware for cheap and enjoy.
If you don’t require a TON of computer power some people might suggest ARM board, such as the Raspberry Pi, but be careful with those. ARM is great for power savings but compared to consumer hardware is it shit when it comes to performance and reliability. Also I personally like to avoid the Raspberry Pi and their stuff as much as possible. They’ve done good things for the community however they’ve some predatory tactics and shenanigans that aren’t cool. Here a few examples of what people usually fail to see:
- Requires a special tool to flash. In the past it was all about getting a image and using etcher, dd or wtv to flash it into a card, now they’re pushing people to use Raspberry Pi Imager. Without it you won’t be able to easily disable telemetry and/or login via network out of the box;
- Includes telemetry;
- No alternative open Debian based OS such as Armbian (only the Ubuntu variant);
- Raspberry Pi 5 finally has PCI. But instead of doing what was right they decided to include some proprietary bullshit connector that requires yet another board made by them. For those who are unware other SBC manufacturers simply include a standard PCI slot OR a standard NVME M2 slot. Both great option as hardware for them is common and cheap;
- It is overpriced and behind times.
For what’s worth the NanoPi M4 released in 2018 with a RK3399 already had a PCI interface, 4GB of RAM and whatnot and was cheaper than the Raspberry Pi 3 Model B+ from the same year that had Ethernet shared with the USB bus. If you still want ARM and you’re about just serving a few websites, cloud service wtv pick a Chinese brand such as friendlyelec or rockpi. More computing for less money and a lot less proprietary BS.
Mini computers from big brands though, for 100€ you can get an HP Mini with an i5 8th gen + 16GB of ram + 256GB NVME that obviously has a case, a LOT of I/O, PCI (m2) comes with a power adapter and more importantly it outperforms a RPi5 in all possible ways. Note that the RPi5 8GB of ram will cost you 80€ + case + power adapter + bullshit pci adapter + sd card + whatever else money grab.
Side not on alternative brands, HP mini units are reliable the BIOS is good and things work. Now the trendy MINISFORUM is cool however their BIOS come out of the factory with wired bugs and the hardware isn’t as reliable - missing ESD protection on USB in some models and whatnot.
Quick check list for outward facing servers:
- Isolate them from your main network. If possible have then on a different public IP either using a VLAN or better yet with an entire physical network just for that - avoids VLAN hopping attacks and DDoS attacks to the server that will also take your internet down;
- If you’re using VLANs then configure your switch properly. Decent switches allows you to restrict the WebUI to a certain VLAN / physical port - this will make sure if your server is hacked they won’t be able to access the Switch’s UI and reconfigure their own port to access the entire network. Note that cheap TP-Link switches usually don’t have a way to specify this;
- Only expose required services (nginx, game server, program x) to the Internet. Everything else such as SSH, configuration interfaces and whatnot can be moved to another private network and/or a WireGuard VPN you can connect to when you want to manage the server;
- Use custom ports with 5 digits for everything - something like 23901 (up to 65535) to make your service(s) harder to find;
- Disable IPv6? Might be easier than dealing with a dual stack firewall and/or other complexities;
- Use nftables / iptables / another firewall and set it to drop everything but those ports you need for services and management VPN access to work - 10 minute guide;
- Use your firewall to restrict what countries are allowed to access your server. If you’re just doing it for a few friends only allow incoming connection from your country (https://wiki.nftables.org/wiki-nftables/index.php/GeoIP_matching)
Realistically speaking if you’re doing this just for a few friends why not require them to access the server through WireGuard VPN? This will reduce the risk a LOT and won’t probably impact the performance. This is a decent setup guide https://www.digitalocean.com/community/tutorials/how-to-set-up-wireguard-on-debian-11 and you might use this GUI to add/remove clients easily https://github.com/ngoduykhanh/wireguard-ui
Point of order on the raspberry pi:
Here’s your Debian https://raspi.debian.net/tested-images/
There multiple issues with those Debian images and while I would love to run them, they don’t cut it. Generic images might underperform in your board, the GPIO and other low level components will, most likely, not work and you might burn your storage as logging and other I/O intensive operations aren’t tweaked for SD cards.
There’s also Armbian (https://www.armbian.com/rpi4b/) but only Ubuntu based right now. Armbian could be a great solution however there has been not much interest in the RPi board most likely due to what I pointed before.
Also WRT telemetry: https://forums.raspberrypi.com/viewtopic.php?t=341514
The only telemetry is pertaining to what the imager is burning to the card. So if you don’t use the imager there’s no telemetry, if you use the imager but disable telemetry, there’s no telemetry, if you don’t disable it, it just sends back what you’re installing.
make it available to anyone
To do what?
Generally speaking, not a well-advised idea, especially for someone who has to ask how to do it (truly not being snarky).
I was a cisco instructor in the 90’s, (so teaching networking and security were my bread and butter for a while) and I wouldn’t think of doing this - except… If the only access was via a mesh network client such as Tails/Tailscale, the server was dedicated to just this purpose, it was isolated on its own LAN segment/DMZ with no routing path to my home network segment, the server was not Windows, but Linux, and I had a robust backup plan, access control plan, and access monitoring with alerts.
There’s just too much risk exposing a port to the world.
If you’re only accessing the server remotely via Tailscale and no ports are open, is it necessary to have the server on its own isolated VLAN? I like accessing my server locally most of the time and via Tailscale when I’m out and about.
You can host most basic web apps off a raspberry pi. You just need to:
- connect your device to the internet
- start your server application
- set up port forwarding on your router to forward the port your application is being hosted on
- get a domain name
- configure ddns
- Maybe get some SSL certs
.
Edit: BearOfaTime brings up a great point. I’m telling you how to do what you asked but you probably shouldn’t. If you do, try to airgap the server from your personal network as best as you can
Edit edit: You know people will let you use their servers for small projects for free right? Check out https://ctrl-c.club/#what or hang out in the LowEndTalk forums and provide quality input and enter some of the giveaways for server space
Although the drawback to ctrl-c club is that you’re not going to get full control of how you install libraries and applications
That’s a REALLY broad definition.
A web app that does what?
Are you running your own Netflix-ish server? Transaction processing? Cloud storage? Ai chatbot?
Each one has very different requirements, and this is just the first four that came to mind .
AWS has hundreds of buildings filled with millions of servers, so you aren’t going to compete with that, even on a small scale.
But could you run your own little Facebook type thing? For a handful of users, sure. Could you handle the number of users that Facebook actually has in a day? You are looking at buildings filled with Computers, not a single machine’s spec 
I think you should take baby-steps and focus first on just getting something running for you to use. Maybe first experiment with configuring an application you’d like in a virtual machine before you spend money on hardware too.
You can install OpenStack, but I’d probably not let any random person run code on your machine