I’m not really sure how to ask this because my knowledge is pretty limited. Any basic answers or links will be much appreciated.

I have a number of self hosted services on my home PC. I’d like to be able to access them safely over the public Internet. There are a couple of reasons for this. There is an online calendar scheduling service I would like to have access to my caldav/carddav setup. I’d also like to set up Nextcloud, which seems more or less require https. I am using http connections secured through Tailscale at the moment.

I own a domain through an old Squarespace account that I would like to use. I currently have zero knowledge or understanding of how to route my self hosted services through the domain that I own, or even if that’s the correct way to set it up. Is there a guide that explains step by step for beginners how to access my home setup through the domain that I own? Should I move the domain from Squarespace to another provider that is better equipped for this type of setup?

Is this a bad idea for someone without much experience in networking in general?

  • qaz@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 minutes ago

    If you want to expose it publically for others to use consider using Cloudflare for easy setup and avoiding exposing your home IP. If you want to use it for yourself you can access it with Tailscale and forward traffic to certain ports based on the subdomain using Nginx Proxy Manager.

  • irotsoma@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    6
    ·
    4 hours ago

    Really the first issue is your IP address. How does your ISP hand out IP addresses IPv4 and/or IPv6?

    If you have an ISP that gives a static block of IPv6 addresses that simplifies things immensely. But also consider that many legacy, monopoly ISPs have not implemented IPv6 for their customers, especially in the US, and so domains without an IPv4 address aren’t accessible from people’s homes that use those ISPs. But it means you could assign static IPv6 addresses to each service if you wanted to and add subdomains for each. Then you just need to deal with security on that system.

    Otherwise you’ll likely need to deal with dynamic DNS. If your router and your domain registrar’s DNS can work together for DDNS that’s ideal. For example, my OpnSense router updates my cloudflare registered domain directly when my ISP changes my IPv4 address (I have one of those ISPs that doesn’t assign IPv6 still but I don’t have any choice if I want > 5-10Mbps upload speeds).

    Then you need to deal with routing. The best way is with a reverse proxy like Caddy or I actually like Traefik a lot because it works well with my complex setup with docker and kubernetes among other things. Basically your router needs to route all the inbound traffic on the appropriate inbound ports to the reverse proxy to it to then route to the appropriate service based on the subdomain and/or port of the request.

    Once you route the subdomain to the appropriate service you need to deal with security. Once a service is exposed, it’s going to eventually start getting hit by bots trying to access it. Best to implement something like fail2ban to stop them from wasting your processing power with failed logins and 404 errors and such.

  • eksb@programming.dev
    link
    fedilink
    English
    arrow-up
    27
    ·
    6 hours ago
    1. Consider getting a VPS to play around with to learn how this stuff works before you expose your data to the internet.
    2. Learn about how DNS works. You will create an A record (and possibly also an AAAA recordy) for your domain pointing to your home IP (or VPS).
    3. If SquareSpace does not let you set records (and will only allow you to use Squarespace-hosted services) you will need to migrate your domain to another provider. I like gandi.net.
    4. Learn how your router does port forwarding. You will forward port(s) for the calendar service from your router to your home PC. (Or learn how to do firewalls on your VPS.)
    5. Before you actually connect to it with credentials over the internet, set up SSL/TLS certificates with LetsEncrypt.
    • pHr34kY@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      35 minutes ago

      The educational route I took was Hurricane Electric’s free IPv6 online course. It taught me a bunch of networking principles. When you finish the course (and get “sage” status), you get free lifetime DNS access. This includes dynamic DNS that automatically updates when your IP address changes.

      Because of this, I can self-host on a basic residential plan without paying for any additional services.

  • Klastrowy Bebok@pol.social
    link
    fedilink
    arrow-up
    1
    ·
    3 hours ago

    @gedaliyah after a lot of thinking I decided that only two things I need available in public internet are my searxng instance and my xmpp server. the rest, like music streaming, file sharing, home automation, etc etc etc could live happily in VPN with clients on trusted devices.
    this way you don’t have to wake up every night to check, if some piece of software, which has access to your whole network, was pwned because of outdated leftpad version or something.

  • themadcodger@kbin.earth
    link
    fedilink
    arrow-up
    4
    ·
    4 hours ago

    We all got to learn somewhere!

    Lot of good advice here, but sometimes people forget what it’s like to be a beginner. Since you don’t know what you’re doing, I would recommend not trying to host things on your home server and access it from the outside world. That usually involves port forwarding on your router, and that comes with a lot of risks, especially if you don’t know what you’re doing. Others have mentioned it, but a better option when you’re starting off is to rent a vps and host your software there.

    Squarespace might work, but my guess is it’ll be easier to transfer your domain elsewhere. You can follow guides for that online and it’s pretty straightforward.

    Having a vps, a domain name, you’re most of the way there. On your vps, you’ll want to install a reverse proxy, which is what routes incoming urls to the right place (nextcloud.domain.tld goes here, calendar.domain.tld goes there).

    Docker is another thing I’d recommend learning as a lot of what you’ll self host will likely be in a Docker container. I’d watch a few YouTube videos to see how it’s done. This channel has some great videos, and there are others out there.

    It seems like a lot, but learn a little here and there and don’t expect to have this all working overnight. You’ll get there!

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

      Seconding Caddy – It’s as close to it gets for “Just works”. It handles all the certs, it’s easy to refresh and add a subdomain instantly, handles wildcard domains, and the config file is dead simple to understand.

      You can use https://xcaddy.tech/ to build Caddy with various plugins, I use mine with transform-encoder so that logs can be made compatible with fail2ban.

  • littleomid@feddit.org
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    4 hours ago

    Three steps:

    1. point the FQDN to your network (Dynamic DNS).
    2. set up reverse proxy (Nginx, etc.)
    3. set up certificates (Certbot, etc.)

    Optional step 4: harden with fail2ban and a firewall.

    • bruce965@lemmy.ml
      link
      fedilink
      English
      arrow-up
      7
      arrow-down
      2
      ·
      edit-2
      6 hours ago

      I would say this would be the proper way to do it (at least as a sysadmin), but since it’s OP’s first time I would simplify it to:

      1. Install CloudFlare ZeroTrust daemon on your local server;
      2. Set up reverse proxy such as Nginx (optional, the alternative is to use a different subdomain for each service, which might be easier);
      3. Point the FQDN to CloudFlare.

      Let CloudFlare handle the certificates, DDoS protection, etc… Link if you’d like to give this setup a try.

      • ag10n@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        5 hours ago

        Cloudflare isn’t very self-host, unless you want/need to trust a third party I wouldn’t recommend this.

        • bruce965@lemmy.ml
          link
          fedilink
          English
          arrow-up
          2
          ·
          4 hours ago

          They provide decent defaults for all the not-so-straightforward configurations, and they provide a web UI to configure the rest. That’s the sole reason I would recommend it to get one’s feet wet without having to work too much.

          If one is committed to do things “the right way” they could switch to Nginx and “proper” self-hosting later.

      • brian@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 hours ago

        How would you go about using a different subdomain without something like a reverse proxy? Heck, in my head that’s almost the only reason I use a reverse proxy

        • bruce965@lemmy.ml
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 hours ago

          Yeah, I’m afraid you have to use a reverse proxy to host multiple subdomains. The CloudFlare daemon is the reverse proxy.

  • Blaster M@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    4 hours ago

    On your DNS provider, make an A record with your IP address, AAAA record with your IPv6 address. If these addresses change often, either setup a dyndns (your DNS provider needs to support this) or pay for a Static IP from your ISP. Firewall the hell out of your network, have a default deny (drop) new inbound rule, and only open ports for your service. Use an nginx reverse proxy if possible to keep direct connections out of your service, and use containers (docker?) for your service(s). Don’t forget to setup certbot and fail2ban. You need certbot to auto update your certs, and you need fail2ban to keep the automated login hacker bots from getting in.

    That’s the minimum. You can do more with ip region blocking and such, as well as more advanced firewalling and isolation. Also possible to use Tailscale and point the DNS A record to the Tailscale IP, which will eliminate exposing your public IP to the internet.

    • gedaliyah@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 hours ago

      If I use Tailscale as described, how will a request connect to the tailnet? Is there anything you can link that explains how to do this?