[HN Gopher] Ask HN: Host a website from a living room in 2022?
___________________________________________________________________
Ask HN: Host a website from a living room in 2022?
As in title. Is Raspberry Pi a viable option (SD card?!)? Should I
get an Intel NUC? Fanless would be really, really nice. Thank you!
EDIT: OK, a web app, not a website, the service is not critical
(it's my side project, 5yearsback.com), I'm 100% technical, the app
is in Clojure, but I plan to deploy Zig services as well EDIT2:
I've a static IP.
Author : tomekw
Score : 104 points
Date : 2022-12-20 12:59 UTC (10 hours ago)
| ilyt wrote:
| That app depends how good your internet/power is. But between
| most ISPs giving poor uploads and remote chance of someone
| deciding to be ass and DDoSing my IP I eventually opted in for
| VPS.
| WJW wrote:
| A pi is a viable solution up to at least a few thousand visitors
| a day, depending on how spread out they are. You will need to
| find a way to give your pi/NUC a static IP address though. Many
| ISPs will give you a static IP, then you can simply set up port
| forwarding for port 80/443 on your router and be off. If not,
| ngrok or a similar service can work as well.
|
| That said, unless you have an ideological reason for hosting it
| from your own home there are many platforms out there that can
| comfortably fit most non-critical webapps in their free tier with
| even less hassle than setting up a pi.
| fsloth wrote:
| "there are many platforms out there that can comfortably fit
| most non-critical webapps in their free tier with even less
| hassle than setting up a pi."
|
| What are "the best" at the moment? (best being whatever metric
| one feels is relevant for this scope)
| lytedev wrote:
| I use netlify for serving frontend assets and have used
| fly.io's free tier, supabase's free tier, and all the major
| public cloud free tiers (though the latter is the most
| difficult to manage from a cost perspective).
| revicon wrote:
| With AWS you can host a very robust website using API
| Gateway, (AWS Lambda or ECS) and either RDS or DynamoDB for a
| datastore. All of this can come in under their free tier for
| a huge amount of traffic.
| twistedcheeslet wrote:
| Yes absolutely a Pi is likely plenty assuming it's fairly light
| load. That said, if you prefer x86 you may have better mileage
| using an older thinclient or perhaps even something like the
| ODroid H3 (or frankly any old laptop).
|
| Just be sure to have a decent backup system in place as consumer
| grade equipment like the above may fail rather abruptly with
| little route to recovery.
|
| Edit: you may want to check out Jupiter Broadcasting's Self-
| Hosted podcast. The show is very much geared towards DIY
| enthusiasts/small businesses.
| ocius wrote:
| I can recommend the Rasperry Pi for self-hosting, if you pick one
| of the more recent models with more RAM (3 or 4 with 4GB of RAM
| at least). You just need to keep in mind that the availability of
| your website is not quite as good as if you were hosting in a
| datacenter.
|
| Regarding security: you might want to have a look at cloudflared.
| This is a (free for small projects) service by Cloudflare where
| your server (Raspberry Pi) connects to cloudflare, and all HTTP
| traffic is proxied through Cloudflare. This has multiple
| advantages:
|
| - you don't need to open a port on your router that forwards to
| your Pi, which is good for security and simplicity (some routers
| don't even have this option)
|
| - you get all the cloudflare protection with the click of a
| button, including HTTPS with automatic Cloudflare certificates,
| DDoS protection, etc
|
| - you don't need DynDNS to point to your dynamically changing IP
| ocius wrote:
| Depending on your write load, the SD card could become a
| problem, but you could mount a USB SSD. You can even boot from
| a USB SSD now (https://www.makeuseof.com/how-to-boot-raspberry-
| pi-ssd-perma...)
| revicon wrote:
| Anyone know what the best practice is to guard against
| corruption on your SD card or your SSD if your home power
| goes out and your Raspberry Pi power-cycles unexpectedly
| (outside of just getting a UPS?)
|
| I've had a previous RPI SD card get corrupted this way and
| I've been hesitant to do anything useful with home-hosting on
| one since I had that problem.
| yuvadam wrote:
| A good alternative is to use a similar SBC with eMMC module
| support, such as one of the ODROIDs
| snapetom wrote:
| Get an SD card specifically labeled "high endurance."
| They're a tad bit more expensive, but do work.
|
| Corruption has always been an issue with using standard SD
| cards as a boot system. It's just something these cards
| were never meant to do. I run multiple Pis at home, one of
| them as a scraper/site hosting/MariaDB/Wireguard. Power
| outages would almost always corrupt the file system, and a
| few times, damage the SD card. Once I switched to high
| endurance cards, I haven't had a problem.
| dicriseg wrote:
| The only things I can think of do involve a ups. There are
| battery banks that support pass through charging but I'm
| not sure if you're supposed to use that constantly. A low
| capacity power strip style ups seems like the next best. Or
| don't use a pi at all - if you have an old laptop that you
| don't use, that could be the server and it has its own
| built in ups.
|
| Sorry I don't know that I'm being helpful here. I had the
| same issue and just ended up with an ups - but I also ended
| up plugging my networking rack into it (router, cable
| modem, switch, nas) as well. We've only had one real outage
| since I set this up, but it kept my network alive for 90
| minutes or so and then the power came back up.
| birdman3131 wrote:
| Backup, backup, backup.
|
| Also test your backups.
| ls15 wrote:
| Or use tmpfs for things that get written, but actually don't
| need to be persisted.
| blacksmith_tb wrote:
| These days 'overlayfs' I think[1], though if you're running
| nginx on there to serve a site/app you might want logs?
|
| 1: https://forums.raspberrypi.com/viewtopic.php?f=63&t=2531
| 04&p...
| WhiteBlueSkies wrote:
| Aren't there obvious dangers for example if I use my Macbook
| and host it a server?
| rzzzt wrote:
| Constantly keeping the battery at 100% can be an issue, but
| modern versions of macOS allow you to limit charging. There
| are also utilities that work on older OS versions (they just
| issue an SMC command to achieve the same thing), like this
| one: https://github.com/zackelia/bclm
| RossM wrote:
| I did this for a bit. The main issue was that air intake on
| my older model was through the keyboard, so clamshell mode
| was inadvisable - not sure if that's true of the newer models
| and M1 should run cooler.
|
| If you're wiping it and installing Linux it's like any other
| server, but if you're running macOS you're open to a wider
| spectrum of vulnerabilities that wouldn't normally apply
| (desktop software). Your apps could also have vulnerabilities
| that expose access to personal credentials, etc (e.g.
| filesystems, apple id) depending on your setup.
|
| You can insulate yourself a bit with tunnels/proxies to
| expose specific services (e.g. cloudflare, ngrok).
|
| I had a lot more peace of mind buying an old, cheap computer,
| raspberry pis, and eventually NUCs.
| digitallyfree wrote:
| I run much heavier networking equipment (enterprise
| routing/switching + rack server) but I also host at home using
| cloudflared on a slow DSL connection. It works very well and
| the CDN's caching helps with my low upstream bandwidth.
|
| You aren't tied to Cloudflare in the sense that there are other
| CDN services to choose from, each with their own pros and cons.
| With the servers on your own infrastructure you can choose the
| provider you like and easily switch between them. I also have
| ports forwarded for services that I don't want to proxy.
| tomekw wrote:
| Thanks. Fortunately I've a static IP.
| BlueTemplar wrote:
| Using a different IP than your home network might be a good
| idea ?
|
| ( Your ISP should give you at least a /56 :
| https://www.ripe.net/publications/docs/ripe-690 )
| ilyt wrote:
| Funny man thinking ISPs everywhere just give IPv6 willy-
| nilly.
|
| Even funnier that you think you'd even be accessible if you
| put your website on IPv6 only
| vel0city wrote:
| I have a few personal things hosted on IPv6-only just for
| giggles. A few years ago those things would almost never
| be reachable. Now I can reach them at most places. I at
| least have IPv6 on cellular connectivity all the time.
| BlueTemplar wrote:
| Before long, not supporting IPv6 will make your website
| more unreachable than not supporting IPv4. (Already the
| case in Asia ?)
| aliqot wrote:
| It'd be helpful for others if you clarified whether you're
| asking a question or making a statement.
| BlueTemplar wrote:
| Let's say that I am considering this too, have looked a
| bit into it, but I am not a network engineer, and haven't
| done it yet, so I am not sure how good that advice is ?
|
| I guess this depends a LOT your ISP, and especially the
| router they gave you, how much IPv6-only friendly are
| they ?
|
| Yes, you can buy your own router, but this come with even
| _more_ complications and potentially negotiations with
| the ISP.
| aliqot wrote:
| I'm starting to notice you end statements with question
| marks, which solves my previous question.
| officialjunk wrote:
| i concur it is unclear and hard to understand the
| intention.
| BlueTemplar wrote:
| What is unclear about question marks indicating
| uncertainty, _especially_ after I explained it ?
|
| (And to be _extra_ clear, _this_ question mark indicates
| a question, albeit a rhetorical one.)
| spansoa wrote:
| > You might want to have a look at cloudflared
|
| I think people self-host with their ISP to get away from
| centralized choke-points such as Cloudflare. Unless you're fine
| with having Cloudflare have yet-another-datapoint.
| ocius wrote:
| Good point. You are not dependent on Cloudflare, though, you
| can use other similar services or open the port on your
| router if it supports it. And if you pay for it, you can get
| an SLA so that they can't mess with you by terminating your
| project.
|
| I would still consider it very nice of them to offer this
| free service that let's you break free from your dynamic IP,
| crappy router and at the same time giving you protection that
| you couldn't set up yourself.
|
| I think many people just want to be able to make their device
| available from the internet - this type of liberty is not
| really important for many people.
| treesknees wrote:
| Another option is to use a VPS + nginx + a wireguard VPN.
|
| Your home web server can establish a VPN connection to the
| public IP of your VPS, meaning you still don't need to worry
| about dynamic addresses changing or opening ports on your
| router. This is essentially what a Cloudflare tunnel is.
|
| Granted a VPS isn't usually free. But some places like Oracle
| Cloud do offer free-tier compute, as well as fly.io.
| feet wrote:
| This is a great option IMO, I use it myself to host
| multiple services. A VPS can be had for $5 per month or
| less
| dusted wrote:
| That's what I do, but without a real VPN (I don't want
| secrets on the VPS)
|
| http://dusted.dk/pages/aWayOut/
| treesknees wrote:
| Oh interesting, so you only drop a public key onto the
| VPS, and you forward TLS to the VM at home instead of
| terminating on the VPS. That's a neat idea.
|
| So with your statement, "I still don't want to trust a
| VPS provider", is this more about having your secrets or
| file contents leaked? Because even in your design, if the
| VM is compromised, then so are your users. At some level
| you still have to trust that the provider isn't malicious
| or vulnerable.
| dusted wrote:
| Yes you are right.
|
| If my VPS is broken, I don't lose any secrets, and it
| does not permit any additional access into my LAN or VPN.
|
| For plain HTTP, of course all traffic would be easily
| intercepted and readable. For HTTPS, I guess an attacker
| might compromise the software and IP tables configuration
| on the VPS and run a MITM attack to decrypt it.
|
| So yes, I am putting a bit of trust on the VPS, for my
| specific use-case, the most sensitive information they'd
| be able to access if they went through the trouble of
| decrypting HTTPS, was getting access to my music-player
| :)
|
| I am thinking though, that at that point.. well, even if
| I hosted at home on my own ISP directly, I still need to
| put that same amount of trust on my ISP, since they could
| MITM me as well I think.
| abdullahkhalids wrote:
| If you self-host with your ISP, then isn't your ISP also a
| choke-point? If your ISP decides to block you for some
| reason, you have to change ISPs or possibly your location if
| there is only one good ISP at your location.
| Hamuko wrote:
| I'd rather have someone DDoS Cloudflare than my home IP. Or
| just host somewhere that is not my home without Cloudflare.
| seanw444 wrote:
| Yeah for small services like game servers for my friends
| and I, I'll host on my home IP. But for large websites and
| services... no thanks.
| newaccount74 wrote:
| I think the best home server is the 2014 Mac Mini because:
|
| 1) internal HDD can be replaced with cheap, big SSD
|
| 2) Computer is absolutely silent
|
| 3) everything in one package, no mess of cables
|
| 4) very reliable
|
| 5) very low power usage
|
| MacOS isn't the best OS for running a server, but I'm used to it
| so I don't mind setting up launch agents instead of systemd units
| discordance wrote:
| There are a bunch of micro SFFs like it (Dell/HP/Lenovo etc)
| with 6th-8th gen i5/i7s) with the same power, noise profile and
| are $100 off eBay.
|
| Much better value and power over a raspi.
| rzzzt wrote:
| ServeTheHome reviews lots of small machines like the ones you
| mention:
|
| - https://www.servethehome.com/introducing-project-
| tinyminimic...
|
| - https://www.servethehome.com/tag/tinyminimicro/
| newaccount74 wrote:
| I wonder why noone except Apple manages to build a small
| device with an integrated PSU.
|
| If you put them into a cupboard, those PSUs take almost as
| much space as the computer itself.
| revicon wrote:
| Seems like one issue would be that an older Mac device is not
| going to be able to run new software updates once it ages out
| and wont get new security updates once that happens.
| newaccount74 wrote:
| Yes, that is true. OpenCore [1] allows a few extra years, but
| at some point the 2014 mini will be too old.
|
| That being said, if you use the Mac as a server, behind a
| NAT/Firewall with only some ports open, use up to date server
| software, and don't use it to surf the web, then the security
| impact of using an outdated OS is minimal.
|
| You could of course also just install Linux on it.
|
| [1]: https://dortania.github.io/OpenCore-Legacy-Patcher/
| abadger9 wrote:
| Coincidentally, I was thinking about this about a week ago. If
| you look at my post history my career traces a pre-ipo FAANG
| where everyone knew how to spin up a service and connect it to
| the internet (think bootstrapping 101). I had a thought
| experiment last week where if I were to ask this to new grads
| entering FAANGs, the majority of them probably would not be able
| to elucidate the steps required.
| wiz21c wrote:
| Is the carbon footprint better if I host my own RPI instead of
| using a cheap virtual server somewhere ? Having a Raspberry on
| all the time will consume some electricity I gues...
| cientifico wrote:
| If you use a cheap recycled server you will be running in years
| old computers. If we compare that to buying something
| (including building and transportation) I bet that RPI have
| higher impact.
| jhoelzel wrote:
| this depends on your datacenter i would wager.
|
| If the energy of your server is green and the heat is reused,
| as some modern datacenters do, the only concern becomes EOL of
| hardware and how quickly they change it.
|
| Otherwise, yeah, shared cloud vm is always more economic than
| single hosted hardware of any kind.
| taubek wrote:
| Check if your ISP allows this. Some ISPs forbid self hosting.
| hardware2win wrote:
| You folks arent worried about fire hazard?
|
| I'd probably never pick having some device running 24/7 when
| there are 3$ VPSes
| flakeoil wrote:
| Hehe, you have so many things running 24/7 in your house
| already. Refrigerator, freezer, heating system, laptops in
| standby, printers in standby, routers in standby or active
| 24/7, HVAC systems etc.
| iforgotpassword wrote:
| Unless you unplug everything when not in use, you already have
| a dozen fire hazards at home. A PC that's powered off still
| delivers power to a bunch of components like the Intel ME, or
| nic for WOL; your TV, dish washer, washing machine, fridge,
| Alexa, smart hub, router, PlayStation 4 have some soc running
| 24/7. A pi is probably very safe, I've never heard of one going
| up in flames just like that. It's much more likely the USB
| charger it's running off will blow up of it's a cheap one from
| Walmart.
| hardware2win wrote:
| >Unless you unplug everything when not in use
|
| I do
| spansoa wrote:
| Also worth investing in a surge protector device if you're
| worried about your electronics getting fried due to
| electricity surges.
| jhoelzel wrote:
| I thought the same as you for a long time and have a new fear
| for you:
|
| You know that water pipes are in those walls too?
| kindofabigdeal wrote:
| You could probably even host on an old phone if you really wanted
| to, at the end of the day it doesn't matter what you're hosting
| on but how you're managing assuming internet speed and hardware
| latency aren't an issue.
| [deleted]
| rsolva wrote:
| I host personal and semi-commerical websites/apps from home on a
| 500/500 fiber connection. The hardware is an older HP G1 800 SFF,
| which you can buy refurbished for ~EUR150, much more bang for
| your bucks than a Pi. Proxmox makes it possible to host many
| webservers and services on LXC containers. But of course, a Pi
| would work too :)
|
| I have choosen to treat IPv6 as the default stack as I can point
| directly to the address from outside without any NAT. A reverse
| proxy handles all "legacy" IPv4 requests. My IPs do change once
| in a while, but I have made a little bash script that updates the
| DNS via my domain registrars API, works like a charm!
| cm2187 wrote:
| My experience with Intel NUCs (but that's not recent models) is
| that they are very quiet as long as you don't push them, but
| super noisy if you push them. So I'd stay way from NUCs in a
| living room unless you are doing low power stuff.
| scrappyjoe wrote:
| I have experimented with many small form factor servers over the
| years. A Pi3 or 4 should work fine, but you as others have said
| you are limited by no SATA, source your own power brick, and
| source your own case.
|
| My most bomb proof SFF servers are a fit-pc3, still running since
| 2014, and a lattepanda alpha, which has been running for about 2
| years. Of the two, I'd choose a fit-pc3 or whatever the most up
| to date model from compulab currently is.
| rakoo wrote:
| I would go for a secondhand old laptop. Not only will it prolong
| its life instead of pollution by buying even more new machines,
| you have integrated screen and keyboard for debugging _and_ a
| battery acting as a cheap UPS. Parts are easily found. x86, so no
| funny business with experimental builds.
| ThrowawayR2 wrote:
| Keeping the laptop's battery at 100% charge on laptops will
| shorten its lifespan considerably and they won't find out
| whether the battery has gone bad until the power goes out. Some
| newer laptops have charge limiting that can mitigate this but a
| secondhand laptop likely won't.
| Jeremy1026 wrote:
| Having a battery on your server does nothing for being a UPS
| for your website if you don't also have one on your source of
| internet.
| wolrah wrote:
| > Having a battery on your server does nothing for being a
| UPS for your website if you don't also have one on your
| source of internet.
|
| Having a battery specific to your server allows the UPS for
| your network to last a lot longer.
|
| I use one of the 1500VA class desktop UPSes to run my home
| network, the largest variety normally sold for use with a 15
| amp circult. It's good for about 30 minutes with my server
| turned on, or three hours just running the router, switch,
| and WAP.
|
| If I were able to use a laptop as a server I could instead
| have the big brick doing just the network and then the
| "server" could get a few hours of runtime on its own.
| newaccount74 wrote:
| Lithium batteries have a finite lifetime and I wouldn't want an
| old lithium ion battery hanging on the charger 24/7 in my
| appartment. Fire risk is too big.
| ChuckNorris89 wrote:
| _> I would go for a secondhand old laptop_
|
| But only if you don't live in Europe, as old laptops tend to be
| quite energy inefficient by modern standards, and at the
| current energy prices, you'll see the difference on the yearly
| bills, between an old laptop and a new one running 24/7 in your
| house.
|
| You can get chines barebones with modern quad core 11th gen
| Intel Celeron chips that sip power for about 150 Euros. The
| best part is that some are even flanless so they're dead silent
| and there's no more worrying about cleaning the dust from the
| fan every few months. Just chuck it somewhere out of sight and
| you never have to thin about it physically.
| rakoo wrote:
| It's definitely not cheaper, but it's much better for the
| environment. It is clear today that digital pollution happens
| mainly during the production stage rather than the using
| stage.
| seba_dos1 wrote:
| Why are you asking instead of just doing it? Nobody else knows
| what is the exact workload you intent to put there.
| mynegation wrote:
| I don't know about Raspberry Pi, but I went for the familiar
| Intel/Linux setup: mini-ITX computer, fanless, similar to Intel
| NUC but bought off Alibaba, 4 GB memory, reasonable 256 GB SSD,
| 4TB WD passport, synced to my OneDrive account. I replaced big
| noisy NAS setup with this and it has been great and working for
| many years now. I do not host any public facing web server though
| and connect to it only through VPN (being hosted on the same
| computer).
| ectospheno wrote:
| Get a cheap vps. Set it up as a wireguard server. Stick a
| barebones haproxy on it. Run it in tcp mode pointing at a
| wireguard client ip for the backend.
|
| Pick some machine in your house. Make it a wireguard client
| connecting to the vps. Run whatever web server/app you want. Make
| sure your home router is running something like fq_codel.
|
| Done. You don't need dynamic dns as your home client will just
| reconnect. Your ISP won't see any ports open because there aren't
| any. Your SSL certs and all data live in your house, not on the
| vps. There is nothing to backup at the vps except for yanking
| some logs.
| pflanze wrote:
| > Stick a barebones haproxy on it. Run it in tcp mode pointing
| at a wireguard client ip for the backend.
|
| If you have just one backend server instance, you could also
| use a DNAT iptables rule instead, which would have the
| advantage of not hiding the originating IP from the backend. Or
| am I missing something?
| blmayer wrote:
| If your web app is not very heavy you can use a Rpi to serve it,
| else get something more powerful. Either way I recommend:
|
| 1. Having a no break with surge protection: I have my router and
| Rpi connected to a no-break, so even if the power goes down my
| site stays up.
|
| 2. Configure port forwarding in the router: I forward port 443 to
| some higher port, so in the Rpi I don't need root for anything.
|
| 3. If your traffic is very high consider getting another internet
| link.
| xz18r wrote:
| Concerning security: look into Traefik or Nginx Proxy Manager to
| proxy from your server to your domain. Then, attach a Cloudflare
| proxy to your domain so people won't ever know your home IP. Only
| expose port 443, and I think you're okay. Happy to hear
| otherwise.
| bibelo wrote:
| Think about security on your home network. If your publicly
| accessible webserver gets compromised, it can be used to reach
| your personal computers at home.
|
| Or the other way round, which IMO would not be so serious (ie
| your already compromised personal computer being used to access
| your public webserver...)
|
| You could try to isolate your webserver, but would need a
| dedicated router with specific features to do it (best being able
| to do VLANs).
| mro_name wrote:
| interesting hint - what is the percentage of infected windows
| boxes again? 80%?
| notakio wrote:
| I've used the Pi (both a 3 and 4) as a temporary server when
| moving (read: leave the old server up at home until move-day,
| while placing a Pi in the new home, configured to take the www
| load normally pointed at my old server. I'm hosting 14 sites from
| home, none of which are high traffic, but under those
| circumstances, the Pi held up just fine. Once move-day comes, I'd
| make the DNS change to point at the new Pi, pack my stuff, move,
| then reverse that process once I've brought the old server back
| online.
|
| I'd say unless your web app is resource-hungry, the Pi is totally
| viable as an option.
| l72 wrote:
| I have a fitlet2(https://fit-iot.com/web/products/fitlet2/) that
| I use for hosting various services. It is fanless, 16G of RAM and
| 500G SSD. This is my NAS, and I am currently running:
|
| - Jellyfin - Media Server for all my tv, music, and movies
|
| - Nextcloud
|
| - Photoprism - Picture Manager
|
| - Yacy - Private Search. I run this in 'robinson mode' and
| basically use it to replace all my bookmarks
|
| - Homeassisant
|
| - Frigate - Monitors my cameras and does object recognition. I
| use Coral USB to move detection to hardware
|
| - Snapdrop - AirDrop replacement
|
| - FreshRSS - RSS Server
|
| - Bitwarden - (bitwarden_rs/vaultwarden)
|
| - Imapfilter - Filter/tag/run external software on incoming
| emails
|
| - Vikunja - Task Manager
|
| - Dolibarr - ERP Manager for side business
|
| - Bookstack - Wiki
|
| - Several Static Websites
|
| - NFS (as a NAS)
|
| Frigate takes the most CPU, even with the Coral, but it is doing
| object detection on several high-res Remote Cameras. Even with
| that, my load is < 1.
|
| I run all these in docker (each that needs a DB has its own DB
| instance too), with nginx-proxy and letsencrypt-nginx-proxy-
| companion in front of it.
|
| Most of these are internal only (I use the access=internal), and
| have an always connected wireguard VPN on my mobile devices and
| laptops. A few are public, but pretty low traffic.
|
| I have a static IP, and am running this on DSL that is 30M/7.5M.
| My router is a netgear with DD-WRT installed.
| pinecamp wrote:
| This looks really cool. It's the first time I've heard of
| fitlet, and seems like exactly what I've been looking for to
| replace my old noisy server.
|
| Did you consider any alternatives when putting together this
| setup? Or for others reading, are there similar fanless options
| to compare?
| l72 wrote:
| The primary other I looked at was an Intel NUC.
|
| I also use several raspberry pi for some smaller iot things,
| but I find it is nice to have one decently powerful server to
| run a whole bunch of services on.
|
| It also has two external 8Tb drives in software raid0 that I
| use for my NAS storage.
| wrycoder wrote:
| Very nice!
|
| How do you handle backup?
|
| You don't seem to me running RAID on the NAS?
| revicon wrote:
| Neat setup, I've considered starting down this path as well.
|
| With this setup, how do you deal with data backups, especially
| if multiple of your docker instances have databases of their
| own?
| l72 wrote:
| For each service I run, I have a volume for the persistent
| storage. For example: Nextcloud has a maria (mysql) db and a
| server. In my /opt/nextcloud I have a script for
| creating/updating the docker images. Persistent data lives in
| /opt/nextcloud/srv/{db,data}. I used systemd for
| management/dependencies (I don't use docker compose, just
| simple, single instances that are easy to recreate).
|
| Everything is backed up daily using rdiff-backup.
| yawgmoth wrote:
| While you're not concerned with uptime an old laptop isn't a bad
| way to go: built in battery backup!
|
| As far as exposing to the net, ngrok seems cool.
| mschuster91 wrote:
| > While you're not concerned with uptime an old laptop isn't a
| bad way to go: built in battery backup!
|
| That is a sure way to kill off the battery and a fire risk as
| well. Laptops aren't designed to run 24/7.
| justusthane wrote:
| Is this true? My laptop has been on 100% of the time
| (although usually asleep) and also plugged in much of the
| time since I bought it in 2014.
| mschuster91 wrote:
| Battery vendors generally recommend you do not keep them on
| a charger all the time since the charger will keep it at
| 100% charge, and the longer a battery is at 100% charge,
| the more degradation it will experience for electro-
| chemical reasons. Sooner or later, that can lead to battery
| swelling and eventually a catastrophic thermal runoff.
|
| Additionally, keeping a laptop shut and running _usually_
| messes with its thermal design as the heat can 't escape to
| the top via the keyboard, further heating up the battery.
| windowsrookie wrote:
| Most laptops in the last few years have an option to not
| fully charge the battery if it's going to sit plugged in.
| I know this option is available on Dell, Asus, and Apple
| laptops. I assume others have it as well.
| icoder wrote:
| I doubt it, as I n++ your n=1 by experience, but also since
| I think it shouldn't be hard, electronics wise, to stop
| charging once full (or even, optionally, 80% / 90%) and
| fully run on AC as long as it's available. Also I'd say
| this is an apparent user requirement for laptops.
| anaganisk wrote:
| Go with an intel NUC i literally wrote a script to alert me on
| raspi stocks and luckily found 4 of them 8Gb versions. Used intel
| NUC (I bought a beelink one which is so quiet) for much cheaper
| $130, and actually runs pfSense now. My dell 7080 bought used for
| $160 consumes like 5$ worth power in weeks and has 32GB of ram.
| Raspberry Pi is purely good for prototyping, or if you have any
| use for GPIOs. Else, the above options are far better for
| cheaper.
| cramjabsyn wrote:
| Get a cheap USFF (ultra small form factor) PC. Its essentially
| laptop components in a small headless box. For the going price of
| a rpi 4 you could have an i5 or i7 with 8-16G ram and a proper
| SSD
| ksrm wrote:
| These seem to have laptop-style fans in them - do you know if
| they can be run silently?
| jhoelzel wrote:
| i have been pondering the same lately because my internet got
| upgraded and so far i decided against the pies because of
| resiliency.
|
| My go to setup plan right now is 3 8 core 16 thread mini pcs
| because they dont use anywhere near as much power as a full setup
| and still allow me to run a small kubernetes cluster.
|
| My main reason for the cluster is not because its fancy, but this
| way i can actually update my services without downtime and the
| underlying machines too.
|
| As other have mentioned, make use of cloudflare and the different
| services it provides and you shall have a simple secure setup
| that can handle a magnitude of loads.
|
| As for the app: the true enemy will be rate limiting for you. But
| if you decide to take a frontend that is chacheable by cloudflare
| you should be golden with a queue based setup. Pingdom does that
| perfectly for instance with their speed tests for websites.
| whalesalad wrote:
| An alternative to relying on your static IP (and all that comes
| with it, like needing a strong firewall and awareness/monitoring
| of activity there) would be to use the Cloudflared proxy/tunnel.
| https://github.com/cloudflare/cloudflared
| themoonisachees wrote:
| I have my old computer doing this, it replaced a rpi in 2017. I
| now run a proxmox node on it, and one of the VMs serves
| https://poggers.website
| opan wrote:
| You can use a RockPro64 and set up USB boot to avoid the headache
| of SD cards.
|
| https://wiki.pine64.org/wiki/ROCKPro64#Booting_from_USB_or_P...
| Nican wrote:
| I just have an old Dell computer [1]. They are pretty small,
| quiet, has an SSD, and I do not need to fiddle in having
| everything compiled for Arm.
|
| I would also put your app behind CloudFlare.
|
| Also- if you are able to afford an intel NUC ($200?), and the app
| is low resources enough to be able to run on a Pi. You could also
| consider getting a VPS ($10/month).
|
| [1] Something like https://www.newegg.com/dell-
| optiplex-7090-business-desktops-... - but older, and found on a
| local recycling center.
| Semaphor wrote:
| There are a lot of suggestions already, so I'll just mention two
| useful communities: https://reddit.com/r/selfhosted/ &
| https://www.reddit.com/r/HomeServer/
| johnklos wrote:
| Pi devices are more than capable of running web sites and web
| apps. I'm running a somewhat busy SearXNG instance on a Pi 4, for
| instance. Just get self-powered USB attached storage and a Flirc
| case, and it can be completely fanless (so long as the storage is
| fanless), and you don't have to worry about your SD card wearing
| out.
|
| Even if you don't get storage with its own power supply, you can
| use a "Y" USB cable for extra power, provided the same power
| source is used for the Pi and for the storage. This can have the
| added benefit of backfeeding power to the Pi, which, again, is
| fine so long as the power sources are the same.
|
| While my Pi 4 is colocated, it has a Flirc case so it can run all
| four cores at 100% without ever having thermal issues, and the
| two USB attached disks are mirrored (raidframe), and it has been
| 100% stable for many, many months of heavy use.
| gwbas1c wrote:
| A lot of NASes can host web sites. My Synology NAS is just a
| computer without a monitor.
|
| I know it's point-and-click to run Apache on it. (I personally
| haven't set it up.) At some point I might try to set up NodeJS to
| run some blog software I wrote between jobs.
| kkfdkerpoe wrote:
| You could also take a look at used fanless thin clients from HP
| and such. Cheap, totally silent, still fairly low electricity
| consumption but more power.
| me551ah wrote:
| Most home broadband connections aren't that good with upload
| bandwidth. I would suggest something like https://lowendbox.com.
| You should be able to easily get yourself a cheap server for
| 1-3$/month which would come with Linux, public IP ,x86 cpu,
| proper SSD and good bandwidth. It would also have much better
| uptime.
| mikedelago wrote:
| There's a few ways.
|
| Already have an old pc hanging out somewhere? Good - don't buy
| anything new. Run the HTTP services from there and set up port
| forwards in your router, and DNS with your domain registrar (or
| set up cloudflared as other commenters noted). You're done.
|
| Step further, you can go with a RasPi or a similar SBC, but just
| be aware running with ARM can have its' own challenges.
|
| I'd recommend a cheap x86_64 machine from ebay, such as an HP
| t730 plus thin client. Native SSD support, higher/upgradeable ram
| capacity, and better IO would all come together to make a better
| server machine. The RasPi would win out on a few points (power
| draw, memory speed), but in this scale it likely wouldn't be
| noticeable.
|
| Lastly - don't be afraid of cloud services. A
| GCE/EC2/vultr/hetzner server can get you pretty dang far for just
| a few bucks a month. Also, this makes it easy to get some
| exposure to infrastructure provisioning tooling (I prefer
| Terraform and Terragrunt) and server configuration management
| tooling (I prefer ansible).
| RobotToaster wrote:
| Raspberry Pi is hosting their own mastodon instance on one,
| although it's slow as hell right now, but obviously they have a
| lot of hits.
|
| Security is a bigger issue IMO though.
| t312227 wrote:
| personally i would go with some silent and cheap system: an
| existing old pc, a (cheap) ITX-board which already includes a CPU
| or a raspberry with enough ram and external storage for data.
|
| btw. i recently watched a video, in which the creator compares
| different used smaller formfactor pcs from ebay
|
| * https://www.youtube.com/watch?v=rXc_zGRYhLo
| bakugo wrote:
| Depends entirely on how much power you need. Pi is fine if you
| don't need much, NUC is good if you need something more and, from
| my experience, can run comfortably with the fans off if you don't
| mind capping the CPU frequency a bit.
| ta988 wrote:
| Yes this would work.
|
| There are a lot of alternative SBCs to the Raspberry that are
| easier to find these days.
|
| If you plan to use the SDCard make sure you do not write logs to
| it or that you change it regularly. I recommend that you mount a
| harddrive/ssd or usb stick for the logs if you really want them.
| kypro wrote:
| What's your goals for the project? I mean it's obviously
| possible, the question would be why?
| dusted wrote:
| My server is literally 2 meters behind me (yes, I mind the noise,
| don't cohabitate with full depth 4u machines, on the other hand
| it does help with heating this winter..)--
|
| Static IP is most difficult, if you got that, you're good to
| go... If your website or app is light enough, sure, go with a pi4
| or similar, don't put a fan on it, maybe a nice enough heatsink
| (use real thermal glue, NOT adhesive tape, some of the cheaper
| stuff actually melts and the block falls off).. Consider a 3 way
| router, like an edgerouter lite, so you can have a DMZ for the
| "server" so that if someone decides to visit, they're isolated
| from your other LAN machines.
| Stranger43 wrote:
| Even an pi is basically in the same performance range as the
| average lowest tier cloud vm so if your considering something
| bellow say a aws t2.medium to be enough then your only real
| concern is if your app is iobound enough for the sd card to be a
| bottleneck and it's very likely that your app is not.
|
| If you want to go with a more traditional x68 any of the many
| intel n4000/n5000 series systems being sold on aliexpres and
| similar sizes by no name brands as firewall appliances or network
| something do support modern m.2/nvme storage.
| roytanck wrote:
| Considering that your system, power supply, storage and
| connection won't be redundant, I would not recommend this if you
| want the website to have decent uptime.
|
| The cost of a Pi would likely also pay for a decent low-end VPS
| for a years or so.
| tomekw wrote:
| I know, but (1) it's not critical, and (2) come on! It's so fun
| and so web1, and I have a static IP! :)
| zegl wrote:
| I don't know how experienced you are. Yes, you can host "a
| website" on a Raspberry Pi, even on something tiny like the Zero
| W. It all depends on your needs, a Pi 4 (if you can get a hold of
| one) is a great option!
| throwaway0x7E6 wrote:
| a RPI 4 is a more powerful machine than most website servers were
| in the 00's
|
| serve a lightweight static website from RAM or a well-optimized
| webapp and it will handle a decent amount of traffic
| renaissance_tea wrote:
| Is it public? If you host a high traffic site from residential
| ISP connection, your account could get banned.
|
| Regardless, I would host an NGINX proxy in front of some docker
| containers. It's the easiest and classic way to front apps with
| custom domains very very easily. Traefik is also very nice and
| fast (Go based) reverse proxy.
|
| If it's purely for personal use, then check Cloudflared to tunnel
| into your network and access it like a VPN.
|
| Again, if it's Public be weary of DDOS attacks, port scans, etc.
| Personally I wouldn't self-host a public web app from my house
| and instead would use a 4/mo VPS from Hetzner
| nirvgorilla wrote:
| Man, you are way too afraid dude.
|
| It's YOUR internet connection. Who's going to ban you for
| opening ports and running a server? I've been doing it with
| comcast for 20+ years.
|
| Maybe not all my server traffic goes through port 80 or 443,
| but my server is also my torrent seedbox which is high traffic
| and just another port. WHATEVER.
|
| My server is just a Windows 7 PC in the living room with no
| monitor, no keyboard, and no mouse. Only connected power and
| ethernet. I remotely control it with RealVNC and it's extremely
| stable. The only time it goes down is a power outage because I
| don't use a UPS.
|
| I use it for a website (nginx/let's encrypt), Jitsi Meet,
| Mumble, Ventrilo, FTP, proxy (8080), and of course torrents.
| Not afraid of port scans.
|
| I use a couple of DDNS domains that I give people but I can
| disable the public one I give to people and change my IP any
| time I want.
|
| NOT VPN. NOT Cloud. NOT VPS. NOT pay monthly to someone. You
| can do it all yourself for free and have been able to for
| decades. Quit being so scared, cell phone generation.
| erellsworth wrote:
| Your mistake is thinking that it is YOUR internet connection.
| It's not. It belongs to your ISP. If it belonged to you, you
| wouldn't have to pay for it every month. A lot of ISPs
| specifically forbid running a web server from your
| connection. Comcast is one of them. Among their restricted
| uses they include:
|
| "use or run dedicated, stand-alone equipment or servers from
| the Premises that provide network content or any other
| services to anyone outside of your Premises local area
| network ("Premises LAN"), also commonly referred to as public
| services or servers. Examples of prohibited equipment and
| servers include, but are not limited to, email, web hosting,
| file sharing, and proxy services and servers;"
|
| https://www.xfinity.com/Corporate/Customers/Policies/HighSpe.
| ..
|
| Just because you've been getting away with it doesn't mean
| the risk of having your account suspended isn't real or worth
| considering.
| revicon wrote:
| > Your mistake is thinking that it is YOUR internet
| connection. It's not. It belongs to your ISP. If it
| belonged to you, you wouldn't have to pay for it every
| month. A lot of ISPs specifically forbid running a web
| server from your connection. Comcast is one of them
|
| You're not wrong, but as far as I know there is no human on
| earth that owns "their own internet connection", everyone's
| network connects to an upstream network. Every upstream
| service has rules their customers must abide by.
| Mo3 wrote:
| > NOT pay monthly to someone.
|
| You pay your internet and electricity, no?
| nishs wrote:
| > Quit being so scared.
|
| Unfortunately not everyone may live in a region with multiple
| internet providers, such that they can switch to a different
| one if banned.
| nyolfen wrote:
| if you're just serving a static site you could probably serve it
| from a toaster
| shashashasha___ wrote:
| any toaster in particular?
| LeonM wrote:
| Preferably one with NetBSD support
| tyingq wrote:
| The Odroid H3 looks nice if you want x86_64, fanless, and
| reasonable pricing for that. Probably overkill for hosting a
| website, but perhaps you want to do more later.
|
| https://www.hardkernel.com/shop/odroid-h3/
| achairapart wrote:
| Yes, a Raspberry is a viable option. These days I do most of my
| computing on a Raspberry Pi 4 attached to my home router:
|
| https://fatcity.it/
|
| One thing you really need is an SSD, though. I use a cheap
| Kingston, it works great but you must pay attention to the right
| USB->SATA adapter, picking one that's fully compatible with UAS
| drivers. For booting directly from the SSD with Ubuntu there is
| this useful guide:
|
| https://jamesachambers.com/raspberry-pi-4-ubuntu-20-04-usb-m...
|
| Performance wise, this little computer runs mostly like a common
| VPS, I think on par with a droplet from Digital Ocean, for
| example. Here some benchmarks:
|
| https://pibenchmarks.com/benchmark/62022/
|
| If you don't want to share your IP, a Cloudflare tunnel is a
| great alternative:
|
| https://developers.cloudflare.com/cloudflare-one/connections...
|
| Also, another essential tool is Tailscale, with it I can access
| my home server from basically everywhere just like a LAN
| connected device: https://tailscale.com/
|
| PS: You can also do your own tunnelling with OSS alternatives, if
| you have enough patience/time.
|
| Anyway, feel free to ask anything.
| albrewer wrote:
| Thanks for the info. I'm in a similar situation as OP and I
| think I can get this going without an issue.
| belltaco wrote:
| Any particular reason why? You can get a free VPS in many places,
| for example: micro instances on AWS free tier, Azure free tier,
| etc. I don't know if they give you a unique static global IP,
| probably not. But as another commenter said, you can proxy it to
| Cloudflare with their free service with cloudflared. That will
| protect you from others knowing your home IP and general
| location, and also you don't want DDoS interrupting your home
| connection.
| spansoa wrote:
| > AWS free tier
|
| Maybe I'm wrong, but I thought AWS' free tier only lasts a
| year. Then you have to tear everything down and spawn a new
| account and re-upload and re-configure everything, which is
| burdensome?
| belltaco wrote:
| Looks like you're right about compute.
|
| https://docs.aws.amazon.com/whitepapers/latest/how-aws-
| prici...
| riffic wrote:
| > my side project
|
| You have a lot of options here that don't involve hosting a site
| from your own living room. Try looking at these lists for ideas:
|
| https://github.com/jixserver/free-for-dev
|
| https://github.com/ripienaar/free-for-dev
| sokoloff wrote:
| "How thick does my rope need to be?"
|
| I serve a website for my 3D printers from a Raspberry Pi (some
| are 3B+, some are Zero-W). It's just for "the set of people in
| the house who use the 3D printers", so the Pi is fine and
| obviously a viable candidate.
|
| I have an ESP32 (or it might be an ESP8266 even; I'd have to
| look) that serves a status page for the boiler and near-boiler
| temps. That's also in-house only, but even that's on the slow
| side. https://imgur.com/a/JmeXYnj
|
| What is the load this site is expected to serve? To what
| visitors? How static/cacheable is it? For me, an RPi goes a long
| way for anything in-house. Out of the house traffic, I'd look at
| a cheap VPS pretty early in the journey.
| andrethegiant wrote:
| Check out KubeSail https://kubesail.com/homepage
| pflanze wrote:
| A drawback of the Pi 4 is that if you want to do RAID with USB
| hard drives, I found that you need a separate powered USB hub for
| each disk. That's (A) to give them enough power (although I used
| spinning disks, it may or may not be necessary for SSDs), and (B)
| I found that when I had them on the same hub or on the Pi
| directly, when one disk went down, it would lead to the other
| disk becoming inaccessible as well. It seems with separate hubs,
| that's not an issue. (Don't ask me about the technical details
| why that might be so, if you know more and can explain that I'm
| wrong, go for it, it was simply the result of my experiments
| (with an n of 2 or 3 or so), and does make sense in that there's
| more electronics between the drives to shield, and it's
| indirectly addressed so maybe the kernel is less confused,
| whatever.)
|
| My current setup with two hubs has been working reliably so far,
| but in spite of it all being USB3 it's still not that fast (about
| 100MB/s serially top--I'd hope that the 3.25'' disk drives (new 4
| TB drives, WD Elements 2620 and Seagate Basic STJL4000400) could
| do more, but maybe I'm wrong). So for my next tiny servers /
| appliances, I want to try either of the following instead, which
| have SATA which should be more reliable and faster:
|
| https://www.pcengines.ch/newshop.php?c=48881
|
| https://www.olimex.com/Products/OLinuXino/Home-Server/LIME2-...
|
| Also, since Pi 4's are unobtainable here (Switzerland) currently:
| the Tinker Board 2 seems to be a bit faster than the Pi 4, and it
| has its wifi board as a plug in board, and I have been wondering
| if that can be replaced with a SATA interface, but haven't
| investigated.
|
| Edit: seeing achairapart's comment, I realize that going directly
| from USB to SATA and then attaching disks there might have been a
| better option.
| endisneigh wrote:
| As a slight variant of this question - how would you host a
| production site from your living room? Assuming you have a static
| IP and a business account.
| riffic wrote:
| If by "production" you mean it's something you intend to use to
| produce revenue, then you absolutely shouldn't until you've
| evaluated and exhausted all of your better options.
| endisneigh wrote:
| Though I personally wouldn't do this, why not? There are
| places where business gigabit internet is plentiful and
| weather is stable so power outages are very rare.
|
| Find three of said types of places and run kubernetes and
| you're good, no?
| iforgotpassword wrote:
| Get a second redundant power line, battery backup for a couple
| days, multiple independent internet connections, ....?
| endisneigh wrote:
| is it even feasible to have a redundant power in a regular
| home? the rest is easily doable, though.
| notakio wrote:
| Yep. Most electric companies will be more than delighted to
| run a second line to your home, as they then get to collect
| those sweet installation costs from you. So if you're
| willing to pay, they're probably more than happy to let
| you.
| endisneigh wrote:
| I don't see how that would be _redundant_ though, wouldn
| 't it be just as likely to fail for the same reason the
| other line does?
___________________________________________________________________
(page generated 2022-12-20 23:02 UTC)