I’ve been thinking about finally getting myself a proper domain for my server, but a friend told me that to get one I either need a VPS with a public ip (which just takes all the fun out of selfhosting) or purchase a static ip, which is beyond what I’m willing to spend for a hobby. Do I have any good options or should I just let it go?

Also, if this isn’t the correct community for this, I’d appreciate being pointed to the right one, thank you

Update: after reading the comments the two main options I’m considering now are either a cheap VPS to use as proxy for my network via wireguard, or DynamicDNS. I’ll see if I can figure out the rest from here, thank you!

  • Mubelotix@jlai.lu
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 hours ago

    Sure, you can just use your home wifi. Some of them are static, and others don’t change really often, like once a month, so dyndns will work well. You could also use cloudflared that is a proxy you can use even if you can’t open your ports

  • EpicFailGuy@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 hours ago

    I have the VPS setup, and it’s not bad at all, I pay 3.99 a month and it acts as a gateway into my network filtering any malicious ip by using crowdsec.

    I use Pangolin reverse proxy, but you can also use netbird.

    I prefer this because on top of the routing options it ads extra security and lets me share subdomains with friends and family without exposing my network to the internet

  • lavander@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 hours ago

    You need static IP only if you want to host the autoritative DNS server for your domain (spoiler alert: you don’t).

    You don’t need to proxy your traffic via VPS (higher latency for no good reason) and the dyndns providers are over priced.

    What you need is:

    • Buy your domain
    • Use a free DNS provider (I used for years the excellent dns.he.net but it is a bit cumbersome. Nowadays I gave up and I now use cloudflare without any proxying, just pure DNS)
    • Point your registrar to the dns provider
    • use ddclient to update the IP of a domain entry (e.g. server.example.com)
    • add as many CNAME as you want that point to that entry (so you can have stuff like Jellyfin.example.com www.example.com Nextcloud.example.com)

    That’s all… ddclient will update that single dns entry every time your server restarts (or the IP lease expires and you get a new IP)

    The only thing you need to pay here is the domain (you can get free domains but that is another story and tbh I would not recommend, there are cheap domains out of there)

  • imetators@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    4
    ·
    15 hours ago

    My ISP changes IP somewhere around once a month. I own a domain on porkbun and they offer a simple docker compose script that updates my records to a current IP.

    I believe other domain selling platforms also have similar scripts or solutions.

  • IronKrill@lemmy.ca
    link
    fedilink
    English
    arrow-up
    5
    ·
    17 hours ago

    My dynamic IP rarely changes. When it does, it gets updated by a Docker favonia/cloudflare-ddns image. I have yet to notice downtime.

  • mic_check_one_two@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    9
    ·
    1 day ago

    What you’re looking for is called Dynamic DNS. I use Cloudflare for my DNS (which feels a little like making a deal with the devil) and Cloudflare-DDNS to automatically update my DNS records when my WAN IP changes. Basically, the container checks the current WAN IP, checks the current Cloudflare DNS records, and pushes a change if they don’t match. It runs every few minutes, and then rests again until the next check. I’m sure other DNS providers have similar ways to set up DDNS.

    It’s not a 100% foolproof thing, because your WAN IP changing will take a few minutes to update. But a few minutes of downtime is much better IMO, when the alternative is needing to manually VPN into my server (if the VPN even still works, since the WAN IP changed), and troubleshoot it every time the IP address changes.

    • Joelk111@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      24 hours ago

      You can configure it to run as often as you want (well, I’m not sure about cloudflare, but with other services you can, like DuckDNS)

      • mic_check_one_two@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        20 hours ago

        Yeah, I personally prefer to keep things running fairly light. I’m not running a 99.9% uptime server with hundreds/thousands of users, so I can tolerate a 0-5 minute downtime every few days.

  • UnpledgedCatnapTipper@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    12
    ·
    1 day ago

    I run a variety of self hosted things via my domain on a dynamic IP. I just have dynamic dns set up to check my current public IP periodically, and update the dns entry if it changes.

  • Svinhufvud@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    11
    ·
    1 day ago

    It is very much possible to have a dynamic IP and a usable domain.

    Both Cloudflare and desec.io (for example) have APIs that you can hit everytime your public IP changes.

    I have a script that checks every minute whether my public IP has changed from the last check, and if it has, an API call will be sent.

    With a scheme like this, your downtime will be minimal, if ever even noticed.

  • fozid@feddit.uk
    link
    fedilink
    English
    arrow-up
    19
    ·
    2 days ago

    I’ve had a domain with a dynamic up for over a year with no problems. I have a simple script that runs every 30mins to check if my IP has changed, then updates the DNS records when required.

  • qjkxbmwvz@startrek.website
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 day ago

    VPS with a public ip (which just takes all the fun out of selfhosting)

    Why do you say this? My VPS only runs a reverse proxy and WireGuard, with all services hosted on my computers at home.

      • qjkxbmwvz@startrek.website
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 day ago

        Cool, I recommend it!

        I have my public facing reverse proxy point to my public services, and I also have it set up as a “roadwarrior” VPN to my home. So, I can connect my phone via WireGuard to my VPS, and a local DNS resolves my private services to the private IP addresses in my home network (so, I also run a reverse proxy on my server, for internal services).

        I also have an off-site backup using this — just a raspberry pi and an HDD at family’s, that rsyncs+snapshots over the WireGuard network.

        I’m sure I’m not following all the best practices here, but so far so good.

  • Bakkoda@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 day ago

    I’ve been self hosting for 20 years with the same domain(s) and have never owned a static IP. Use a reliable DNS service with simple update tools (curl on a cron job for example).

  • Ada@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    12
    ·
    2 days ago

    Our setup uses a domain pointed at a dynamic (but stable) IP with a script to update it periodically