Remote wake iMac for plex

Hi all,
So I have only recently discovered plex, yes I know I’m late to the party! The issue I am having is that when I am away from home trying to watch remotely the imac goes offline and I’m guessing this must be because it’s gone to sleep. So this is super annoying as I can’t really watch anything remotely, I have even had to call up the house to get someone to wake it up which is obviously not ideal! What is the easiest way to remotely wake the imac up? Or do I just stop it from sleeping altogether? I guess that’s not going to be very good for it though!
Thanks In advance!

The ‘trick’ to waking up a computer is the “Magic Packet”. You configure your computer to respond to WOL (Wake-on-Lan) requests When any device on your LAN sends the Magic packet (which is the MAC address of the computer) and the computer is configured for this, it will ‘resume’ (wake up from its sleep).

The next step, depending on the sleep state (depth) determines how long and what can be done. When properly configured, your computer will power-on, the OS will start up (or resume from sleep) and PMS will be there as it was. This level of configuration is unique to each.

The next stop in your reading is https://en.wikipedia.org/wiki/Wake-on-LAN

It’s not bad to leave your Mac on, the only bad thing is your power bill will go up a little. You can set it up start up at a certain time and go to sleep at a certain time too.

Thanks for the replies! Is there any way to use wake it when not on local network? Thanks