danger/u/
How would you self-host a website?

| I've already bought myself a domain, but I'm reliant on gitlab/vercel for storage/hosting. I plan on using a raspberry pi as a web server and other uses (perhaps mail), but I'm not sure how exactly to do so. nginx shenanigans?


| you can usually just put the .HTML file in your google chrome


| selfholsting a website is easy, but i would advice against selfhosting mail, its too much trouble and then things go wrong (emails not being reveived or your emails being flagged as spam) there is no one to turn to.


| Just rent a VPS on some promo plan for like 1 core 1 GB ram, this will be enough for like 100 http req/s if your site is static


| Also yeah, dont bother with email


| if you have static IP and your ISP doesn't block opening ports, then yes, you can run nginx on your raspberry, forward a port on your router and it should be public to everyone on the internet (not necessarily good).


| better approach that would allow use of your raspberry would be running a cloudflare tunnel on it. That way it would connect your server to your domain without exposing your home network

https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/


| to set up a basic web server for a static website just install nginx with "sudo apt install nginx" and put your files in /var/www/html directory and it should work good luck and hack the planet


| I've not used it but maybe look at mail in a box if you're interested, but mail is very often blocked from residential IP addresses for spam

Also recommend setting up a wireguard or openvpn tunnel

If you're interested in a vps you can look at Oracle cloud always free, I don't actually like Oracle but I've used it for a few years now so


| Good luck with self hosting!

https://trafotin.com/v/websites-are-impossible/
https://youtube.com/watch?v=WtqhMTKJSdk


| >>1073403 100% skill issue with everything described in this post


| >>1073422 If you really know better than become a teacher


| >>1073403
>t*ch youtuber
>no github/gitlab/codeberg/whatever link
>"No technical terms, no nonsense."
Opinion discarded


| >>1073428 ok so to correct some things in your blog post (and hopefully help you a bit)

integrating Cloudflare with Caddy requires building from source another module

- you can just download prebuilt binaries from here with custom modules https://caddyserver.com/download?package=github.com%2Fcaddy-dns%2Fcloudflare


| Cloudflare Pages requires posting this information on a Git server

- there is a direct upload option mentioned several times in the documentation you linked to https://developers.cloudflare.com/pages/get-started/direct-upload/


| Now how I would do it if I were you

Build your static website with hugo and serve it locally with caddy (no modules needed)

caddy file-server --listen :8000

Alternatively write minimal caddyfile to handle 404 page (something like this)

:8000 {
header -server

root * /home/user/webdir

try_files {path} {path}/index.html /404.html
file_server /404.html {
status 404
}
file_server
}




| Expose this port to your domain with cloudflare tunnel

https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/

It can be as easy as filling form in cloudflare's web ui and running one shell command

in webui you need to choose http://localhost:8000

docker run --network=host cloudflare/cloudflared:latest tunnel --no-autoupdate run --token <token>

Now you can enable some anti bot features for your domain in cloudflare panel


| >>ffc122 Wow, Thank you for the explanation. Also I'm not Trafotin, just a fangirl


| OP here, wanted to see if I could respond to some stuff here

>don't self-host mail server
Noted.
>use cloudflare
I'm currently using cloudflare for DNS management, but will do.

Once I buy a Pi, I'll plan on installing nginx on it, testing it out on localhost, then taking a look at cloudflare tunneling to mask the IP and put the server on a subdomain for testing purposes.

I'm pretty overwhelmed by how much stuff Cloudflare has so feel free to keep this thread active 4 mor advice


| receiving mail is easy, even with self hosted server, sending mail is tricky. You need static IP with good reputation and some mail servers still won't accept your messages just because they don't come from Google, Microsoft or other big provider. But if you want it's definitely doable. If you're fine with just receiving mail and want minimal setup, the easy trick is to just redirect it to your other mail address with cloudflare.


| Just try a bare-metal debia/ubuntu server with apache...
If you want to be more flexible and experiment around think about setting up a hypervisor (proxmox).
Ideally you run your own homeserver, which relies on a public accessible static and/or dynamic IP (from your ISP) and a ddns service.
Alternatively watch out for a server for rent. There are providers that offer a pre-configured (OS installed) vserver or even a hypervisor with a public accessible IP.


| >>0b3f6d
The thing is that I want to own my server instead of paying rent for it when hosting, so it's why I'm using gitlab/vercel as it's free for now

Total number of posts: 22, last modified on: Fri Jan 1 00:00:00 1759512883

Refresh