I did this for years.
Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
hardware is fine. If you're not experienced the 3000km will fuck you though. Stuff will arise where you will need to get at it.
I've been using two laptops als "servers" for years.
well, the first one died after about 6 years of use.
But I can get at them reasonably.
At a later stage I will have to design a strategy to access and make sure is OK. Probably I am going to stick to tail scale and make sure no matter what both tailscale and ssh always start. Sure there can be issues but if minimal services can be guaranteed then it should mostly ok
The battery turning into a Spicy pillow is always a Concern for using laptop as an always powered on server. So even though you will be away from it, make sure that there is a way for someone to keep an eye on it, once every week or two.
That said, I have been using a dell laptop as a desk workstation (and remote use) with an uptime of 2.5 years at this point.
This is a good point actually. I will need to check the laptop can run without battery at all (back in the day I remember this was possible, nowadays I am not sure)
Depending on the laptop (or with any laptop + smart plug) you can set charging thresholds, both for starting and stopping the charge (lower and upper limits), this way it will do a few cycles instead of staying fixed to a certain level of charge.
In order the worst things we can do to batteries are: leave them at 0% for years, leave them at 100% for years, leave them halfway for years (what happens when left plugged in with only an upper charge limit like 80%) - batteries need to do a few partial cycles at least, once in a while.
LiPo batteries should be stored at 3.7V/cell. That's basically ~50% capacity (fully charged is ~4.2V/cell). I have several LiPo cells for my RC stuff, some nearing 10 years old, that are still perfectly usable because of this storage method.
I have an old HP Omen laptop that I use as a sever, removed the battery because it started getting a bit spicy but other than that it runs just fine for multiple years now.
I use mine as an application server without much storage since it only has space for one nvme ssd and one 2.5" SATA drive.
If you are that far away make sure you have someone with basic Linux knowledge around there to restart it if necessary. And it sucks in LOTS of dust, so be prepared to clean it about once per year
My plan is to go there at least once a year, so that would work for me
It'll probably work. Biggest issue will be recovery after power failure as laptops generally stay off.
Next most likely is CPU fan failure, exacerbated if CPU usage causes the fans to run high and nobody is there to blow the dust out.
Other than that I've had multiple laptops that run as servers over the years and generally they're fine. Streaming audio for our community radio station, or shoved behind wall mounted TV's for updateable PowerPoint displays.
Yeah, what they said.
OP, invest in a UPS - cheap or less cheap - you can get them as big as your bank account, and they're worth it. I tend to like Cyberpower for price, because they're common enough that I've never found a model that nuts didn't already know about, and they tend to have replaceable batteries. As parent said, the nightmare is if power goes out, and even though the laptop has a battery, you're buying yourself extra time. Plus extra surge protection and all that.
I'm not probably saying anything you don't already know, OP, but I feel there's a general under-valuing of UPSes when I hear about people's set-ups. They may mention a surge protector, but rarely do I see folks taking about their UPSes.
I actually have contingencies for this. There is a ups around that I can use. It is good advice for sure, specifically for countries with fluctuations on the electric grid
It would be nice if there was firmware available for the charge controller that turned the laptop's own battery into a UPS, avoiding the whole "spicy pillow" debacle.
One can dream...
A smart switch that turns off the power when the battery hits 80% and turns it on at 78%? Dunno if that would actually work.
I've got an old HP laptop which I've been running a Jenkins server on for years. The fan died back in like 2018, and I just kept putting off buying a replacement, so it has been running with no fan for 7 years now. Remarkably it still works fine, although a but slower than it used to thanks to thermal throttling :P
I am planning after installing Ubuntu server and get some setup done, to actually sit it out and understand how much the fan is going and how I expect this to be an issue. Since my backups are probably going to be once in a week or so, I do not expect the laptop to have a lot of work (for now is just for file backup, no other services in there except tailscale)
It's a laptop... One of the benefits is that it already has a battery, no?
If the laptop has a way to limit charging to, say, 70% in order to not turn into a spicy pillow, it would be viable. I have an older HP Elitebook 8440p laptop running as a server of sorts in my cluster, but the battery is no longer capable of holding a charge at all because it's always plugged in. I might get a Thinkpad to replace it as there are modifications for those to limit the battery charge level.
If the laptop has a way to limit charging to, say, 70% in order to not turn into a spicy pillow, it would be viable.
Firstly - I love the phrase "spicy pillow".
Secondly - It would probably depend on the laptop and its battery health. But also the OS can limit charging I believe? I haven't looked too far into how it works but I've got my laptop setup to only charge to 90% because I'm nearly always plugged in. I don't know if that relies on any hardware/firmware options though.
tlp
has more features available for Thinkpads, specifically, so there's that. I'm thinking more of a laptop form factor but built as a portable server, with the battery specifically designed to be a secondary power source (like a UPS) instead of the primary power source.
Of course something like that would be incredibly niche, so it makes sense that it's not really a thing.
Yeah I figure it's the sort of thing that requires some firmware support at least.
One thing I've always liked about using laptops as servers more than the battery has been the built-in display and keyboard. 😁
That is true, however there are 2 things
- battery of this machine is toast (holds up for half an hour or less)
- as someone mentioned in another comment: unattended laptops with batteries can be actually bad. Batteries on certain cases can leak and cause fires, so for me, if it can work without it great, otherwise I have to drop the idea
battery of this machine is toast (holds up for half an hour or less)
Fair.
as someone mentioned in another comment: unattended laptops with batteries can be actually bad. Batteries on certain cases can leak and cause fires, so for me, if it can work without it great, otherwise I have to drop the idea
I'm not clear on how a UPS would be different in this regard. They both have high-capacity batteries that need monitoring. Unless the UPS is using a different chemistry?
Laptops use lithium-ion batteries and (at least your Average Joe's and majority of commercial units too) UPS uses sealed Lead Acid. If lithium ion battery goes belly up it'll burn your house down. If lead acid battery does the same, at worst, it'll leak a bit of corrodive fluids to whatever it's on top of.
There's commercial size li-ion UPS's too, but they require quite a lot of hardware around them to be used safely. Search from youtube (or whatever you like) a cell phone battery explosion and then scale that up to a fridge-sized cell-phone. It's quite a bit of steel and concrete to contain that amount of energy. And the funny thing about li-ion fires is that lithium ions reacts quite violently with water and the battery contains all the chemicals to keep the fire going, oxygen included.
So, yeah, UPS is a whole another thing to manage than a laptop battery.
Ahh, okay - it is a different chemistry. I wasn't sure - thanks!
From my experience in the past, ups are done to be constantly on, and as far as I know, usually they have failsafe mechanism in case something is not working as intended. Laptop batteries do not have such extensive protection from what I know. However, if an ups is getting old (around 5 years or so) is probably best to change the batteries (if the model allows it)
If you can't access the hardware physically and you don't have someone on site who can work on it, just drop the idea and get a VPS or whatever cloud based. No matter what hardware you plan to use. Anything and everything can happen. Broken memory module, odd power surge, rodents or bugs messing up with the system, moisture or straight up water leak corroding something, fan failure overheating the thing and so on.
There's only one single fact on the business that I've learned over 20something years I've been working with IT: All hardware fails. No exceptions. The only question is 'when'. And when the time comes you need someone to have physical access to the stuff.
I mean, sure, your laptop might run just fine for several years without problems or it might have shipping damage over that 3000km and it'll break in a week. In either case, unless you have someone hands on the machine, it's not going to do much.
I’ll leave this for others to chime in. But you may find useful information in one of the homelab communities as well.
Thanks for the pointer. Indeed I should probably see first the homelab communities as well
Just make sure any power saving features are disabled. That is, if the 3000km journey to wiggle the mouse is not on your bucket list.
For sure not :D. I will be installing something such as ubuntu server, so I do not expect this issue (I don't remember if the laptop has power saving via bios, but need to check)
I have actually had headless servers I've ran on a laptop decide to go to sleep with the lid, its an ACPI mode that even framebuffer can decide to respect. IIRC it's not hard to ensure it's disabled somewhere in /proc.
Interested in the answer too! Of course, you could get the same result from a 5-buck VPS with zero maintenance and rock-solid reliability (my solution). But sure, 5 bucks is 5 bucks. And also, encryption is optional if it's your own device.
You are not wrong with the vps. Although I am quite worried that my data stays with me no matter what. Not that I have state secrets or anything, but my stuff is my stuff. And to avoid issues with encryption and such, your own device most of the times is king
Absolutely fair.
Buy a KVM that you can wire to the power button if you can. Pikvm, nanokvm, Jetkvm, etc. Will save you when the device needs a reboot or a bios tweak.
I did this with a regular rpi, one of it's io pins and a single npn transistor a while back.
Multimeter to check which power button pin on the mobo is + vs -. - to the rpi gnd, + to the transistor collector, gate to the io pin, drain to rpi gnd.
Whenever the io pin goes high (positive), the transistor shorts the mobo pins 'pressing' the power button.
Script pings the servers ip to check if its not responding; then pulls the pin high for 6 sec to ensure the mobo is fully off, then low for 2 sec, high for 2 sec, then low again.
This was for a system that kept locking up while I was away, so I needed a way to remotely hard-restart it.
If you’re 3 thousand kilometers away from it I’d make it into a headless machine by unplugging the internal display and getting a kvm for it. Or just make sure you have contact with someone who can type in commands for you when anything goes really sideways