Here is my setup:

I have multiple DuckDNS domains (and subdomains) pointing to my home IP. My home router has port 80 and port 443 forwarded to Nginx Proxy Manager on my home server. Nginx Proxy Manager points to the appropriate docker container and each one is encrypted with Let's Encrypt.

Am I missing anything here or is this how I'm supposed to be doing it? Every app that has a DuckDNS url has a password in some shape or form.

all 26 comments

sorted by: hot top controversial new old
[–] 16 points 9 months ago (12 children)

My usual additions:

  1. Have the router to block portscanners
  2. fail2ban on internet facing services.
  • source
  • hideshow 12 child comments
  • [–] [S] 3 points 9 months ago (3 children)

    Thanks I'll look into these. Quick question: how does fail2ban use port 80 if that's already used by nginx?

  • source
  • parent
  • hideshow 3 child comments
  • [–] 8 points 9 months ago (2 children)

    It does not. It does not uses ports at all. Fail2ban monitors your logfiles and activates the firewall to block IP's that matched your rules.

    t.ex. You can block an IP that tried to access https:///admin. You can block an IP that used wrong credentials x times to login on an ssh port. Or block one that tried to relay via your mailserver. The duration is configurable and alternative duration can be configured for recidivists.

    And yes, you can whitelist IP's to avoid locking yourself out. The possibilities are endless.

  • source
  • parent
  • hideshow 2 child comments
  • [–] [S] 1 point 8 months ago (1 child)

    I see, the default docker installer for fail2ban gave me an error because "Port 80 was already in use" (by NGINX Manager).

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 8 months ago* (last edited 8 months ago)

    Fail2ban does not listen on any port for it has no user interface. No interface at all actually. It's just a process that monitors your logfiles and changes firewall rules and writes to syslog if you tell it to.

    I run it on internet facing servers so I use a 'regular' install and never docker. I see no advantage for docker in this case, but one huge disadvantage: Docker changes a lot on the network side. It creates bridges, and picks IP's all by itself. I hate that. (I know you can put in a lot of effort to manage it, but no thanks keep your 'hands' of my network config thank you)

  • source
  • parent
  • [–] 3 points 9 months ago* (7 children)
    1. Have the router to block portscanners

    What do you mean by this? Closing unused ports?

  • source
  • parent
  • hideshow 7 child comments
  • [–] 5 points 9 months ago* (last edited 9 months ago) (6 children)

    I'm using RouterOS. In the firewall rules you can create a rule that if an IP touches a port, it get added to a address list (optional with a time-out). So my FW rules begin like this:

    1. If source is whitelisted, Accept (avoid being locked out myself)
    2. If source IP is in the blacklist, drop all
    3. if source IP tries to connect to port 21,22,25,137-139, 113 (and a bunch of others) add it to the blacklist
    4. ....
    5. ....

    So using a portscanner will touch ports I'm not running any service on (like telnet) and you'll be blocked. A time-out of one week on the blacklist usually gives me an blacklist of 6500+ addresses.

    This too has endless possibilities. t.ex. like port knocking. ('touch' one or more ports in a specified sequence in a specified time to be allowed to access the actual service port)

  • source
  • parent
  • hideshow 6 child comments
  • [–] 1 point 9 months ago (3 children)

    This is a waste of time and your router's CPU. You already have a whitelist and know your safe TCP sources, just drop all wan traffic and only allow new input from whitelist. Your chain input rule is just creating a pretty list of bots you're dropping anyway.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 5 points 9 months ago (2 children)

    Well, here is the CPU load:

    And there is no increase on delay's or jitter compared to what i'm already facing on the WAN itself.

    It keep's 6000+ hosts with possible harmful intend away from the ports I need/want open to the world. Actually, the router -while still being bored- offloads the services behind it. I really can't see a reason not to keep doing it. But, sure, it's a personal choice.

  • source
  • parent
  • hideshow 2 child comments
  • [–] -2 points 9 months ago* (last edited 9 months ago) (1 child)

    Delays? Jitter? What are you talking about?

    Didn't you say you have whitelist of allowed ips? Why don't you just drop any other inbound traffic?

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 9 months ago

    whitelist of allowed ips

    Not exactly.

    If source is whitelisted, Accept (avoid being locked out myself)

    So all IP's are allowed to begin with, but some ("my" IP's like at home, my office etc) are on a whitelist ahead of everything else. They can't become blacklisted to avoid myself becoming locked out. Then it's the drop all on the blacklisted, followed by portscan detection. Only after that the 'normal' rules (allow https, smtp etc) begin.

  • source
  • parent
  • [–] 7 points 9 months ago (3 children)

    Networking looks fine, but check fail2ban as the other commenter mentioned, it goes to the npm.

    Make sure to keep all internet facing applications up to date and use strong passwords.

  • source
  • hideshow 3 child comments
  • [–] [S] 5 points 9 months ago (2 children)

    Thanks I'm going to look into fail2ban. I mostly wanted to make sure I wasn't being a total idiot here.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 9 months ago

    Am I missing anything here or is this how I’m supposed to be doing it?

    AFA fail2ban, I always set up the jails in aggressive mode:

    [sshd]
    mode = aggressive
    enabled = true
    port = ssh
    filter = sshd
    logpath = /var/log/auth.log
    maxretry = 5 <---edit to tastes
    bantime = 3600 <---edit to tastes
    findtime = 600 <---edit to tastes
    

    You might want to check out Crowdsec, maybe deploy Tailscale as an overlay. How many users are you providing services for? If just yourself, I use the host allow / host deny feature in Linux. Just make sure you do host allow first, lol.

  • source
  • [–] 3 points 9 months ago

    I'd add Crowdsec

  • source
  • [–] 5 points 9 months ago (1 child)

    Safety is relative. How are you handling every hacker in the world knocking on your door?

    Personally I only expose a VPN and use that, instead of exposing a bunch of services.

  • source
  • hideshow 1 child comment
  • [–] 2 points 9 months ago (1 child)

    If any service has only username and password instead of mfa or password less then it’s not safe.

    You also didn’t mention if you have automated patching or immutable backups enabled.

  • source
  • hideshow 1 child comment
  • [–] [S] 1 point 8 months ago

    If any service has only username and password instead of mfa or password less then it’s not safe.

    None of them do

    You also didn’t mention if you have automated patching or immutable backups enabled.

    I do not. I don't even know what those are tbh

  • source
  • parent
  • [–] [B] 2 points 9 months ago* (last edited 8 months ago)

    Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

    Fewer Letters More Letters
    HTTP Hypertext Transfer Protocol, the Web
    IP Internet Protocol
    TCP Transmission Control Protocol, most often over IP
    VPN Virtual Private Network
    nginx Popular HTTP server

    4 acronyms in this thread; the most compressed thread commented on today has 13 acronyms.

    [Thread #71 for this comm, first seen 7th Feb 2026, 20:10] [FAQ] [Full list] [Contact] [Source code]

  • source
  • [–] 2 points 9 months ago

    You're good in that there are no immediate problems with that setup. I run a largely similar setup, have run it for years, and have never had issues.

    You can always add more security layers if desired, but from my personal experience and with my risk tolerance, I haven't personally found it necessary.

  • source
  • [–] 1 point 9 months ago

    Always risky to be exposed to the internet. unless you can't, you should look into using tailscale/netbird to keep everything within a VPN.

  • source