Quick LinksBenefits of using a laptop as a server Potential problems with a laptop server Choosing an operating system How to set up your laptop as a home server
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 replace laptops on a cycle of necessity, not simply because there's a new model out or our SIM contract is up. We tend to let our laptops live out their long lives, and often they're battered and bruised from years in a backpack or on the go with us, leaving you less inclined to pass a retired device down to a relative or friend.
But there are some great uses for an old, battered laptop, and one fantastic use is as a simple, low-powered home server.
Benefits of using a laptop as a server Power efficiency is king for home servers
One of the biggest considerations for any device that will be used as a home server is power efficiency, often referred to as 'performance-per-watt.' 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. On the other hand, 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, or even a new set of desktop DDR4/5.
The same applies to storage. Most laptops support only a single drive, so no easy redundant array of independent disks (RAID) here. But 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.
Source: Amazon Most laptops are quiet
This one supports an argument against buying old server hardware on the cheap: it's often annoyingly loud. If you've ever been around enterprise-grade servers or network hardware, one thing you can't miss is the 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 (if not silently) 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, especially if you're running a fairly light load.
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-server anywhere it might collect excessive dirt or dust, get easily bumped, or have insufficient airflow to keep it cool.
One of the biggest benefits of using a laptop as a home server is its small footprint.
No need for Ethernet
Ethernet is king. But, when it comes to most of our uses for home servers, you're not likely 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, as 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 generally 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, especially if you don't monitor it.
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 is heat dissipation. You can run your laptop 24/7 with the lid closed, but most laptops aren't really designed to run like this. You'll want to keep a close eye on temperatures to get started with, and make sure you don't leave your laptop for an extended period during your initial testing. If you're only using it as a server, a common hack is to remove the screen from your laptop. You'll be reliant on an external display, but it's a decent (if difficult to reverse) way to slim down a bulkier laptop and improve its cooling at the same time.
If you're only using it as a server, a common hack is to remove the screen from your laptop
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.
Related 5 reasons you should use ZFS for your NAS
Having trouble finding the ideal file system for your storage server? Here are five reasons why you should check out ZFS
1 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 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
In order 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.
To check your existing IP address, type the following in a terminal: 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. 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: sudo ls /etc/netplan/ Then run this command to open the file: sudo nano /etc/netplan/50-cloud-init.yaml You should see your connected network interface. 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. 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). Save the file. Reload your network configuration by running: 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.
Related 6 reasons you should use Ubuntu for your own NAS
Build a DIY NAS with the most popular Linux distro.
2 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.
Open /etc/systemd/logind.conf in a text editor of your choice. Again, we're using Nano. sudo nano /etc/systemd/logind.conf Edit the following lines, removing the comment (#) at the start of each line, and change the value after the = sign. HandleSwitchLock=ignoreHandleSwitchLidExternalPower=ignore This setting modifies how Ubuntu's init-system systemd handles the lid closing. The default value is suspend. Reboot your laptop, either by pressing the power button or by typing the following in the terminal: 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.
Install lm-sensors with apt:sudo apt-get install lm-sensors 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.sudo sensors-detect Once your sensors are detected, you can check their values with: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 in an acceptable range.
Breathe new 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 achieve sufficient data redundancy in the case of 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 own services at home, and they shouldn't require any significant expense to get started.