Hey everyone! I'm currently running a Plex server on Windows, but I'm fed up with Windows rebooting unexpectedly, even after trying various fixes. I want to switch to Linux Mint and run Plex in Docker instead. My question is, does Linux really reboot randomly like Windows, or is that just a misconception? Also, can I set up Docker containers to start automatically before I even log into the Linux OS? Thanks for your help!
2 Answers
Regarding your concern about Linux rebooting randomly—no, it generally only reboots when you instruct it to or if there's a major hardware issue. Plus, updates that don’t involve the kernel usually don’t require a reboot.
Also, one of the great things about Docker is its ability to restart containers without the need to reboot the entire system, which really streamlines your setup.
As for starting Docker images before logging in, it depends on your setup, and you should be cautious since this can have security implications. Services typically run either as 'system' or under a 'user,' and most init systems can set services to start at boot. If you’re running a server-oriented distro, this is easier to set up.
You can set your Docker container to restart automatically by using the command `docker run --restart=unless-stopped plex`. The Docker service should be configured to start with your system automatically. If it isn’t, you can enable it using `systemctl enable docker`. This way, even if Linux reboots, your container will start running without needing to log into the system first. Just keep in mind that if you have disk encryption, you’ll need to unlock that before Docker starts.
Awesome answer! Just to clarify, does that mean Docker runs its containers in the background without needing me to log into Linux?
To clarify what you said about enabling the service: instead of just enabling it once after reboot, you can use `systemctl enable --now docker` to both enable and start it.
This is exactly what I wanted to hear! I'm tired of remote accessing my server only to find I need to sign in again and everything is closed.