this post was submitted on 01 Mar 2025
27 points (96.6% liked)

Selfhosted

48649 readers
566 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've got a mini pc which is running always and another one which consumes a lot more power for e.g. jellyfin.

Can I configure it such that the jellyfin server only boots if I connect to it? E.g. I try to connect to jellyfin.y.com and then the server boots because the mini pc tries to connect to it.

I already figured out how to let it sleep automatically as soon as nobody is watching.

Edit: can I add the magic package to the reverse proxy?

top 34 comments
sorted by: hot top controversial new old
[–] Dragonish@lemmy.dbzer0.com 36 points 3 months ago (2 children)

If you have a reverse proxy running on the mini pc and handling jellyfin.y.com then there is this plugin which will send the WoL packet to the jellyfin server when a request is sent.

https://github.com/dulli/caddy-wol

[–] enemenemu@lemm.ee 6 points 3 months ago (1 children)

Thanks!

I use nginxproxymanager, I'll try to find something similar (I couldn't find something directly)

[–] enemenemu@lemm.ee 1 points 3 months ago

Thanks again! I managed to set up caddy and it works well so far. Now I am stuck at installing (or using xcaddy. I installed go and the package xcaddy but to me the doc lacks one or two steps. Do you know any tutorial covering that? Thanks!

[–] AbouBenAdhem@lemmy.world 19 points 3 months ago (1 children)
[–] enemenemu@lemm.ee 4 points 3 months ago* (last edited 3 months ago) (1 children)

Thanks! I use wake on lan with rtcwake to boot at a certain time. I also found an app via which I can boot the server via wake on lan. But it would be nice if it could wake up just by requesting the service

[–] sxan@midwest.social 2 points 3 months ago (1 children)

That's how it works. Wake-on-LAN wakes the computer if the computer receives a network request. Which is the same thing you're asking for, right?

[–] lemming741@lemmy.world 2 points 3 months ago

But it has to be a magic packet, not just any ole request.

[–] ShepherdPie@midwest.social 6 points 3 months ago (1 children)

I think you'll want to look into Wake On LAN to do this. I can't give you instructions (tried once unsuccessfully on a Windows installation) but that should be enough to get you started.

[–] enemenemu@lemm.ee 2 points 3 months ago* (last edited 3 months ago)

Thanks! I use wake on lan with rtcwake to boot at a certain time. I also found an app via which I can boot the server via wake on lan. But it would be nice if it could wake up just by requesting the service

[–] 30p87@feddit.org 5 points 3 months ago (1 children)

Also an option, systemd based, could be to use systemd socket files, which (as far as I understand) opens a dummy socket and starts the matching service as soon as it's requested.

[–] enemenemu@lemm.ee 3 points 3 months ago* (last edited 3 months ago) (1 children)

I love systemd.

Is this what you suggest? https://cybso.de/blog/2017-02/how-wake-lan-remote-host-demand-using-systemds-sockets/

This sounds like a proxy that sends a magic packet if it can't reach the service. That sounds great

[–] 30p87@feddit.org 3 points 3 months ago

Basically yeah, though other solutions may be easier or more integrated. Using systemd sockets is especially useful if you want to start a service on the local server that is always on, with a service that uses a lot of resources in the background without other user interaction

[–] Mubelotix@jlai.lu 2 points 3 months ago (1 children)

I made a tool that can hibernate systemd services when no request get through their associated nginx service. Using it on jellyfin, works great

[–] sugar_in_your_tea@sh.itjust.works 2 points 3 months ago (1 children)

I assume this works like the reverse of socket activation? If so, that's pretty rad!

That said, that doesn't really solve OP's problem, and I'm not exactly sure what it's solving for you. Jellyfin doesn't really use any resources when idle, so it's not going to save on power or anything like that.

That said, you could probably create an interesting service like this. Basically, if the last interesting service shuts down, you shut the whole machine down, and then use WoL to start it back up when someone wants it. Tune it a bit to reduce how often it reboots (i.e. extend life of your disks) and reduce boot times (i.e. don't mount the RAID until it's needed), and it could be really cool!

[–] Mubelotix@jlai.lu 2 points 3 months ago (1 children)

Exactly. It's like socket activation but plugged into nginx. It might or might not fit OP's use case, as when you have many small services like jellyfin, ram usage starts adding up. Adding automatic shutdown is a great idea

I can see that, especially if running on limited hardware. My server has way more RAM than it needs though (16GB), so saving 50MB here and there isn't very important.