Desert Forge IT — Game Hosting from $2/weekGet a Server →

How to Host a Minecraft Server on Mac

Beginner 20 min — Run a Paper Minecraft server on macOS, works on both Intel and Apple Silicon.

What You Need

  • macOS 13 Ventura or newer (Sonoma and Sequoia both work great)
  • Java 21 — we'll install it in the next step
  • 4 GB of free RAM — the server itself needs 2 GB minimum; your Mac needs headroom for macOS and other apps
  • A stable internet connection — wired Ethernet is ideal, but strong Wi-Fi works
  • Intel or Apple Silicon (M1/M2/M3/M4) — both are fully supported

1. Install Java 21

Minecraft 1.20.5+ requires Java 21. The easiest way to install it on macOS is with Homebrew.

Option A — Homebrew (recommended):

If you already have Homebrew installed, open Terminal and run:

brew install --cask temurin@21

If you don't have Homebrew yet, install it first:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then run the brew install command above.

Option B — Manual download:

Go to adoptium.net, download the macOS .pkg installer for Temurin 21 (choose aarch64 for Apple Silicon or x64 for Intel), and run through the installer.

Verify the installation in Terminal:

java -version

You should see output containing openjdk version "21 followed by the build number. If you see this, Java is ready.

2. Download the Server

We'll use Paper, a high-performance Minecraft server that is fully compatible with vanilla clients and supports plugins.

  1. Go to papermc.io/downloads/paper and download the latest Paper jar.
  2. Open Terminal and create a folder for your server:
mkdir -p ~/MinecraftServer
  1. Move the downloaded jar into the folder and rename it:
mv ~/Downloads/paper-*.jar ~/MinecraftServer/paper.jar

3. First Run

Navigate to your server folder and start the server for the first time:

cd ~/MinecraftServer
java -Xmx2G -Xms2G -jar paper.jar

The server will generate some files, then stop with a message about the EULA. You need to accept the Minecraft EULA before the server will run.

Open eula.txt in a text editor:

nano ~/MinecraftServer/eula.txt

Change eula=false to:

eula=true

Save the file (Ctrl+O, then Enter, then Ctrl+X to exit nano). You can also open eula.txt in TextEdit if you prefer a graphical editor.

4. Configure server.properties

After the first run, you'll find a server.properties file in ~/MinecraftServer/. Open it in any text editor:

nano ~/MinecraftServer/server.properties

Key settings to review:

  • server-port=25565 — the default Minecraft port; change only if you have a reason to
  • motd=A Minecraft Server — the message players see in the server list
  • max-players=20 — adjust based on your Mac's resources
  • gamemode=survival — options: survival, creative, adventure, spectator
  • difficulty=easy — options: peaceful, easy, normal, hard
  • white-list=false — set to true if you only want approved players to join
  • online-mode=true — keep this true to verify player accounts with Mojang
  • view-distance=10 — lower this (e.g., 8) if you notice lag

Save and close the file when you're done.

5. Start the Server

Run the server again:

cd ~/MinecraftServer
java -Xmx2G -Xms2G -jar paper.jar

Wait until you see a line like Done (12.345s)! For help, type "help" — your server is now running.

To make starting easier, create a shell script:

cat > ~/MinecraftServer/start.sh << 'EOF'
#!/bin/bash
cd ~/MinecraftServer
java -Xmx2G -Xms2G -jar paper.jar
EOF

chmod +x ~/MinecraftServer/start.sh

Now you can start your server anytime by double-clicking start.sh in Finder (it will open in Terminal) or running:

~/MinecraftServer/start.sh

6. Connect Locally

Open Minecraft Java Edition on the same Mac (or any computer on the same network):

  1. Click Multiplayer
  2. Click Add Server
  3. For the server address, enter localhost (if playing on the same Mac) or your Mac's local IP (if playing from another device on your network)
  4. Click Done, then double-click the server to join

7. Port Forwarding

To let friends outside your home network connect, you need to forward port 25565 on your router.

First, find your Mac's local IP address:

ifconfig | grep "inet " | grep -v 127.0.0.1

Or go to System Settings > Network, click your active connection (Wi-Fi or Ethernet), and look for the IP address.

Then log in to your router (usually 192.168.1.1 or 192.168.0.1 in a browser) and find the port forwarding section. Create a rule:

  • Protocol: TCP
  • External port: 25565
  • Internal IP: your Mac's local IP (e.g., 192.168.1.42)
  • Internal port: 25565

Find your public IP by searching "what is my IP" in a browser, and share that address with friends. They'll enter it as the server address in Minecraft.

8. macOS Firewall

macOS has a built-in application firewall that may block incoming connections to Java.

Using System Settings:

  1. Open System Settings > Network > Firewall
  2. If the firewall is on, click Options
  3. Make sure Java (or java) is listed and set to Allow incoming connections

Using Terminal:

Find where Java is installed and add it to the firewall allow list:

# Find the Java binary path
JAVA_PATH=$(/usr/libexec/java_home -v 21)/bin/java

# Allow it through the firewall
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add "$JAVA_PATH"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "$JAVA_PATH"

If macOS shows a pop-up asking "Do you want the application java to accept incoming network connections?", click Allow.

9. Keep It Running

If you close the Terminal window, the server stops. Here are ways to keep it running:

Option A — screen (simple):

# Install screen via Homebrew (if not already installed)
brew install screen

# Start the server inside a screen session
screen -S minecraft ~/MinecraftServer/start.sh

Press Ctrl+A then D to detach. The server keeps running in the background. Reattach anytime with:

screen -r minecraft

Option B — tmux (alternative):

brew install tmux
tmux new -s minecraft
~/MinecraftServer/start.sh

Press Ctrl+B then D to detach. Reattach with tmux attach -t minecraft.

Option C — launchd (auto-start on boot):

Create a launch agent so the server starts automatically when you log in:

cat > ~/Library/LaunchAgents/com.minecraft.server.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.minecraft.server</string>
  <key>ProgramArguments</key>
  <array>
    <string>/bin/bash</string>
    <string>-c</string>
    <string>cd ~/MinecraftServer && java -Xmx2G -Xms2G -jar paper.jar</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>WorkingDirectory</key>
  <string>/Users/YOUR_USERNAME/MinecraftServer</string>
  <key>StandardOutPath</key>
  <string>/Users/YOUR_USERNAME/MinecraftServer/server.log</string>
  <key>StandardErrorPath</key>
  <string>/Users/YOUR_USERNAME/MinecraftServer/server-error.log</string>
</dict>
</plist>
EOF

Replace YOUR_USERNAME with your macOS username (run whoami in Terminal to check). Then load it:

launchctl load ~/Library/LaunchAgents/com.minecraft.server.plist

10. Backups

Your world data lives in ~/MinecraftServer/world/ (plus world_nether/ and world_the_end/). Back up these folders regularly.

A quick manual backup:

cp -r ~/MinecraftServer/world ~/MinecraftServer/backups/world-$(date +%Y%m%d-%H%M%S)

Or create a simple backup script:

cat > ~/MinecraftServer/backup.sh << 'EOF'
#!/bin/bash
BACKUP_DIR=~/MinecraftServer/backups
mkdir -p "$BACKUP_DIR"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
tar czf "$BACKUP_DIR/world-$TIMESTAMP.tar.gz" \
  -C ~/MinecraftServer world world_nether world_the_end
echo "Backup saved: world-$TIMESTAMP.tar.gz"
EOF

chmod +x ~/MinecraftServer/backup.sh
Want automatic backups?

Desert Forge Backup handles world file backups automatically with AES-256 encryption and zero egress fees.

Set up Backup

11. Troubleshooting

  • java: command not found: Java isn't installed or isn't in your PATH. Run brew install --cask temurin@21 or download the installer from adoptium.net. If you installed Java manually, open a new Terminal window and try again.
  • Apple Silicon compatibility: Temurin 21 has native ARM (aarch64) builds for Apple Silicon. Make sure you download the aarch64 version, not x64, for the best performance. If you used Homebrew, it automatically picks the correct architecture.
  • Can't connect from outside your network: Double-check your port forwarding rule on the router, verify the macOS firewall allows Java (see section 8), and confirm port 25565 is open by asking a friend to try connecting or using an online port checker.
  • Energy Saver / sleep issues: macOS may put your Mac to sleep after a period of inactivity, which kills the server. Go to System Settings > Energy Saver (or Battery > Options on laptops) and enable Prevent automatic sleeping when the display is off. You can also run caffeinate -s in a separate Terminal window to prevent sleep while the command is running.
  • Server lag or low TPS: Lower view-distance in server.properties (try 8 or 6). If you have 8 GB+ RAM, increase the server memory: -Xmx4G -Xms4G. Close other heavy applications while the server is running.
  • Port already in use: Another process is using port 25565. Find it with lsof -i :25565 and stop it, or change server-port in server.properties.
Don't want to leave your Mac running?

Desert Forge Game Hosting gives you a Minecraft server that's always online — from $2/week, no configuration required.

Get a server

← Back to all guides