Author Topic: How to turn your old laptop into a great home server  (Read 50 times)

Offline javajolt

  • Administrator
  • Hero Member
  • *****
  • Posts: 35211
  • Gender: Male
  • I Do Windows
    • windows10newsinfo.com
How to turn your old laptop into a great home server
« on: February 15, 2024, 01:02:41 PM »


Whether you're a full-time tech-hoarder like me or just thinking about upgrading an aging device, it can be difficult to find a good use for an old laptop. It doesn't make much sense to keep a spare one at home, and most of us buy and replace laptops on a cycle of necessity, not simply because there's a new model out or our SIM contract is up. It's also not always easy to upgrade laptops. And depending on the model and age, they suffer wear and tear easily, which makes them more difficult to donate or pass on to a relative.

One great use of an aging laptop is as a simple, low-power home server.

Benefits of using a laptop as a server

Power efficiency is king for home servers

One big consideration for any device that will be used as a home server is power efficiency. This is often the problem with picking up used server hardware on the cheap (and they can be very cheap) — the power requirements for an aging machine can be ridiculous. This might be less of a concern if you're based somewhere with cheaply available wall power, but in Europe, particularly, this can be a serious consideration. Laptops are designed to run on batteries to start with, and they often feature low-power versions of chips designed with this in mind.

Upgrades are often cheap

It's often relatively inexpensive to upgrade the memory of your aging laptop. There are obvious caveats to this — most laptops won't support more than 32GBs, but for a simple home machine, this is probably plenty.

For example, a single-DIMM 32GB memory upgrade for my old XPS 15 will run about $100. While not exactly cheap, this is far cheaper than buying a new machine, and it isn't too far from the price you would pay to install that amount of memory in a dedicated home server.

The same applies to storage. Most laptops support only a single drive, so no easy redundant array of independent disks (RAID) here. However the capacity of single-drive SSDs has gone up significantly in the last few years. It's now easy to get a SATA or M.2 SSD with capacities in the 4TB or 8TB range. Although the latter might be pricey, 4TB SATA drives are available on Amazon now for under $250.

Most laptops are quiet

This one is more in line with the argument against buying old server hardware on the cheap: it's often annoyingly loud. If you've ever been around enterprise-level great servers or network hardware, one thing you can't miss is their noise. It's similar to being in the same space as a high-powered vacuum cleaner, albeit at a slightly higher pitch.

Laptops are designed to run quietly out the box. Not all laptops are quiet — I definitely wouldn't use my 2018 MacBook Pro as a home server — but with some tweaking of power-settings, most can be configured to run quietly enough that they won't be audible in a side cupboard or some other out-of-the-way spot in your home.

Small footprint

One of the biggest benefits of using a laptop as a home server is its small footprint. Laptops can be easily slipped into a cupboard, a TV unit, or on a shelf somewhere. You'll want to avoid storing your laptop-cum-server anywhere it might collect excessive dirt or dust, get easily bumped, or have insufficient airflow to keep it cool.

No need for Ethernet

Ethernet is king. But, when it comes to most of our uses for home servers, you're unlikely to be maxing out Wi-Fi. Whether you're able to hook a home server to Ethernet will depend on your own unique circumstances. But one of the great benefits of using an old laptop is that they've got Wi-Fi built in, so the option is there. This also gives you more flexibility in where you store your home server: with Wi-Fi access, anywhere with a power outlet will do.

Built in UPS?

This one's a little more audacious. In theory, laptops come with a great free universal power supply (UPS). Practically speaking, though, leaving your laptop plugged in and running constantly is likely to significantly degrade the battery. Some people suggest removing the battery entirely when the laptop is on AC power for an extended period, but this depends on your laptop model and whether your battery is charged and cycled properly when on AC power for an extended period.

Leaving the battery in can generate excessive heat on some laptops. On the other hand, some laptops may also perform significantly worse when the battery is removed. Our advice is to leave the battery in. If you experience significant heat dissipation issues, test this factor with the battery removed.

You should also be aware that leaving the battery in your laptop presents an increased fire risk.

Potential problems with a laptop server

Err on the side of caution when it comes to heat dissipation


Source: Unsplash

One big issue with using a laptop as a home server concerns heat dissipation. We'll be showing you how to set up your laptop to run 24/7 with the lid closed, but most laptops aren't designed to run like this. You'll want to keep a close eye on temperatures to get started and make sure you don't leave your laptop for an extended period during your initial testing.

Limited potential for storage upgrades

One of the big problems with using your laptop as a home server is the limited potential for storage upgrades on offer. Most laptops support only one internal drive, and while you can hook up external disks, this will quickly become cumbersome. The single internal drive also means you'll be unable to use RAID to stripe your disks and gain additional protection for your data.

For this reason, we wouldn't recommend using a laptop as a home NAS or media server for important documents, pictures, and media.

Choosing an operating system

Windows isn't great for server use cases, but there are options


Source: Unsplash

Your operating system makes a big difference when running your home server. We'll be using Ubuntu Desktop, but if you feel more comfortable using the terminal to manage your server day-to-day, you can use Ubuntu Server (we've previously covered some of the differences and use cases for each).

You can use Windows for your home server, but we wouldn't recommend it. It can be more difficult to configure for many common use cases, and this approach is heavier on performance.

If you are using Ubuntu Desktop, one great option instead of Secure Shell (SSH) is to set up virtual network computing (VNC). We've already got a great guide on setting up remote access on Ubuntu. Similarly, if you're using Windows you can set up Remote Desktop to access your server.

How to set up your laptop as a home server

Install some simple tools to get started



Next, we'll show you how to set up the bare bones of a great headless home server running Ubuntu. We'll be using Ubuntu Server, but you may also want to use Ubuntu Desktop, depending on the applications and tools you're planning on running.

We recommend that you make any required upgrades to your laptop in advance; it'll only be harder to set up your machine and make hardware changes later. We've already got great guides on how to install Ubuntu Desktop, and Ubuntu Server is largely the same process (minus a few steps, even.) You can download an Ubuntu Server ISO from Ubuntu's website. We'd recommend installing the full version, not the minimized version, as it contains some tools we'll need later.

Once the Ubuntu Server is installed, we'll be making a few changes. First, we'll connect to a network. If you've already done this in the installer, you can skip this step. After Ubuntu is installed, we'll make a few small changes.

Set up SSH access on Ubuntu

To access your Ubuntu instance headlessly (that is, without a monitor attached), you'll want to set up SSH. Before doing this, make sure your laptop has a static IP address.

1. To check your existing IP address, type the following in a terminal:

Code: [Select]
ip addr
Locate your network interface (prefixed with either enp for Ethernet or wla for Wi-Fi) and look for an inet ipv4 address below that.



2. Once you've found your network interface and address, open /etc/netplan/01-netcfg.yaml in a text editor. Sometimes this file is called 50-cloud-init.yaml. We're using Nano here again. To check, run the following:

Code: [Select]
sudo ls /etc/netplan/
Then run this command to open the file:

Code: [Select]
sudo nano /etc/netplan/50-cloud-init.yaml
You should see your connected network interface.



3. Modify the file to disable Dynamic Host Configuration Protocol (DHCP). DHCP is responsible for automatically assigning IP addresses on your home network. Set dhcp4 to false.



4. You'll then need to add a network configuration. We'll be using the same IP address assigned by DHCP but setting it as a static IP. This ensures that it persists over time and between reboots. Add the following block to your file, replacing the placeholder value with the IP address you saw in Step 1. You can find your Gateway IP by replacing the final block of your IP address (for example, replace 192.168.1.155 with 0, thus giving you 192.168.1.1).



5. Save the file

6. Reload your network configuration by running:

Code: [Select]
sudo netplan apply
Once you've configured a static IP, you can set up SSH. We've already got a great guide on configuring SSH for Ubuntu.

Disable sleep when the lid is shut

By default, the Ubuntu Desktop will sleep when the lid of your laptop is shut. You can change this behavior with some small tweaks to the power settings.

1. Open /etc/systemd/logind.conf in a text editor of your choice. Again, we're using Nano.

Code: [Select]
sudo nano /etc/systemd/logind.conf
2. Edit the following lines, removing the comment (#) at the start of each line, and change the value after the = sign.

Code: [Select]
HandleSwitchLock=ignoreHandleSwitchLidExternalPower=ignore
This setting modifies how Ubuntu's init-system systemd handles the lid closing. The default value is suspend.



3. Reboot your laptop, either by pressing the power button or by typing the following in the terminal:

Code: [Select]
sudo reboot
Monitor your laptop's temperatures

Now that you've got your laptop set up with remote access over SSH, you're free to close the lid and hide it in a corner somewhere. We've mentioned that temperatures can be problematic when running a laptop with the lid closed for a long period, so we'll show you how to monitor your temperatures on an ongoing basis by using lm-sensors.

1. Install lm-sensors with apt:

Code: [Select]
sudo apt-get install lm-sensors
2. Detect your device's sensors. This will ask you a series of YES/NO questions. We'd recommend answering YES to the first question, and NO to the rest.

Code: [Select]
sudo sensors-detect
3. Once your sensors are detected, you can check their values with:

Code: [Select]
sensors
We'd recommend setting up a few services on your new home server and carefully monitoring the temps once it's placed in position. If you're going to be running any burst-driven high-intensity workloads (like video encoding), consider running an artificial benchmark for a short period and then checking if your temperatures remain an acceptable range.

Breathe life into your old hardware

We've walked through some of the ways your old laptop could make a great home server. Particularly if you're in a small apartment, there are some real benefits to using a Wi-Fi enabled, quiet, and compact bit of hardware to run your basic home services. Just be sure to regularly dust your laptop (ideally with compressed air), and keep an eye on its temperature when the lid is shut.

As mentioned earlier, we don't recommend using a laptop server as a NAS, as it's not easy to set up or achieve sufficient data redundancy in the case of a drive failure. The heat of a closed laptop might also make your hardware more prone to failures — particularly SSDs. But for other purposes, laptops are a great starting point for running your services at home, and they shouldn't require any significant expense to get started.

source