
Setting Up a Mac Mini M2 as a Headless Plex Media Server
A personal reference for turning a Mac Mini M2 into a always-on, headless Plex media server on a home network. These notes cover everything from initial macOS configuration to Plex installation and basic maintenance.
Step 1: Initial macOS Setup
Do the initial macOS setup with a monitor attached. Once SSH is configured you can go headless.
Enable Auto-Login
Auto-login is required so the machine boots into a user session automatically after a power outage or reboot — without needing someone to type a password at the login screen.
Note: macOS won't allow auto-login while FileVault is enabled. You'll need to disable FileVault first.
- Go to System Settings → Privacy & Security → FileVault → turn it off
- Wait for decryption to complete
- Go to System Settings → General → Login Items & Extensions → under "Automatically log in as", select your user account
Enable SSH (Remote Login)
Go to System Settings → General → Sharing and enable Remote Login. This gives you SSH access:
ssh username@<mac-mini-ip>
Step 2: Disable Sleep
A media server needs to stay awake. By default macOS will sleep after inactivity, which will interrupt streams and background tasks. Disable all sleep via pmset:
sudo su -
# Never sleep
pmset -a sleep 0
# Never spin down disks
pmset -a disksleep 0
# Never sleep the display
pmset -a displaysleep 0
# Keep Wake on LAN enabled
pmset -a womp 1
# Allow background tasks while "resting" (e.g. Time Machine, spotlight)
pmset -a powernap 1
Verify the settings stuck:
pmset -g
Step 3: Install Homebrew
Homebrew is the package manager for macOS. Most tooling in this setup flows through it.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After install, follow the printed instructions to add Homebrew to your PATH. On Apple Silicon this typically means adding to ~/.zprofile:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
Install necessary things
# Install additional packages
brew install wget zsh jq
# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Install plexUpdate
cd ~ && mkdir Projects && cd Projects
git clone git@github.com:nilicule/plexupdate.gitStep 4: Install Plex Media Server
With our plexUpdate script installed, setting up Plex Media Server is a breeze.
cd ~/Projects/plexupdate
./plex-update.sh --installThen open a browser and navigate to:
http://localhost:32400/web
Sign in with your Plex account and add your media libraries.
Make Plex Launch at Login
To make Plex start automatically on boot, add it to login items:
System Settings → General → Login Items & Extensions → add Plex Media Server.app
Or via the Plex menu bar icon: click it and choose Launch at Login.
Step 5: Assign a Static IP
In your UniFi controller, assign a fixed IP to the Mac Mini via DHCP reservation (based on MAC address). This ensures your Plex server is always reachable at the same address on your local network.
Step 6: Network Access & Optional Port Forwarding
Plex runs on port 32400 by default.
For local network access only, no firewall changes are needed. If you want remote access outside your home network, either:
- Use Plex Relay (included with Plex Pass, no router config needed, but slower)
- Forward port 32400 on your router to the Mac Mini's static IP (faster, direct connection)
In UniFi: Settings → Firewall & Security → Port Forwarding → add a rule for TCP 32400.
Maintenance Notes
Updating Plex
Plex will show an update notification in the menu bar. Download the new .dmg from plex.tv, install over the existing app, and relaunch.
Check Plex Status
# Check if Plex process is running
pgrep -l "Plex Media Server"
# View Plex logs (useful for transcoding issues)
tail -f ~/Library/Logs/Plex\ Media\ Server/Plex\ Media\ Server.log
Plex Data Location
Plex stores its database, metadata, and transcode cache here:
~/Library/Application Support/Plex Media Server/
Back this up if you want to preserve your metadata, watch history, and library state.
Useful pmset Reminder
# Check current power settings
pmset -g
# Check power assertion (what's preventing sleep right now)
pmset -g assertions
Summary Checklist
- [x] macOS initial setup with monitor
- [x] FileVault disabled
- [x] Auto-login enabled
- [x] SSH (Remote Login) enabled
- [x] Sleep disabled via
pmset - [x] Homebrew installed
- [x]
wgetinstalled - [x] Plex Media Server installed and configured
- [x] Plex set to launch at login
- [x] Static IP assigned in UniFi
- [ ] Port forwarding (optional, for remote access)
- [ ] Plex Pass / remote access configured (optional)




Comments