Get an option during the install that Plex media server is installed as a service so it runs even if you do not logon to the server.
In addition to the guide posted by Otto… there’s already an existing suggestion asking for Plex to add that option. If you still want this (beyond the guide), please comment/vote in that thread in order to help us avoid distracting or cannibalizing votes.
Unless we’ve been missing some unique aspect of your suggestion I’ll close this thread as a duplicate.
2024 clean-up: duplicate