Convert your Private Server to Public Server using DietPi

Breaking Out of the LAN: How I Took My Old Laptop Global with Tailscale (And Fought a Port Conflict War)



In my previous post, I felt like a genius. I had successfully turned a dusty, "worthless" laptop into a powerful family cloud server using DietPi. It was humming along beautifully... as long as I was sitting on my living room couch.

But then, disaster struck: I left the house.

The moment I disconnected from my home WiFi, my glorious server became nothing more than a plastic brick spinning its fans in an empty room. I wanted my private cloud, my secure Matrix chat, and my files accessible from the grocery store, the airport, or a beach in Bali.

This is the story of how I battled "Timed Out" errors, wrestled with database locks, and used Tailscale Funnel to achieve total digital freedom—without spending a single dime.

1. The Secret Weapon: Tailscale Funnel

To access a home server from the outside world, most tutorials tell you to do "Port Forwarding" on your router. Let me tell you: Port Forwarding is the digital equivalent of leaving your front door unlocked and hoping only your friends walk in. It’s a security nightmare.

Enter Tailscale. It creates a mesh VPN that makes your devices think they are sitting right next to each other, even if they are continents apart. But the real magic is their feature called Funnel. This allows you to "expose" specific local services to the public internet securely, with a nice HTTPS URL provided by them.

I set up funnels for Nextcloud (Port 443) and Matrix (Port 8443). They worked instantly. I felt unstoppable.

But every video game has a boss fight. Mine was called File Browser.

2. The "Timed Out" Nightmare (9443 vs. The World)

I got cocky. I tried to run File Browser on port 9443. I typed the command, saw the green light, and confidentially typed my public Tailscale URL into Chrome.

The browser spun. And spun. And spun.

ERR_CONNECTION_TIMED_OUT

The terminal insisted it was "Listening." The browser insisted "No one is home." I was stuck in a loop of restarting services, checking firewalls, and questioning my life choices.


Troubleshooting: The Database Lock

To make matters worse, while frantically restarting things, I broke File Browser. It refused to start, claiming the database was "locked." It seems I had rage-quit the process too many times.

I had to get aggressive. It was time for the "Nuclear Option."

  root@DietPi: ~
# First, kill any lingering zombie processes
sudo pkill -f filebrowser

# Then, delete the corrupted/locked database (Goodbye, data!)
sudo rm /mnt/dietpi_userdata/filebrowser/filebrowser.db

After wiping the old database and starting fresh, the system finally gave me a new random admin password. But even then, the public link still timed out. It was time for a tactical pivot.

3. The "Port 10000" Breakthrough

I realized port 9443 was cursed. Maybe my ISP blocks it. Maybe DietPi uses it for some secret ritual. I didn't care anymore. I decided to move the goalposts.

I shifted File Browser to a fresh internal port (8099)—a port no one uses—and told Tailscale to funnel it through port 10000 externally.

Here is the winning combination that finally broke the siege:

  root@DietPi: ~
# Step 1: Run File Browser on internal port 8099
sudo /opt/filebrowser/filebrowser -a 0.0.0.0 -p 8099 -d /mnt/dietpi_userdata/filebrowser/filebrowser.db &

# Step 2: Tell Tailscale to pipe the internet (Port 10000) to us (8099)
sudo tailscale funnel --bg --https=10000 8099

I held my breath and hit refresh on https://dietpi.tail81115e.ts.net:10000.

BOOM! The login screen appeared. Victory tasted like sweet, sweet success.

4. Matrix Synapse: The Hunt for the Hidden Config

With files working, I needed to add users to my Matrix chat server so I could actually talk to people. But DietPi is efficient—sometimes too efficient. It hides the configuration files in non-standard places.

I needed the homeserver.yaml file. I felt like a detective scouring a crime scene. I used the find command to hunt it down:

  root@DietPi: ~
$ sudo find /mnt/dietpi_userdata -name "homeserver.yaml"
/mnt/dietpi_userdata/synapse/homeserver.yaml

Aha! Found it. Now I could register my admin user with one final command to complete my setup:

  root@DietPi: ~
sudo register_new_matrix_user -c /mnt/dietpi_userdata/synapse/homeserver.yaml http://localhost:8008

5. Final Result: My Digital Life, Anywhere

After the sweat, the "timed out" errors, and the command line battles, I now have a fully functioning ecosystem running on a laptop that was destined for the landfill:

  • Nextcloud: For backing up family photos instantly.
  • Matrix: For secure, private messaging that Big Tech can't read.
  • File Browser: For when I need to grab a PDF from my hard drive while standing in line at the bank.

The best part? If I go abroad tomorrow, I can open Termius or JuiceSSH on my phone, connect via Tailscale, and I'm right back in my terminal. No monthly fees. No snooping. Just me and my old laptop against the world.

Total cost: Still 0 BDT.
Knowledge gained: Priceless.

Project Name : PriUri Server

Project Link : https://sites.google.com/view/priuriserver/home

Comments