Hello,

Some time ago, I started self-hosting applications, but only on my local network. So far, it’s working fine, but I can’t access them as soon as I go outside (which is completely normal).

For the past few days I’ve been looking for a relatively secure way of accessing my applications from outside.

I don’t need anyone but myself to have access to my applications, so from what I’ve understood, it’s not necessarily useful to set up a reverse-proxy in that case and it would be simpler to set up a VPN.

From what I’ve seen, Wireguard seems to be a good option. At first glance, I’d have to install it on the machine containing my applications, port-forward the Wireguard listening port and configure my other devices to access this machine through Wireguard

However, I don’t have enough hindsight to know whether this is a sufficient layer of security to at least prevent bots from accessing my data or compromising my machine.

I’ve also seen Wireguard-based solutions like Tailscale or Netbird that seem to make configuration easier, but I have a hard time knowing if it would really be useful in my case (and I don’t really get what else they are doing despite simplifying the setup).

Do you have any opinions on this? Are there any obvious security holes in what I’ve said? Is setting up a VPN really the solution in my case?

Thanks in advance for your answers!

  • friend_of_satan@lemmy.world
    link
    fedilink
    English
    arrow-up
    26
    arrow-down
    1
    ·
    edit-2
    5 months ago

    Run WireGuard on some home machine. (Does not need to be the machine the app you want to access is hosted on.)

    Run WireGuard on your road warrior system.

    There is no step 3.

    I’m doing this right now from halfway around the world from my house and it’s been great. Been using iPhone, iPad, and macOS clients connected to linuxserver/WireGuard docker container. Been doing this on many WiFi networks and 5G, no difference.

    • dantheclamman@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 months ago

      I use Wireguard via PiVPN and it’s pretty much foolproof. I don’t bother with Dynamic DNS but have in the past

    • waterproof@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 months ago

      Okay, so that’s pretty much the setup I had in mind. Good to know there is not much need for an extra step for security, thanks for the answer !

      Well, I guess that would still be vulnerable to DDOS attacks, but that would just prevent me from accessing my cinnamon apple-pie recipe from my self hosted recipe manager for some time. A bit mean, but not catastrophic.

      I wondered if there would be some other attacks that could compromise my machine with only a wireguard setup, but that’s a good sign if there is nothing obvious.

    • waterproof@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 months ago

      Tailscale is very tempting, on one hand it should provide a pretty good layer of security without too much thinking and it is “free”, and on another hand, it’s a business solution, so it is probably not really free…

      Thanks for the answer anyway confirming that Tailscale is pretty easy to setup !

  • ikidd@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    5 months ago

    Tailscale is easier than Wireguard but if you’re running OPNsense or OpenWRT it’s not hard to do a wireguard infra of your own and avoid having to use an outside service. I ended up having to revert to wireguard anyway because Tailscale’s android app wasn’t reliable on my new phone, it would drop out every few hours which messed up my monitor/alert system.

    But Tailscale is still the easier of the two solutions.

  • rtxn@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    5 months ago

    Managing Wireguard is just one of Tailscale’s features.

    It uses some UDP black magic fuckery to get through NAT and firewalls without having to open ports on the edge. Very useful if you’re behind CGNAT and/or your ISP is a dickhead and locks down the firewall on your router (this is why I use it; eat a dick, Vodafone). If the UDP fuckery is not available, it reverts to simple relay servers. The client can also advertise subnets and route to hosts on it. You could install the Tailscale client on OPNSense/pfSense/OpenWRT and access your entire home network through that one device.

  • DetachablePianist@lemmy.ml
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    5 months ago

    I rarely if ever see ZeroTier mentioned as a solution, but it’s a self-hostable encrypted virtual mesh network (with a small free tier for corp-hosted), super secure, and really easy to setup. I use ZTnet instead of the free-tier corp-hosted controller

    • Midnight Wolf@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 months ago

      Ha, I use both wg and zt, for different situations. ZT for multi-player for old games with friends via ‘LAN’ across the WAN, wg for ‘actual’ VPN through my vps.

      Though with zt I’m grandfathered on the old free tier, and they try pretty hard to get me to switch. Last time I logged in they had a full-page ‘you should upgrade to our new plans and features’. But I’m happy on the free level, just gaming.

  • conrad82@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    5 months ago

    Simple and fast solution is tailscale. tailscale is a business, but it works well

    Personally i use opnsense and wireguard

  • Ptsf@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    5 months ago

    Zero tier. I went tailscale originally, and they’re good, but their mdns support doesn’t exist and several services rely on it. (For me, the showstopper was time machine backups)

    • Max@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      5 months ago

      I like zerotier over wireguard because it’s one layer lower. So anything that uses Ethernet frames can be routed over it like it was a network switch plugged into your computer. This is probably why mdns works.

  • monkeyman512@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    5 months ago

    Tailscale. You can make a free account and they have clients for most things. If you want to self host, Headscale.

  • sugar_in_your_tea@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    5 months ago

    If your traffic is pretty low, rent a VPS for $5/month or whatever and set up a Wireguard server on it, have your devices maintain a connection to it (search keepalive for Wireguard), and set up HAProxy to do SNI-based routing for your various subdomains to the appropriate device.

    Benefits:

    • you control everything, so switching to a new provider is as simple as copying configs instead of reconfiguring everything
    • most VPN companies only route traffic going out, not in; you can probably find one that does, but it probably costs more than the DIY option
    • easy to share with others, just give a URL

    Downsides:

    • more complicated to configure
    • bandwidth limitations

    If you only need access on devices you control, something like Tailscale could work.

    Benefits:

    • very simple setup - Tailscale supports a ton of things
    • potentially free, depending on your needs

    Downsides:

    • no public access, so you’d need to configure every device that wants to access it
    • you don’t control it, so if Tailscale goes evil, you’d need to change everything

    I did the first and it works well.

  • Kagu@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    5 months ago

    Not running anything myself but am part of a self hosting discord that swears by Netbird because its basically Tailscale but with a bunch more ease of use features apparently

  • spaghettiwestern@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    5 months ago

    I self-host various applications and have been really happy with Wireguard. After watching just how hard my firewall gets hammered when I have any detectable open ports I finally shut down everything else. The WG protocol is designed to be as silent as possible and doesn’t respond to remote traffic unless it receives the correct key, and the open WG port is difficult to detect when the firewall is configured correctly.

    Everything - SSH, HTTP, VNC and any other protocol it must first go through my WG tunnel and running it on an OpenWRT router instead of a server means if the router is working, WG is working. Using Tasker on Android automatically brings the tunnel up whenever I leave my house and makes everything in my home instantly accessible no matter what I’m doing.

    Another thing to consider is there’s no corporation involved with WG use. So many companies have suddenly decided to start charging for “free for personal use” products and services, IMO it has made anything requiring an account worth avoiding.

  • damnthefilibuster@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    5 months ago

    You got two options which I’ve tried -

    1. A solution like tailscale or zerotier. Simple setup, easy to turn on and just go. Tailscale is newer and has a nicer interface and features like using an actual VPN like Mullvad as an “endpoint” (or whatever they call it). Their Mullvad connection also basically gives you a discount as they charge only $5 for the vpn instead of €5. The catch is that Mullvad charges you that price for 5 devices. So if a sixth device connects to the VPN through tailscale, you get charged $10 for that month.
    2. A cloudflare tunnel with zero trust on top. More work to setup. But makes it easy to access your apps without any vpn. They’re basically exposed to the internet at that point, but locked in behind cloudflare’s authentication. You can literally set it up for one or two email IDs. Yours and a family member’s. Much simpler for others to wrap their heads around. But some people dislike cloudflare for some reason or the other.
    • nfreak@lemmy.ml
      link
      fedilink
      English
      arrow-up
      4
      ·
      5 months ago

      The variant version of number 2, which is more work to set up of course, is Pangolin on a VPS. Basically serves the same purpose but skips Cloudflare entirely.

      I’m in the process of setting up Pangolin and Headscale on a VPS to expose a small handful of services and to replace my wg-easy setup. Currently chaining wg-easy through a gluetun container, so with a single VPN connection I get LAN access and protect my outbound traffic, but I can’t for the life of me get the same setup working on wg-easy v15, so I’m going to give tailscale/headscale a try with a gluetun exit node.

      • damnthefilibuster@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        5 months ago

        haven’t looked at Pangolin, but thanks for the info! I might explore it in the future if my current setup gives me any issues.

        • nfreak@lemmy.ml
          link
          fedilink
          English
          arrow-up
          2
          ·
          5 months ago

          Getting it up and running was pretty easy but admittedly I’m starting to hit some snags with split DNS and Authentik. Totally doable but taking a lot of work for sure.

          In the process I’m also moving my entire domain to a different name and got timed out by letsencrypt lmao so I guess I’ll try some more tomorrow.

  • JohnSmithon@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 months ago

    1 pangolin 2 whatever is already on your router 3 wireguard

    Pangolin also does RP with traefik so it’s a win win