An old laptop that is no longer used can still work. Turn it into a home server. A server is a computer that serves other devices. The laptop stores files, runs a website, or plays movies for phones and other laptops at home.
A home server does not need high specs. An old laptop is the best machine for learning. This tutorial completes a file server (Samba) as the working example. Other services are covered briefly so you can choose.
What kind of laptop works
Almost any laptop can become a server. The requirements are light:
- 4 GB of RAM is enough for a file server, a simple web server, and Pi-hole. A media server and Home Assistant also run on 4 GB. Add RAM if you want to run many services at once.
- An SSD lasts longer and uses less power than a hard drive (HDD). An old HDD still works, but check its health first. The command
sudo smartctl -a /dev/sdashows the disk condition (install it first withsudo apt install smartmontools). - A LAN cable is more stable than WiFi. Plug an Ethernet cable into the router if you can. WiFi works, but the connection can drop and the speed is lower.
- Any processor works. An old Intel or AMD is still enough for home services. A home server rarely needs a fast processor.
No SSD? Use the HDD first, it is fine. Upgrade later once you are sure.
Important warnings: read this before you start
Beginners often ignore these four things. Ignore them, and the server can break or the power bill can grow.
1. Power runs 24 hours a day. A laptop left on uses about 15–30 watts. Over a month, the bill rises by tens of thousands of rupiah. Turn off services you do not use if you want to save power.
2. Dust and heat. Old laptops are full of dust. Clean the fan and vents before running it 24 hours a day. A hot laptop can shut itself down. Do not put it in a closed place like inside a cupboard.
3. A swollen battery is dangerous. Check the battery before leaving the laptop plugged in all the time. If the battery is swollen, remove it and dispose of it properly. Plug the laptop straight into power without a battery. Never use a swollen battery.
4. Do not open ports to the internet carelessly. A port is an entry point to the server from outside. Opening a port without understanding the risk is like leaving your front door open. Strangers can try to get in. If you want to reach the server from outside your home, use Cloudflare Tunnel or Tailscale. Neither needs an open port. The Cloudflare Tunnel tutorial is already on this blog: Access Local AI from Your Phone via Cloudflare Tunnel.
Choose a service: what is the server for
One laptop can run many services. Start with one. These are the most common choices:
- File server (Samba): stores files in one place. Phones and other laptops can open those files over home WiFi. This is the example completed in this tutorial.
- Web server (Apache/Nginx): hosts your own website. This blog can run from an old laptop. The Apache tutorial is here: Install Apache, MySQL, PHP, and phpMyAdmin on Arch Linux.
- Media server (Jellyfin): plays movies and music from the laptop to a phone or TV. Free and open source.
- Pi-hole: blocks ads for every device at home. Install it once, and every phone and laptop is ad-free.
- Home Assistant: controls smart home devices (lights, plugs, sensors).
- Learn Docker and Linux: a home server is the best place to practice. If it breaks, it does not matter — reinstall and try again.
Step 1: prepare the laptop
- Clean dust from the fan and vents. Use a small brush or compressed air.
- Check the battery. If it is swollen, remove it. Plug the charger in directly.
- Plug the LAN cable into the router. Plug the charger into power.
- Turn the laptop on and make sure it can still boot into its old operating system. If it cannot, go straight to step 2.
Step 2: install a lightweight Linux
A server does not need a heavy graphical interface. Pick one:
- Debian or Ubuntu Server: easiest for beginners. Stable and well documented. Download the ISO from the official site, then make a bootable USB.
- Arch Linux: if you are already comfortable with Arch. The install tutorial is here: How to Install Arch Linux from Scratch. Choose a minimal install, without a desktop environment.
Need a bootable USB? Follow the tutorial How to Make a Bootable Ventoy USB. If your laptop is very old, pick a lightweight distro first. See the tutorial Lightweight Linux Recommendations for Old Laptops.
Warning: reinstalling wipes everything on the laptop. Back up important files first. Back up means copying important files somewhere else before installing.
Step 3: basic setup after install
Log in to the server laptop, then update the system. On Debian/Ubuntu:
sudo apt update
sudo apt upgrade -y
On Arch:
sudo pacman -Syu
Check the server laptop’s IP address. An IP is the laptop’s address on the home network. Other devices use this address to connect.
hostname -I
The result looks like 192.168.1.10. Write this number down. The IP can change when the router restarts. To keep it fixed, set a static IP in the router settings (look for the DHCP reservation menu). This step is optional, but recommended.
Optional: install SSH so the laptop can be controlled from another device without a monitor. On Debian/Ubuntu:
sudo apt install openssh-server
On Arch:
sudo pacman -S openssh
sudo systemctl enable --now sshd
Step 4: install Samba and create a shared folder
Samba is a file server service. Samba lets a folder on the laptop be opened by other devices (Windows, Android, macOS, Linux). Install Samba. On Debian/Ubuntu:
sudo apt install samba
On Arch:
sudo pacman -S samba
Create the folder you want to share:
mkdir -p ~/berbagi
Open the Samba config file with a text editor:
sudo nano /etc/samba/smb.conf
Add this block at the very bottom of the file:
[Berbagi]
path = /home/briyan/berbagi
browseable = yes
writable = yes
valid users = briyan
Replace briyan with your username on the laptop. The path line must match the folder you just created. Save with Ctrl+O, press Enter, then exit with Ctrl+X.
Check whether the config is correct with this command:
testparm -s
If there is no error, continue. If there is an error, check the spelling in the block above. One wrong letter can stop Samba from running.
Create a Samba password for that user:
sudo smbpasswd -a briyan
Type the new password twice. Other devices use this password when opening the shared folder.
Start the Samba service. On Debian/Ubuntu, the service is called smbd:
sudo systemctl enable --now smbd
On Arch, the service is called smb:
sudo systemctl enable --now smb
Check its status (Debian/Ubuntu):
sudo systemctl status smbd
The words active (running) mean Samba is running.
Step 5: test from a phone or another laptop
Open the shared folder from another device on the same WiFi network.
- Windows: open File Explorer, type
\192.168.1.10\Berbagiin the address bar. Replace the IP with your server laptop’s IP. - Android: open a file manager app. Look for the network storage or LAN menu. Add a server with the laptop’s IP, then enter the Samba username and password.
- macOS: open Finder, click the Go menu, then Connect to Server. Type
smb://192.168.1.10/Berbagi. - Another Linux: open the file manager, type
smb://192.168.1.10/Berbagiin the address bar.
Enter the Samba username and password when asked. If the folder opens, the file server works. Try copying one file into the folder from your phone. Then check on the server laptop: the file must be in ~/berbagi.
If it cannot connect, check three things: whether the server laptop’s IP is still the same or changed; whether Samba is still running (sudo systemctl status smbd); whether the firewall blocks port 445. On Debian/Ubuntu, check the firewall with sudo ufw status. If it is active, allow Samba with sudo ufw allow samba.
Security: do not expose the server to the internet
This file server is only for the home network. Do not open port 445 to the internet. That port is often attacked. Once attacked, files on the server can be stolen or deleted.
Want access from outside your home? Use one of these safe ways:
- Cloudflare Tunnel: the server laptop connects out to Cloudflare. No port is opened. Tutorial: Access Local AI from Your Phone via Cloudflare Tunnel.
- Tailscale: creates a private network (VPN) between your devices. Install it on the server laptop and on your phone. Both connect as if on one home network.
Never share the Samba password with anyone else. One user, one password.
Full real example: from a dead laptop to a file server
Scenario: an 8-year-old laptop, 4 GB RAM, 500 GB HDD, WiFi that keeps dropping. Goal: a file server a phone can reach.
- Clean the dust. The battery was swollen, so it was removed. The charger is plugged in directly.
- Plug the LAN cable into the router. Install Ubuntu Server from a Ventoy USB. Everything on the laptop was wiped (backed up first).
- After install, run
sudo apt update && sudo apt upgrade -y. Check the IP:hostname -Igives192.168.1.10. - Install Samba:
sudo apt install samba. Create the folder~/berbagi. - Add the
[Berbagi]block to/etc/samba/smb.conf. Runtestparm -s, no errors. - Create the password:
sudo smbpasswd -a briyan. Start the service:sudo systemctl enable –now smbd. - From the phone, open the file manager, add network storage with IP
192.168.1.10. The Berbagi folder opens. One photo is copied from the phone to the server, and it appears in~/berbagi.
Total time: about one hour, including installing the operating system. A laptop that was dead now stores files for every device at home.
Common mistakes
- The laptop IP changes after the router restarts, and other devices cannot connect. Set a static IP in the router.
- The username in the Samba config is different from the username on the laptop. Both must match.
- Forgetting to run
smbpasswd, so other devices are rejected at login. - The
pathfolder in the config does not exist. Create it first withmkdir -p. - Opening a port to the internet without understanding the risk. Do not do it.
If you get stuck, ask Muse (yue) to explain the line that failed. Paste the error message from the terminal so the explanation is precise.
Comments