I want to expose my services publicly on my own domain name, how would you guys do that?

I have seen people using Cloudflare, but I don't want to use Cloudflare out of principle. I have also seen stuff on caddy and frp that I've done some rough researching.

What do you guys do?

top 50 comments

sorted by: hot top controversial new old
[–] 1 point 1 day ago

What I do: VPS with reverse proxy and ssh reverse tunnels from the homelab.

OG would be to understand IPv6 and use that directly. Depending on the services you plan to expose that could be a good way. Tried it some years ago, was hit and miss and I still don't get my head around how v6 work...but that would be the most independent, standalone way.

  • source
  • [–] 32 points 1 week ago* (3 children)

    I rent a cheap VPS with iptables routing ports through a wireguard tunnel to a peer on the local network that acts as a firewall and reverse proxy, this gives you a static IP with a local control plane and no ddns.

  • source
  • hideshow 6 child comments
  • [–] [S] 9 points 1 week ago (5 children)

    What's a cheap vps you recommend?

  • source
  • parent
  • hideshow 9 child comments
  • I use a cheap racknerd vps via low end box. $12/yr.

  • source
  • parent
  • hideshow 2 child comments
  • [–] [S] 6 points 1 week ago (2 children)

    That's crazy cheap price. Does it really have enough bandwidth to stream jellyfin?

  • source
  • parent
  • hideshow 4 child comments
  • [–] 9 points 1 week ago (1 child)

    I hop around a lot. I’ve used Akamai (fka linode), Vultr, DigitalOcean, AWS EC2, and GCP Compute Engine. I wouldn’t recommend the last 2 anymore because fuck big tech. A lot of people will mention Oracle’s free tier, but I don’t trust anyone that looks like Larry Ellison to own a machine with a direct connection into my local network.

  • source
  • parent
  • hideshow 2 child comments
  • load more comments (1 reply)
  • [–] 5 points 1 week ago* (1 child)

    Same but nftables and also crowdsec.

    Also I had some trouble with the wireguard tunnel dropping lots of packets, which resulted in my services not loading 50% of the time. I did a lot of suggestions at the same time so I'm not sure which one fixed it but here is a list in case anybody has similar troubles:

    • lowering MTU
    • routing ipv6 through the tunnel as well
    • rewriting nftables rule order
    • ...

    (will update after work, notes are at home)

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 1 day ago (1 child)

    I'm running into similar issues, do you mind expanding on your solutions?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 1 day ago* (last edited 1 day ago)

    I'm still having trouble with it and I'm currently traveling. My analysis so far points to my vps provider being at fault.

    I tried doing long term diagnostics, which effectively pinged through the tunnel every 5s and that make it work constantly and perfectly. So maybe some energy saving sleep stuff, which ends up breaking the tunnel?

  • source
  • parent
  • [–] 24 points 1 week ago* (1 child)

    A reverse proxy is the traditional safe route. Use a web server like Apache, nginx or caddy, and setup to reverse proxy all your services through port 443, and use let's encrypt and certbot to generate and manage TLS certificates.

    I host around 15 public facing web services this way using nginx.

    Just be aware, this is very public facing so server security and hardening is important. Things like strong passwords, disabled root, use ssh keys instead of passwords, setup fail2ban, setup crowdsec etc.

    The more modern safer way is not to truly expose to full public and use things like tailscale or cloudflare tunnels. But this relies on 3rd party servers and I'm not a fan of that, but it does bring benefits.

  • source
  • hideshow 2 child comments
  • [–] 3 points 1 week ago* (2 children)

    A lot of folk decry Cloudflare as a terrible corp (and their AI push now involves the login page shunted to the side while 70% of the screen is a relatively blank section with some sentence about using their AI), but what is the non-3rd party alternative? Does one rely on sharing the IP instead? It is impossible to have public (non-family) traffic without a Cloudflare/Google DNS resolver right?

    Being on a standard ISP I cannot use a higher-level rDNS.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 6 points 1 week ago

    im on a basic uk isp, with no fancy router, just the isp provided one. i have a fully exposed web server, im even hosting a lemmy server. Thats my domain, radiantfig.fyi, totally public, has been for nearly 2 years now. From that you can get my servers IP address. My IP is dynamic, changes roughly every 6 weeks. I have a ddns script that updates my server IP address to my domain name provider automatically. I have certbot running updating my TLS certs with lets encrypt, and if a cert dies or fails or is compromised, my server will refuse to serve. Everything is behind an nginx reverse proxy through port 443. I also have an ssh port open on a random port. Have fail2ban setup fairly aggressively to prevent brute force attacks, and have crowdsec which also kind of does the same but in a slightly different way. the internet requires ip addresses. to protect your ip address you have to give somebody elses. that somebody is a 3rd party you have no control or say on the decisions they make. i must have over 20 individual services that are public facing. 3 fully federated, lemmy, forgejo and matrix. Im as secure as any other website. nothing is unhackable, no matter how far down the rabbit hole you go. its all just layers of difficulty.

    The important thing is dont listen to random internet people about security. dont listen to me. dont listen to anybody who tells you they know best. do your own research, understand the options, the risks, the compromises. only then do you put anything up. but if you are going to anxious or worried about your server and data, no amount of security guarantees you safety, so be warned.

  • source
  • parent
  • load more comments (1 reply)
  • [–] 9 points 1 week ago*

    I got off CloudFlare by using Pangolin. Ideal for my use-case, I didn't use any of CF's advanced features, so Pangolin is the ideal replacement for me.

    Publicly serves everything from static sites to forgejo (+the ssh endpoint for git pushes).

  • source
  • [–] 7 points 1 week ago

    Reverse proxy is what you need. I would post instructions here but honestly they wouldnt be that good. Just search it up and follow along.

  • source
  • [–] 6 points 1 week ago (1 child)

    Authentication & single sign-on service

    Plugged into Reverse proxy, routing to each service by name

    With a wild card cert so there are no name leaks.

    Make your urls unexpected. If your domain is example.com, don’t put your jellyfin server at jellyfin.example.com. Instead, use watch.example.com or telly.example.com. Anything that’s memorable to you about what the service is without using a specific brand name.

    With a wildcard dns record to point all names to your IP, and a wildcard certificate that works for all names loaded on your load balancer, it becomes hard for a hacker to know what name to use to get the load balancer to send them to the service they want to hack.

    If you then use a sso tool like traefik’s ForwardAuth middleware, you won’t even get to the service until you’ve first authenticated.

  • source
  • hideshow 2 child comments
  • [–] 5 points 1 week ago* (2 children)

    If you use TLS like you should, your domains will be on the internet in the certificate transparency log. Yes, you should use a wildcard cert if you want this security by obscurity, but it's still security by obscurity.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 3 points 1 week ago

    Of course. The goal here is to not advertise. Make it hard for the bots to find you. With these steps, they can try your IP, but there’s nothing directly on your IP.

    You still need proper security. Authentication is a good start, and it has the extra effect of adding an extra layer to prevent the bots from going further if they get lucky and guess a host name.

  • source
  • parent
  • load more comments (1 reply)
  • [–] 5 points 1 week ago

    Why do you want to expose them? This might limit the solutions.

    The way I do this is in 2 different ways:

    1. Tailscale, my server connects to tailscale so all I have to do is connect to it from my phone and I can access things remotely easily. This is the best for most things, but has the downside that others can't access it as easily

    2. I have a VPS (two actually at the moment as I'm switching providers from Vultr to IONOS) that also connects to tailscale so it can access my home server through it, then using Caddy I expose the services on a subdomain of the VPS. This is what I do for things that others might want to access, or things I don't want to have to connect to tailscale to access.

    If you're going down the second route do consider that you will need to:

    • Add something like fail2ban or crowdsec to the VPS as attacks will happen.
    • Same reason you should add a dedicated authentication on front of most things. While I don't expect the auth on services to be weak, it might be more vulnerable than a dedicated authentication service. You should look into Authelia, Authentik, or similar to put on front of your services so any attacker would first have to pass that to even get to your services.
  • source
  • [–] 5 points 1 week ago (1 child)

    I recently switched to Netbird on a VPS (on Vultr). Their reverse proxy is super easy to set up / self host. They also offer a free version that works pretty good too, I just wanted to make it difficult for myself (thats the whole point of self hosting, right? )

  • source
  • hideshow 2 child comments
  • [–] [S] 3 points 1 week ago (7 children)

    I have seen netbird pop around every now and again. I might try out their cloud free version first and if I like it I might try self hosting it.

    So you host netbird on a vps you rent and that is used for reverse proxy? So with that reverse proxy I can have my home server be publicly accessible and I can have friends log in to my jellyfin server without having to connect to my tailnet.

    My last concern is security. How is this set up good for making sure I don't just get constantly botted and exploited?

  • source
  • parent
  • hideshow 9 child comments
  • [–] 4 points 1 week ago

    Yup! They can either connect to your Netbird meshnet (ie, similar a tailnet) or you can reverse proxy it out to the internet (no tailnet needed)

    I saw a couple comments below concerned about security, one of the nice things about Netbird is that they have reverse proxy auth built in if you want. Some stuff (Navidrome or VoidAuth for instance) only has geolocation locked down (US only) but other things that I'm either more concerned about or don't necessarily trust being open (Paperless or Komodo for instance) have Netbird Auth and VoidAuth as sign in options before it will let me open the page. Its worked flawlessly so far, and has kept my sanity intact because I wanted some stuff publically accessible without it being OPEN.

    As far as being hammer fucked, it has CrowdSec and Geolocation lockdowns so you can set it to only accept traffic from ONE location and the Crowdsec also catches everything.

  • source
  • parent
  • load more comments (5 replies)
  • [–] 4 points 1 week ago

    i configured dyndns in my router and have it forward all traffic to a gateway vm running nginx and fail2ban. every service is on a subdomain so any attempt to fetch things from the main name gets banned.

  • source
  • [–] 4 points 1 week ago

    Netbird reverse proxy: https://docs.netbird.io/manage/reverse-proxy

    It's like Tailscale, but Open Source. You can self-host the components, if you want. I just use the cloud offering. I have a domain name that resolves to my server. There's different ways you can do auth. I just hard coded an allow list of IPs. Otherwise, devices in my Netbird network can use the private IP.

  • source
  • [–] 3 points 1 week ago (3 children)

    Recently set up caddy myself, very straightforward setup. You essentially just edit one config file and point your domain host to the right place and are good to go. Took me by surprise actually.

  • source
  • hideshow 3 child comments
  • load more comments (3 replies)
    [–] 3 points 1 week ago (1 child)

    Make it publicly available to the world or just for you (and people you know)?

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 3 points 1 week ago

    My router (gl-net) has a VPN server built in. I just use WireGuard client and freedns.

  • source
  • [–] 3 points 1 week ago

    I personally use a vps for this stuff but my setup is standalone nginx as a reverse proxy and fail2ban and ufw

  • source
  • [–] 2 points 1 week ago

    I can't answer your question as I haven't taken that step yet, everything is still confined to my LAN.

    Here's a similar thread from last month that had a lot of replies. Hopefully will be some useful info there for you. Good luck!

  • source
  • [–] 2 points 1 week ago

    Just a reverse proxy, I was using Caddy, moved to Pangolin because it's neat.

  • source
  • [–] 2 points 1 week ago

    If you have a UniFi gateway, you can enable region based firewall on your port forward ip. This then blocks most of the world (incoming) as a first step. Then like others suggest, a reverse proxy. I use Caddy built with the Maxmind geolocation plugin, and I also run fail2ban on my exposed service.

    I figure if you don’t need most of the world accessing your services, it is best to exclude them

  • source
  • [–] 2 points 1 week ago (1 child)

    I bought myself a Synology disk station and a domain.

    Yes I use Cloudflare for DNS so I can get a wildcard domain cert using ACME.

    I use the Synology supplied login portal as a web application firewall for every site I want to host with the wildcard SSL cert. Like bar.mydomain.com, mealie.mydomain.com, etc.

    The Synology routes the traffic to the services hosted on other services within my network.

    Anything else I don’t want open to the public web, I use the Synology supplied OpenVPN server to connect.

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 2 points 1 week ago (2 children)

    For those of us behind double NAT (CGNAT) forwarding ports is not an option as we do not control forwarding on the second gateway. This will limit you to any of the solutions that include a device outside your network with a public port that tunnels traffic into your server.

  • source
  • hideshow 2 child comments
  • load more comments (2 replies)
    load more comments
    view more: next ›