kien@lenovo:~$ fastfetch .... kien@lenovo .',:clooo: .:looooo:. ----------------- .;looooooooc .oooooooooo' OS: Ubuntu 24.04.2 LTS x86_64 .;looooool:,''. :ooooooooooc Host: 20L6S0WU07 (ThinkPad T480) ;looool;. 'oooooooooo, Kernel: Linux 6.8.0-63-generic ;clool' .cooooooc. ,, Uptime: 97 days, 7 hours, 9 mins ... ...... .:oo, Packages: 851 (dpkg) .;clol:,. .loooo' Shell: bash 5.2.21 :ooooooooo, 'ooool Display (AUO2E3C): 1366x768 @ 60 Hz in 14" [Built-in] 'ooooooooooo. loooo. Terminal: tailscaled 'ooooooooool coooo. CPU: Intel(R) Core(TM) i5-8350U (8) @ 3.60 GHz ,loooooooc. .loooo. GPU: Intel UHD Graphics 620 @ 1.10 GHz [Integrated] .,;;;'. ;ooooc Memory: 1.67 GiB / 15.50 GiB (11%) ... ,ooool. Swap: 2.25 MiB / 4.00 GiB (0%) .cooooc. ..',,'. .cooo. Disk (/): 105.90 GiB / 232.64 GiB (46%) - ext4 ;ooooo:. ;oooooooc. :l. Local IP (wlp3s0): 192.168.1.83/24 .coooooc,.. coooooooooo. Battery (01AV491): 100% [AC Connected] .:ooooooolc:. .ooooooooooo' Locale: en_US.UTF-8 .':loooooo; ,oooooooooc ..';::c' .;loooo:' # My server, being a T480 laptop, has been running # for over 3 months at the time writing this article
Self-hosting is fun! Learning to self-host a software can help you learn more about how things work behind the curtain. It has helped me solidify my understanding about network, SSH and terminal applications. If you have a spare laptop (preferrably running Linux), you can connect to that laptop via SSH and run just about anything on it. The spare machine should just sit in a corner of your home, being online 24/7, and waiting for remote commands.
ssh server@192.168.1.1/24
The command above works well for a while. Let's say eventually you leave your house for a meeting, you boot up your main computer and entering the same SSH command. It suddenly stopped working. The host is no longer connectable, as if something has happened to your server at home.
Actually, the server is still running. The reason you were able to connect to it at home was because your machine (the client) and the server were under the same network, which means you could ping to the dynamic IP of the server, granted by the network. Said IP only exists in the context of that particular (WIFI) network, you just cannot connect to the server using that IP, from another "domain". And since the IP is dynamic, it will change eventually. So being under the same network does not guarantee you can connect to the server using the same IP in the future.
So how do you "give" it a static IP that you can ssh to, from just about anywhere in the world?
YOU'D HAVE TO FIRST ASSIGN IT A STATIC LOCAL IP (VIA WI-FI SETTINGS OR ROUTER DHCP RESERVATION), THEN SET UP PORT FORWARDING ON YOUR ROUTER SO EXTERNAL TRAFFIC ON A CHOSEN PORT (E.G., 22) IS SENT TO THAT IP. SINCE MOST HOME ISPS GIVE YOU A CHANGING PUBLIC IP, USE A DYNAMIC DNS SERVICE (LIKE DUCKDNS OR NO-IP) TO MAP A DOMAIN NAME TO YOUR CURRENT IP. FINALLY, SECURE SSH WITH KEYS INSTEAD OF PASSWORDS. YOU’LL THEN BE ABLE TO RUN SSH USER@YOUR-DDNS-DOMAIN FROM ANYWHERE IN THE WORLD.
Man, I ain't got time or skill for any of that.
I can just install Tailscale on both machine. Simple as that.
So the way I see Tailscale, is that it gives you a static IP which you can access to, as long as both the client and server are running Tailscale, and logged in to the same Tailscale network. This is by far the most beautiful piece of software that I have discovered in my journey of self-host.