this post was submitted on 17 Feb 2025
112 points (97.5% liked)

Selfhosted

42570 readers
423 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I have been self-hosting for a while now with Traefik. It works, but I'd like to give Nginx Proxy Manager a try, it seems easier to manage stuff not in docker.

Edit: btw I'm going to try this out on my RPI, not my hetzner vps, so no risk of breaking anything

top 50 comments
sorted by: hot top controversial new old
[–] AllHailTheSheep@sh.itjust.works 19 points 2 days ago (1 children)
[–] mr_jaaay@lemmy.ml 2 points 1 day ago

Seconding Caddy. I've been using it for a couple of years now in an LXC and it's been very easy to setup, edit and run.

[–] Kusimulkku@lemm.ee 51 points 3 days ago (2 children)

Caddy is really simple and easy. Just werks and gives you https

[–] sxan@midwest.social 29 points 3 days ago (2 children)

I mean, the basic config file for Caddy is 1 line, and gives you Let's Encrypt by default. The entire config file for a reverse proxy can be as few as 3 lines:

my.servername.net {
   reverse_proxy 127.0.0.1:1234
}

It's a single executable, and a single 3-line file. Caddy is an incredible piece of software.

[–] merthyr1831@lemmy.ml 4 points 2 days ago

Ive got a basic workflow for nginx proxy manager now so this isnt super useful but good god that's exactly what i wish nginx was.

load more comments (1 replies)
load more comments (1 replies)
[–] WhyFlip@lemmy.world 1 points 1 day ago

I highly recommend npm. It's also the only one I've used, so please keep that in mind.

[–] sandwichsaregood@lemmy.world 1 points 1 day ago

I really like Zoraxy. Similar to NPM but it's its own thing and I like it a lot more

I know how to use raw nginx/Caddy/traefik to do it, but I find the WebUI and all the extra features Zoraxy has to be very convenient and easy to use.

[–] pax0707@lemmy.world 15 points 2 days ago

Nginx from day one. Well documented, it works. If something doesn’t work chances are you are a quick googlefu away from the solution.

[–] Xanza@lemm.ee 8 points 2 days ago (1 children)

Traefik is a PITA.

Caddy all the way. If you build it with Docker support (or grab the prebuilt), you can use docker container names to reverse proxy using names instead of any IP addresses or ports. It's nice because if the IP updates, so does caddy. All automatically.

Here's what my caddyfile looks like;

{
        acme_dns cloudflare {key}
}

domain.dev {
        encode zstd gzip
        root * /var/www/html/domain.dev/
        php_fastcgi unix//run/php/php8.1-fpm.sock
        tls {
                dns cloudflare {key}
        }
}
*.domain.dev {
        encode zstd gzip
        tls {
                dns cloudflare {key}
        }
        @docker host docker.domain.dev
        handle @docker {
                encode zstd gzip
                reverse_proxy {portainer}
        }
        @test host test.domain.dev
        handle @test {
                encode zstd gzip
                reverse_proxy 127.0.0.1:10000
        }
        @images host i.domain.dev
        handle @images {
                encode zstd gzip
                reverse_proxy 127.0.0.1:9002
        }
        @proxy host proxy.domain.dev
        handle @proxy {
                encode zstd gzip
                reverse_proxy proxy
        }
        @portal host portal.domain.dev
        handle @portal {
                encode zstd gzip
                reverse_proxy portal
        }
        @ping host ping.domain.dev
        handle @ping {
                encode zstd gzip
                respond "pong!"
        }
}

DNS hosted by cloudflare but because caddy handles ACME certs, all the subdomains automatically get SSL.

[–] lena@gregtech.eu 2 points 2 days ago (1 children)

Actually I found traefik rather easy, I just had to make the proper docker labels and config.

PITA

Unrelated, I'm going to sound like a grammar nazi here, but holy shit there are so many acronmys, how am I supposed to know every one of them without googling? Please just say "traefik is a pain in the ass". Also please don't take this as a snarky reply.

[–] Xanza@lemm.ee 3 points 2 days ago

PITA = pain in the ass.

I never said it was hard. Just a real pain in the ass. Like iptables vs UFW. They're the same thing, but one is easy and a pain in the ass and the other is just easy... So I opt to make my life easier. lol

[–] hendrik@palaver.p3x.de 26 points 3 days ago (1 children)

In my experience, all the 3 big ones work just fine. Caddy, Traefik, Nginx. I use Nginx.

I have had the same experience. Have used all three at some point but mostly use nginx for new servers

[–] Tenkard@lemmy.ml 12 points 2 days ago (1 children)

Caddy. I started with npm but I realized it was hiding enough stuff that I wasn't learning anything about managing networking. Caddy is super easy and has lot of sane defaults.

load more comments (1 replies)
[–] mbirth@lemmy.ml 22 points 3 days ago

it seems easier to manage stuff not in docker

Read into Traefik’s dynamic configuration. Adding something outside of Docker is as easy as adding a new config file in the dynamic configuration folder. E.g. jellyfin.yml:

http:

  routers:

    jellyfin:
      rule: Host(`jellyfin.example.org`)
      entrypoints: websecure
      tls:
        certResolver: le
      service: jellyfin

  services:

    jellyfin:
      loadbalancer:
        servers:
          - url: "http://192.168.1.5:8096/"

The moment you save that file it will be active and working in Traefik.

[–] ikidd@lemmy.world 12 points 3 days ago (1 children)

Stick with Traefik if you've figured it out. It's much more powerful than NPM in my opinion. If you insist on using NPM, you might want to try NPMPlus, it has more bells and whistles and is more actively maintained.

[–] lena@gregtech.eu 4 points 3 days ago

Yeah I'll stick with Traefik, I know how to use it

[–] Other@lemmy.ca 2 points 2 days ago

I am using nginx on a separate machine (VM) I have yet to try it in docker, I just have not found a reason to change it yet.

I've tried npm, caddy and traefik but they are always way more complicated then adding a new config file in nginx...

I feel the others add too much to the docker configs and limit what can be added to the reverse proxy. I have control of access from the nginx server, without having to change the apps configuration.

NPM is the closest to what I would like (only needing the same network in docker) if I go the docker way but for some reason it never works as it should when I configure it. So I am sticking to plain nginx.

[–] traches@sh.itjust.works 14 points 3 days ago

I’ve been using caddyserver for awhile and love it. Config is nicely readable and the defaults are very good.

[–] midnight@programming.dev 9 points 3 days ago

I'll throw in another recommendation for Caddy. I've been using it for years and the few problems/feature suggestions I had got implemented by the developers pretty quickly. They're super active on their forums and I haven't yet run into an issue where I couldn't either figure it out myself or with help from their community forums (usually from a dev.) They're very friendly and won't berate you for simple mistakes like other devs.

[–] merthyr1831@lemmy.ml 7 points 2 days ago (1 children)

i use nginx proxy manager but im barely getting by. Theres zero useful documentation for setting up custom paths so everyone uses subdomains. I ended up buying my own domain just so i didnt feel guilty spamming freedns lmao.

[–] EncryptKeeper@lemmy.world 4 points 2 days ago (3 children)

At that point you might be better off just using Nginx without the gui. SWAG is a nice reverse proxy focused implementation of it.

load more comments (3 replies)
[–] synapse1278@lemmy.world 9 points 3 days ago

Caddy is the only reverse proxy I have ever managed to successfully make use of. I failed miserably with Nginix and Traefik.

Caddy has worked very well for me for several years now. It gets the SSL certificate from my domain name provider and all.

[–] Hawk@lemmynsfw.com 3 points 2 days ago (1 children)

If you're just going to VPN in to your home network, I've found caddy to be the simplest.

[–] Semjaza@lemmynsfw.com 1 points 2 days ago (1 children)

I tried using PiVPN to route my phone's Internet access through my home network, but it kept breaking and I found I don't have a head for networks.

Would caddy be able to do that in an easier to maintain way?

[–] Hawk@lemmynsfw.com 2 points 2 days ago (1 children)

Set up wireguard in a docker container and then forward the port to wireguard, the default container on docker hub is fairly straightforward and you can always ask me for help if you need :).

However, If you are using ipv4, you need to make sure that you're not behind a CG-NAT (If you think you might be, call your ISP and tell them you have security cameras that need to get out or something like that).

You could also try tailscale which is built using wireguard with nat-busting features and a bit easier to configure (I dont personally use it as wireguard is sufficient for me).

After that Caddy + DNSMasq will simply allow you to map different URLs to IP addresses

  • dnsmasq
    • will let you map, E.g. my_computer -> 192.168.1.64
  • Caddy (Or nginx, but caddy is simpler)
    • will let you map to ports so e.g.:
      • with DNS (DNSMasq as above)
        • http://dokuwiki.my_computer -> http://my_computer:8080
      • Without DNS
        • http://dokuwiki.192.168.1.64 -> http://192.168.1.64:8080/

Caddy and DNSmasq are superfluous, if you've got a good memory or bookmarks, you don't really need them.

VPN back into home is a lot more important. You definitely do not want to be forwarding ports to services you are running, because if you don't know what you're doing this could pose a network security risk.

Use the VPN as the entry point, as it's secure. I also recommend running the VPN in a docker / podman container on an old laptop dedicated just to that, simply to keep it as isolated as you can.

Down the line you could also look into VLan If your router supports that.

I personally would not bother with SSL If you're just going to be providing access to trusted users who already have access to your home network.

If you are looking to host things, just pay for a digital droplet for $7 a month, It's much simpler, You still get to configure everything but you don't expose your network to a security risk.

[–] Semjaza@lemmynsfw.com 1 points 2 days ago

Thank you, that looks like a good set of hooks for me to get into at a weekend, child allowing.

I very much appreciate the guide. I'll let you know when I've had a fiddle.

I think NGINX has the best reverse proxy

[–] PieMePlenty@lemmy.world 2 points 2 days ago

Nginx installed directly, I use nano over ssh to edit configs. Forces you to learn some things and I never moved passed it because it works so well.

[–] lka1988@sh.itjust.works 4 points 2 days ago

I like NPM, it's simple, but also allows for more complex configs as well if needed. I run it in its own LXC because I have other non-dockerized things that are exposed.

[–] Cardboard5308@lemmy.world 1 points 2 days ago

NPM was the first one that worked for me. I used a YouTube tutorial. I tried Nginx and Caddy, but couldn't figure them out. For context, I try to run anything I can out of Docker, which adds some complexity I think. I must not have been doing the templates correctly or something.

I plan on trying to go for Nginx or Caddy later, but right now NPM works wonders for my use case.

[–] CrankyCarrot@lemmy.world 7 points 3 days ago* (last edited 3 days ago)

I use Traefik at home. The initial setup was more complex than others but now it's set up it's by far the easiest to add new routes than any other I've tried, just by virtue of being right there in the compose/k8s files I'm already writing. Static routes are manual of course, but so are every other proxy so that's no different, and they're not exactly complicated (I see another comment has examples). The config files are the same markup language as your Compose/k8s files so you're not learning a whole new syntax and having to switch languages mentally as you switch between them.

Caddy is super easy, but the fact that the Docker labels thing was a plugin is a con to me, I'd prefer it being first party. It also isn't as performant as Traefik, higher CPU usage while also having higher latency.

As far as I'm aware, Nginx and Nginx Proxy Manager support no such thing, you have to manually write those routes every time you create a new service. Personally I think Nginxs config syntax annoying, I'm very comfortable with it now but I much prefer TOML/YAML.

Nginx Proxy Manager is a lot like Portainer. It's useful for people who don't want to learn Nginx and/or just want to click a few buttons. But anything complex you're suddenly going to be thrown into the deep end.

You've already set up Traefik, you've already done the complex bit. IMO there's no reason to change, from this point everything else is more complicated.

We use Nginx at work but are currently in the process of switching to Traefik.

[–] MXX53@programming.dev 7 points 3 days ago (1 children)

I use traefik. I like it. Took a bit to understand, but it has some cool options like ssl passthrough and middlewares for basic auth.

load more comments (1 replies)
[–] reddwarf@feddit.nl 7 points 3 days ago (3 children)

I use NPM in a docker container. It could not be easier in my opinion but then again, I did not use any of the alternatives so I might be missing out on something, who knows. I did manage a couple of proxy servers in the past based on Apache and I can tell you that NPM is much easier and logical to me than that.

Just create a compose file and start it. Create DNS records pointing to your NPM IP address/exposed IP and make a host in NPM sending traffic to the right container IP:port. The compose file is super simple, could not be easier. Here's mine for example:

services:
  nginx-proxy-manager:
    container_name: nginx-proxy-manager
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

I just make sure ports 443 and 80 are exposed on my router so DNS records can point to that IP adrdess. All traffic on port 80 gets re-routed to 443.

I'm probably stating all the obvious things here 😀

load more comments (3 replies)
[–] rumba@lemmy.zip 1 points 2 days ago

I used NPM, It was pretty solid

Then I changed headspace and now I run SearXNG through cloudflare, and tailscale everything that doesn't need to be public.

[–] Dirk@lemmy.ml 6 points 3 days ago

but I’d like to give Nginx Proxy Manager a try, it seems easier to manage stuff not in docker.

NPM is pretty agnostic. If it receives a request for a specific address and port combination it just forwards the traffic to another specific address and port combination. This can be a docker container, but also can be a physical machine or any random URL.

It also has Let's Encrypt included (but that should be a no-brainer).

[–] korthrun 3 points 2 days ago

For a while now I've been using either haproxy or nginx depending on my needs. I've hit instances with both where the functionality I want is in the paid version.

[–] lorentz@feddit.it 5 points 3 days ago (3 children)

Nginx for my intranet because configuration is fully manual and I have complete control over it.

Caddy for the public services on my vps because it handles cert renewal automatically and most of its configuration is magic which just works.

It is unbelievable how shorter caddy configuration is, but on my intranet:

  1. I don't want my reverse proxy to dial on internet to try to fetch new SSL certs. I know it can be disabled, but this is the default.
  2. I like to learn how stuff works, Nginx forces you to know more details but it is full of good documentation so it is not too painful compared to Caddy.
load more comments (3 replies)
[–] EpicStuff@lemmy.ca 1 points 2 days ago

I want to just mention frp, I use it to get around firewalls

[–] ALERT@sh.itjust.works 3 points 3 days ago

npm/npmplus

[–] boydster@sh.itjust.works 4 points 3 days ago

I've been mostly using Nginx Proxy Manager, but I recently set up Bunkerweb as a WAF for a couple of public services I'm hosting and I kind of like it. It does reverse proxy along with a bunch of other things (bad behavior blocking, geographic blocking, SSL cert handling, it does a lot).

Mentioning it because I didn't see any other mention of it yet.

NPM is easy to use. Caddy sounds like something I'd like to try too now.

[–] vfsh@lemmy.blahaj.zone 4 points 3 days ago

I've been using NPM for a few years now and can't recommend it enough. I use it to route to both docker containers on an internal proxy network as well at other services within my networks

[–] ohshit604@sh.itjust.works 1 points 2 days ago

I had a poor experience with NPM which turned me to SWAG, it worked, but was a tad slow. Moved to Traefik and haven’t looked back.

load more comments
view more: next ›