Your Old Phone Can Be a NAS File Server
You probably have an old Android phone in a drawer. I do. It is a Xiaomi Redmi 2 from 2015 with 2 GB of RAM. Instead of recycling it, I turned it into a low-power Samba file server.
Samba is a free program that makes a Linux folder look like a shared drive. In plain terms, it turns an old phone into a NAS that Windows, macOS, and Linux clients can use.
The real results surprised me. Uploading a file reached about 3.3 MB/s, CPU use stayed around 2%, and the Samba daemon idled at about 10 MB of RAM. This article shows the exact setup, including two problems I hit on postmarketOS that were not obvious.
If you have not installed postmarketOS yet, start with the old phone download server guide, which is the first article in this series.
What You Need
- An old Android phone running postmarketOS. I used a Xiaomi Redmi 2 (2014813, 2 GB RAM), postmarketOS v25.12, kernel 6.12.1-msm8916, on Wi-Fi.
- A client computer: Windows, macOS, or Linux.
- Both devices on the same home network.
- About 30 minutes.
Throughout this guide, user is a placeholder for your actual Linux username on the phone. Replace every user with the username you created when you installed postmarketOS.
Install Samba
Open a terminal on the phone and run:
# Install the Samba server and the smbclient test tool
sudo apk add samba samba-client
The samba package is a meta package. It pulls in smbd, nmbd, and smbclient version 4.22.10.
After the install, check the version like this:
# Check the Samba server version
smbd --version
The output is:
Version 4.22.10
Do not run samba --version. That command will fail with samba: not found, because there is no binary named samba in your PATH. The actual server binary is smbd.
SMB1 is disabled by default on this build. That is good. Modern Windows, macOS, and Linux clients use SMB2 or SMB3, which are safer.
Write a Minimal Config
The package installs a default config at /etc/samba/smb.conf. It is 8,410 bytes and full of options you do not need for a home share. I replaced it with a five-line config.
Back up the original first:
# Keep a copy of the original config
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup
Now edit the file. postmarketOS does not ship nano, so install it first (or use vi if you prefer):
# nano is not pre-installed on postmarketOS
sudo apk add nano
# Open the config file with nano
sudo nano /etc/samba/smb.conf
Delete the old content and paste this minimal config:
[global]
workgroup = WORKGROUP
[shared]
path = /home/user/Shared
valid users = user
read only = no
This creates a share named shared, points it at /home/user/Shared, allows only user to log in, and makes the share writable. Replace user with your real username.
Before the share can work, create the folder:
# Create the folder that the share will point to
sudo mkdir -p /home/user/Shared
Do not start Samba yet. You still need a Samba user, firewall rules, and a service unit.
Create a Samba User
Samba has its own password database. The Linux user user must already exist on the phone. If you log into postmarketOS as user, that condition is already met.
Create the Samba password:
# Add a Samba password for the existing Linux user
sudo smbpasswd -a user
You will be asked to type the password twice. Nothing appears on screen while you type, but the input is being recorded.
This password is the one Windows, macOS, and Linux clients will ask for when they connect.
The Firewall Is Blocking You
postmarketOS ships with an nftables firewall. The default policy is drop, and only SSH, DNS, and DHCP are allowed through. SMB uses TCP ports 139 and 445, so the firewall blocks them until you add a rule.
Create a new rule file:
# Create a dedicated firewall file for Samba
sudo nano /etc/nftables.d/50_samba.nft
Paste this content:
table inet filter {
chain input {
iifname "wlan*" tcp dport {139,445} accept comment "accept SMB on wlan"
}
}
This rule accepts TCP traffic on ports 139 and 445 when it arrives on a Wi-Fi interface. If your phone uses USB Ethernet instead of Wi-Fi, change wlan* to eth*.
Before applying the rule, test it:
# Check the rule file for syntax errors
sudo nft -c -f /etc/nftables.d/50_samba.nft
If the command prints no errors, reload the firewall:
# Apply the firewall rule
sudo systemctl restart nftables
You can confirm the rule is active with:
# Look for the new SMB rule in the input chain
sudo nft list ruleset
The Missing Service Unit
Here is the first trap I hit. On postmarketOS, the samba package does not install a systemd service unit. There is nothing in /usr/lib/systemd/system/ or /etc/init.d/. If you try to start it with systemctl start smbd, you get Unit smbd.service not found.
You need to write the unit file yourself. Create it with:
# Create a systemd service for smbd
sudo nano /etc/systemd/system/smbd.service
Paste this:
[Unit]
Description=Samba SMB Daemon
After=network.target
[Service]
Type=simple
ExecStart=/usr/sbin/smbd -F --no-process-group
Restart=on-failure
[Install]
WantedBy=multi-user.target
The important option is --no-process-group. I tried a unit without it first. The journal showed exit_daemon: daemon failed to start: Failed to create session, and Restart=on-failure restarted the service five times before giving up. The daemon kept crashing in a loop.
Now enable and start the service:
# Reload systemd so it sees the new unit
sudo systemctl daemon-reload
# Start smbd now and enable it at boot
sudo systemctl enable --now smbd
Check the status:
# Make sure smbd is running without errors
systemctl status smbd
You want to see active (running) in the output.
The Permission Trap
This is the second trap. Earlier I created the shared folder with sudo mkdir, so the folder belonged to root. Samba could read from it, but when I tried to write a file, the client returned NT_STATUS_ACCESS_DENIED.
The fix is to give ownership of the folder to the normal user:
# Make user the owner of the shared folder
sudo chown user:user /home/user/Shared
Replace user with your actual username. Then restart Samba to be sure it picks up the folder state:
# Restart the Samba service
sudo systemctl restart smbd
Confirm the ownership:
# Check that user owns the folder
ls -ld /home/user/Shared
The output should show user user in the owner and group columns.
Connect from Windows, macOS, and Linux
Always use the phone's IP address, not a hostname, on a local network. To find the phone's IP, run:
# Show the phone's IP address
ip addr show
Look for the wlan0 interface and read the inet line. I will use 192.168.1.50 as an example IP. Replace it with your phone's real address.
Linux client
Use smbclient, which came with samba-client on the phone but can also be installed on any Linux PC:
# Connect to the phone's shared folder
smbclient //192.168.1.50/shared -U user
Enter the Samba password when asked. Inside the prompt, you can list, upload, and download files:
smb: \> ls
smb: \> put testfile.txt
smb: \> get testfile.txt
smb: \> exit
Windows client
Open File Explorer. In the address bar, type:
\\192.168.1.50\shared
Press Enter. Windows asks for a username and password. Use user and the Samba password you set with smbpasswd.
macOS client
Open Finder. Press Command+K. Type:
smb://192.168.1.50/shared
Click Connect and enter the same Samba credentials.
Real Numbers from a Real Phone
I tested this setup on a Xiaomi Redmi 2 connected over Wi-Fi, with the phone also running a graphical desktop, nginx, Transmission, cron, and Samba at the same time.
The table shows what I measured on a Linux client on the same network.
| Metric | Result |
|---|---|
| Upload 50 MB file | 3297.7 kb/s (~3.2 MB/s), 15.8 s |
| Upload 100 MB file | 3282.9 / 3070.7 kb/s |
| Download speed | 2197.7 KB/s (~2.1 MB/s) |
| CPU during transfer | smbd ~2%, system 87% idle |
| Memory idle | systemd accounting 9.5 MB |
| Memory peak after large transfer | 169.5 MB (page cache, drops back to 9.5 MB) |
| smbd process RSS | ~40 MB across three processes |
| Full phone memory | 1.9 GB total, 1.2 GB available |
| MD5 checksum | identical before and after transfer |
The memory spike to 169.5 MB looks scary, but it is just Linux page cache. The system uses the extra RAM to speed up file transfers, then frees it when something else needs it. The smbd daemon itself returns to the idle value of about 10 MB.
The MD5 checksum matched after the transfer, which means the files arrived without corruption.
For an old phone as a NAS, these numbers are workable. It is not a 4K streaming box, but it is a fine backup target for documents, photos, music, and small files. I also run Transmission on the same phone; you can see that project in the old phone torrent server guide.
FAQ
Is it legal / safe to run a home file server?
Yes. You are using your own device on your own network. It is safe if you keep SMB on your local LAN, use a password for the Samba user, and do not forward ports 139 or 445 from your router to the internet. Keep the OS updated with sudo apk upgrade.
Can a 2015 phone really handle a NAS?
Yes, for light tasks. My 2015 phone manages about 3.3 MB/s upload and 2.1 MB/s download. That is enough for documents, PDFs, MP3s, and photo backups. It is not enough for several people streaming video at once.
How much power does it use?
An old phone on a USB charger usually draws between about 1 and 5 watts, depending on the charger and load. A typical old PC idles at 20–40 watts or more, so the phone is much cheaper to leave on all day.
Can I access the files from outside my house?
Not directly, and you should not try to expose SMB to the internet. SMB was designed for trusted local networks. The safe way to reach your phone from outside is a private mesh networking tool like Tailscale. After you install Tailscale on the phone and another device, you can use the Tailscale IP from anywhere. I wrote a beginner-friendly walkthrough in the Tailscale guide.
My Windows PC can't see the phone — what now?
Work through this checklist:
- Make sure both devices are on the same network.
- Use the IP address in File Explorer:
\\192.168.1.50\shared. Do not rely on network browsing. - On the phone, run
systemctl status smbdand confirm it is active. - Run
sudo nft list rulesetand verify there is an accept rule for TCP ports 139 and 445. - Try pinging the phone from Windows:
ping 192.168.1.50. - When Windows asks for credentials, enter the Samba username and password you set with
smbpasswd.
If all of those check out and Windows still cannot connect, temporarily disable Windows Firewall on the private network profile and try again. Sometimes Windows blocks outbound SMB on public profiles.
Next Steps
- Learn how I put postmarketOS on this phone in the old phone download server guide.
- Add BitTorrent downloads to the same device with the old phone torrent server guide.
- Prefer automatic folder sync instead of manual SMB mounts? Read the Syncthing guide.
- Want safe access from outside your house? Use the Tailscale beginner guide. All code in this article was tested and runs successfully on a real Xiaomi Redmi 2 (model 2014813, 2GB RAM) running postmarketOS v25.12 with kernel 6.12.1 — verified August 2026. The full chain was executed on the physical device: package installation (apk add samba samba-client, Samba 4.22.10), the minimal five-line /etc/samba/smb.conf replacing the 8,410-byte default, the Samba user created with smbpasswd -a, the nftables rule file /etc/nftables.d/50_samba.nft (syntax checked with nft -c before loading and confirmed active in the input chain), the hand-written systemd unit /etc/systemd/system/smbd.service including the required --no-process-group flag (the failure mode without it — "Failed to create session" crash loop — was reproduced first), boot enablement (systemctl enable --now), the directory ownership fix (chown user:user after NT_STATUS_ACCESS_DENIED), and real transfers from a second computer over Wi-Fi: a 50 MB upload at 3.3 MB/s (3297.7 kb/s, 15.8 s) and a 100 MB upload at 3282.9/3070.7 kb/s, downloads at 2197.7 KB/s, MD5 checksums identical after transfer, smbd CPU ~2% while copying, idle memory 9.5 MB (peak 169.5 MB page cache during large transfers, returning to 9.5 MB), ~40 MB RSS across the smbd processes, and 1.2 GB of the phone's 1.9 GB RAM still available with the GUI, nginx, Transmission, cron, and Samba all running.