hey fedi. i got a domain name. i want to be able to put up a static site, access certain files from wherever, stream my music maybe.

how do i set up a simple html/file server on a laptop

TO CLARIFY: i mean HOW. like, complete beginner. can someone point me to a comprehensive tutorial?

#AskFedi #LinuxHelp

@matildalove there is a good chance you don't have a public non-changing (static) IP address, so it'd make sense to proxy it through somewhere else. Usually this will mean some kind of server somewhere that is connected with your laptop usually through a VPN.

Think something like
tailscale.com and a webserver like nginx or caddy to redirect requets from the server to ya local laptop and back.

you could also just rely on cloudflare to do the proxying, but that gives up some control to cloudflare. (Specifically: Cloudflare tunnels)

I don't have the time to walk you through every step but I'm sure that someone else might step up, and this info
should give you a general direction to get started.
Tailscale | Secure Connectivity for AI, IoT & Multi-Cloud

The connectivity platform for devs, IT, and security teams. Zero Trust identity-based access that deploys in minutes and scales to every resource. Start free.

@alexia @matildalove Tailscale is only suitable for private websites, because the Funnel feature doesn't support custom domains. Basically all of the tunnel services I know of (c.f. https://github.com/anderspitman/awesome-tunneling) require a paid subscription to use custom domains or must be self-hosted entirely.

Hosting the website directly on a small, paid VPS (e.g. Hetzner) is usually cheaper than exposing your locally hosted server to the public through a paid tunnel service.

Purely static sites can be hosted for free (even with a custom domain) at various providers, such as https://statichost.eu, Codeberg Pages (licence restrictions), GitHub Pages, Cloudflare, Vercel etc.

@pixelcode @matildalove
Tailscale is only suitable for private websitesThat is why I suggested a separate VPS that runs something like caddy, and to only hook the two up using tailscale. the actual vpn here doesn't matter. I didn't even mention the tunnel feature.
Hosting the website directly on a small, paid VPSIt is implied that she wasn't talking about just static files but instead about hosted services, that she wanted to host at home and access from outside, like streaming music.

@alexia @matildalove Ah, that's what you meant.* Yes, the

paid VPS ↔️ Tailscale ↔️ local server

setup is possible of course, but I don't see the benefit of it when you could just host everything on the VPS 🤷

* (elsewhere, I had seen Tailscale being recommended as an Ngrok-like tunnel service, that's why I misunderstood)

@pixelcode @matildalove
but I don't see the benefit of it when you could just host everything on the VPSlocal control over the data, being able to encrypt said traffic at your home PC instead of the VPS provider (thus providing more privacy), having to pay less for a beefy VPS depending on what you wanna host, etc
@matildalove at the end of the day a static ip isn't necessarily needed as long as you're okay with manually checking if your ip is still the same and reconfiguring as needed, or setting up dynamic dns to reconfigure periodically

how often your ip will rotate depends on a lot of things, including but not limited to your router and your isp

as for setting up the server i learned caddy as my first webserver and i quite like it; you just need to tell it where to see files and what domain(s) to serve, then make sure your ports (80 and 443) are forwarded correctly, and then configure dns to point to your server

@matildalove FIrst thing if I may ask, do you have IPv6 or a static IP address?

If you don't know I can probably guide you on how to do this. (that said as always when opening things to the internet, security measures should be made like a firewall and seperated VLAN

@Umbreon i'm guessing i don't have a static address

@matildalove Probably, even countries that got disproportionality large portion of IPv4 address space are feeling the scarcity. Mostly because IPv4 addresses are incredibly scarce now due to the highly limited number of them.

These days it's pretty uncommon for ISPs to even give residential subscribers any sort of public unique IPv4 address and instead just use Carrier-Grade Network Address Translation (CGNAT).
When behind CGNAT, you basically share an IP address amongst many subscribers, this address is prone to changing and most likely can't be made to port forward to your laptop as the equipment is out of your control.

IPv6 doesn't need NAT at all, since it has significantly more addresses and every device with a proper address is uniquely addressable from the public internet.
Also most ISPs who do implement IPv6 generally configure v6 to be sticky (highly unlikely to change but not necessarily guaranteed to be consistent) or properly static.
That said a basic at home only server can done with much hassle

@matildalove for simplicity caddy, but nginx+certbot will likely be better long term if you plan on running services more than just a html server
@matildalove You put a minimal Linux system on it (for instance, Debian with no desktop environment). Install SSH for convenience (SSH will let you connect to the laptop remotely. Then, you install and set up the Apache HTTP server on it. Here's a guide: https://linuxcapable.com/how-to-install-apache-on-debian-linux/
Before setting up virtual hosts and whatnot, set up a cloudflare tunnel (https://developers.cloudflare.com/tunnel/) (note that all outside connections will look as if they came from the computer that runs the tunnel). Your website should now be live! (Well, the test page, that is. Follow the guide further.
Don't forget to update your system regutarly, the web is full of automated vutnerability scanners!
How to Install Apache HTTP Server on Debian - LinuxCapable

Install Apache on Debian with virtual hosts, SSL certificates, and firewall setup. Complete LAMP stack guide with troubleshooting.

LinuxCapable

@matildalove

I might have misread this, so forgive me if I have!

You want to run something on your laptop so you can access certain files and maybe stream your music?

If I were you, I would first install Tailscale on the laptop and the device(s) you want to connect to it, then you can access them easily and safely without having to worry about security issues. I'll be honest, I don't know much about it with custom domains, but mine is set up like http://laptop:8080 or http://fedora:3923 depending on the port I wish to access.

For the server side, I'd look into copyparty (https://github.com/9001/copyparty) which creates a file server, where you can also listen to music files. There are loads of ways to install it.

GitHub - 9001/copyparty: Portable file server with accelerated resumable uploads, dedup, WebDAV, SFTP, FTP, TFTP, zeroconf, media indexer, thumbnails++ all in one file

Portable file server with accelerated resumable uploads, dedup, WebDAV, SFTP, FTP, TFTP, zeroconf, media indexer, thumbnails++ all in one file - 9001/copyparty

GitHub
@matildalove most people serve websites long-term from a rented server, because you get a static IP address (that doesn't geolocate to your home), and you don't need to keep your computer turned on at all times.

Server rentals for static sites can be super cheap, like <£5 per month.

Either way, I recommend trying out Digital Ocean's guides, they're really good for stuff like this.
You can either try out their free static site hosting, which is very developer oriented, or you can rent a whole server and follow a guide for setting up NGINX.
Hosting a site goes like this.
1. buy domain.
2. Use DNS records to point the domain at an IP address.
3. If you're hosting on your home computer, you would then port forward 80 and 443 to your computer, on your router.
4. Then, you install a webserver software like NGINX or Apache, which then starts serving files by default from
/var/www/html.
5. Put your web files in the web directory above and try accessing the domain name.
(Then start troubleshooting why it doesn't work)

Here's a guide on that NGINX setup which is a more manual server admin kinda thing:
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04

Here's a guide on using Digital Ocean's free static site hosting, which is more developer oriented and doesn't involve managing a web server directly:
https://www.digitalocean.com/community/tutorials/how-to-deploy-a-static-website-to-the-cloud-with-digitalocean-app-platform

They also have a guide walking you through SSH which is used for accessing rented Linux servers through a command line, this will be super useful if you go that route:
https://www.digitalocean.com/community/tutorials/ssh-essentials-working-with-ssh-servers-clients-and-keys

Good luck
How to Install and Configure Nginx on Ubuntu | Step-by-Step Guide | DigitalOcean

Learn how to install and configure Nginx on Ubuntu with this step-by-step guide. Set up a web server, enable firewall rules, and optimize Nginx performance.

@matildalove I wouldn't serve it from a laptop but I've used thttpd in the (somewhat distant) past.
Interview with ‘Just use a VPS’ bro (OpenClaw version).

Just use a VPS bro…Interview with a VPS bro with Jack Borrough - aired on © The VPS.Music: Paramore - EmergencyOpenclaw installation guideLinux server instal...

YouTube