My setup exists of one local server that basically hosts Jellyfin and an arr stack. I only access this server locally with PC, TV and phone, however I might setup a Wireguard based remote access in the future.

Should I use a reverse proxy like Caddy so I can access the different containers with a local domain name like jellyfin.myserver.local?

I am also interested in hosting Adguard home but how can this work together with Caddy, won’t they both conflict as a DNS server?

I appreciate any possible advice on these topics.

Thank you.

27 points

I like the workflow of having a DNS record on my network for *.mydomain.com pointing to Nginx Proxy Manager, and just needing to plug in a subdomain, IP, and port whenever I spin up something new for super easy SSL. All you need is one let’s encrypt wildcard cert for your domain and you’re all set.

permalink
report
reply
5 points

This is exactly how I have mine set up and I really like it.

I’ve got an internal and external domain with a wildcard cert so if it’s a local only service I can easily create a newservice.localurl.com, and if it’s external I can just as easily set up newservice.externalurl.com

permalink
report
parent
reply
2 points

Can show us how you configured the internal part?

permalink
report
parent
reply
3 points

I can. I’ll report back with details tomorrow when I have time.

permalink
report
parent
reply
3 points

So, this took way longer than I thought it would, mostly because I needed the time to sit down and actually type this up.

Full credit, I followed the instructions in this video from Wolfgang’s Channel

Prerequisites (this is based on my setup, the api key requirement will vary based on your domain registrar/service):

  • Docker & Docker Compose
  • NGINX Proxy Manager running via Docker
  • A registered domain to use for your lan
  • An API key from your domain registrar/service

I’m running NGINX Proxy Manager, using this docker-compose.yml, which I got straight from the NGINX Proxy manager website.

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

I’ve got my domain managed by Cloudflare (yes, I know they’re evil, what company isn’t?), so these instructions will show setup using that, but NGINX Proxy Manager supports a whole bunch of domain services for the HTTP-01 challenge.

With all prerequisites in place, here are the steps:

  • Log in to your NGINX Proxy Mananger (you can access the service and login at port 81 of the machine hosting it)
  • In the top menu, click the SSL Certificates tab
  • Click the Add SSL Certificate button
  • Choose Let’s Encrypt for the certificate type
  • In the Add Let’s Encrypt Certificate dialog, input the following
    • Domain Names: Input the domain root, as well as a wildcard subdomain. You’re entering both domains into the same field. After entering each domain, press the enter/return key on your keyboard to confirm the domain. For example, if you domain is abcde.com, input:
  • Email Address for Let’s Encrypt: Any valid email address you’d like to use
  • Toggle the Use a DNS Challenge option on (when you toggle this on, a new set of options will appear)
    • DNS Provider: Choose yours. I chose Cloudflare
    • Credentials File Content: Delete the prepopulated dummy api key and paste in your actual api key
  • Propagation Seconds: I put in 120 to give it two minutes. You can try leaving it blank, but if the DNS records haven’t propagated, you may get an error (I did when I tried leaving it blank during setup).
  • Toggle on the I Agree to the Let’s Encrypt Terms of Service option - Click Save

Once you get a success message, you can start creating proxies with NGINX Proxy Manager for your internal domain. To do that you will need the ip address and port you are forwarding the domain to for your lan service. If you are using Docker containers, you’ll need the Docker ip, which you can get from the command line with:

ip addr show | grep docker0

You should get an ip address like 172.17.0.1

Otherwise you’ll just need the ip address of the machine you’re running the service on.

To set up a proxy redirect:

  • In NGINX Proxy Manager click the Hosts tab/button and then choose Proxy Hosts.
  • Towards the upper right click the Add Proxy Host button
  • In the New Proxy Host dialog box, input the following:
    • Domain Names: input the domain address (subdomain or tld) you wish to use for the service. For example. homepage.abcde.com, then press enter to confirm the domain
    • Scheme: leave set to http
    • Forward Hostname/IP: Input either the host machine ip, or the docker ip
    • Forward Port: Input the appropriate port for the service
    • Cache Assets: Toggle on
    • Block Common Exploits: Toggle on
    • Websockets Support: Toggle on if the service needs websockets
    • Click the SSL tab of the New Proxy Host dialog box to set up the ssl certificate
    • In the SSL tab, input the following:
      • Click the None under SSL Certificate and select your local domain + wildcard subdomain certificate
      • Toggle on the Force SSL, HTTP/2 Support, HSTS Enabled, and HSTS Subdomains options
      • Click Save

Once the save is complete you should be able to input the new domain for you lan services and get a secure connection.*

*Bear in mind some services require you to specify a valid domain for the service within the config/settings. Double check any services you may be running for this if you plan to use a reverse proxy with them.

permalink
report
parent
reply
2 points

Haven’t forgotten. Just haven’t had time. I’ll get a write up ASAP

permalink
report
parent
reply
21 points

A reverse proxy makes setup a lot easier and more versatile, and can manage SSL certs for you.

permalink
report
reply
14 points
*

Whatever floats your boat. If you don’t need it, you don’t need it. I have some services exposed to the outside on the standard port and I need a reverse proxy to make that possible. It also does the https with letsencrypt certificates. It’s a bit more comfortable managing them all in the reverse proxy. But I also have some webinterfaces of other less important software that is fine running on some IP on port 5102 and I don’t worry configuring something to change that. I don’t think there is a “should” unless you need to encrypt the traffic or expose that service to somewhere. And it’s also not wrong to do it.

permalink
report
reply
12 points

Don’t use jellyfin.server.local

.local is reserved for mdns, which doesn’t support more than one dot. (Though it may still sometimes work).

In any case, to make that work you need either a DNS server on your network or something like duckdns (which supports wildcard entries).

permalink
report
reply
7 points

For people wanting the a very versatile setup, follow this video:

https://youtu.be/liV3c9m_OX8

Apps that are accessed outside the network (jellyfin) are jellyfin.domain.com

Apps that are internal only (vaultwarden) or via wireguard as extra security: Vaultwarden.local.domain.com

Add on Authentik to get single sign on. Apps like sonarr that don’t have good security can be put behind a proxy auth and also only accessed locally or over wireguard.

Apps that have oAuth integration (seafile etc) get single sign on as well at Seafile.domain.com (make this external so you can do share links with others, same for immich etc).

With this setup you will be super versatile and can expand to any apps you could every want in the future.

permalink
report
parent
reply
6 points

Specifically, use home.arpa, if you must use a private domain.

permalink
report
parent
reply
9 points

It’s nice not to deal with HTTPS warnings etc and as you said it’s more convenient to access by domain name rather than remembering port numbers. You should be able to technically achieve the latter in another way by using docker and configuring it to assign a real IP for each service (a bridge network presumably), then setting each service to use port 80 externally. But that’s probably as much work as just setting up a reverse proxy.

And if you’re concerned about exposing ports, you can use DNS challenge which doesn’t require opening port 80 on your router.

permalink
report
reply

Selfhosted

!selfhosted@lemmy.world

Create post

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!

Community stats

  • 4.8K

    Monthly active users

  • 3.5K

    Posts

  • 75K

    Comments