medium.com 7 min read Original Source

5 Ways I Use my M1 Mac Mini as a Home Server!

I don’t pay for an expensive NAS or even a Raspberry Pi.

Apple Silicon Macs are incredible machines. They demolish the playground of inexpensive computers by introducing energy efficient beasts to tackle challenges without breaking a sweat.

Since upgrading to an M3 Mac, my M1 Mac Mini has been collecting dust in the closet. So I wanted to do something useful with it.

Fortunately, being a geek pays off; it made me imagine an inexpensive solution to utilise the Mac Mini as a home server.

I made it work after a month of research, failure, and experiments.

The best part? It’s almost dead-silent and incredibly energy efficient!

The Mac Mini’s power consumption never surpassed 25 watts! And that’s on a full load, streaming 4K content and running multiple apps.

Five ways I use my M1 Mac Mini as a Home Server are to:

  1. Share external drives over network and use it as NAS.
  2. Host a powerful media server and play 4K media on Apple TV.
  3. Get rid of (most) advertisement on my network.
  4. Set up a unified smart home platform to access all my devices easily.
  5. Automate downloading files from the web from an iPhone app.

Network Attached Storage for a Home File Server

Difficulty: Piece of Cake

One of the uses for your spare Mac would be as a home file server. It has a straightforward setup process.

I’ve attached two external HDDs and an SSD. The Mac is connected to a Wi-Fi 6 router through the Gigabit Ethernet port.

On my other Mac, I can quickly transfer large files over the network.

For example, a 3 GB file transfer happens at 200 MB/s while the transfer rate is close to 700 MB/s on the SSD.

The total capacity of my drives is 2 TB of HDD and 256 GB of SSD.

So, it’s fast and efficient. That said, I’m bottlenecked by Ethernet port instead of the Mac’s I/O performance.

To set up a file server on macOS, connect your external drives and check a few boxes. Before doing that though, make sure to:

  1. Format the drives as either exFAT or APFS.
  2. Use a modern connector: preferably USB-C over Thunderbolt.

Once you’ve connected the drives, activate:

Settings → General → Sharing → File Sharing

It will ask for your authentication and you’ll see a URL to access your NAS over the network.

Before trying your NAS, you’ll need to adjust a few settings. On the same screen, click on the Exclamation icon next to the toggle and:

  1. Make sure your username under Users has Read & Write access.
  2. Click on Options and toggle the Share files and folders over SMB, then enable Windows File Sharing to access files from Android and PC.

If you encounter an issue while enabling NAS on your Mac, I recommend flushing the DNS using the following Terminal command:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Plex Media Server to Stream Movies and Shows

Difficulty: Fairly Simple

If you have a catalogue of media files (movies, shows, etc) then I recommend experimenting with Plex.

It’s a media server that works reliably on most platforms with a beautiful, modern and intuitive design.

I host my movies, tv shows, and even specific video files on my external drives, then ask Plex to scan them and prepare the media for playback.

The best thing about Plex is its platform availability. I’ve installed Plex on the Apple TV, Google TV, iPhone, iPad, Mac, PS5, and a PC.

The only downside of Plex is paying the $5 Plex Pass to access all features on each platform. It’s not expensive, however, I believe a single payment for all devices would’ve been better.

Setting up Plex server on macOS is pretty simple. Visit the official Plex Website, click Download and select Plex Media Server.

The installation requires selecting folders for each media type. Once completed, install the Plex client on your devices, choose your Mac, and start streaming. It’s that simple!

The Plex client on iPhone and iPad runs well; however, it’s not a lightweight app. For example, my iPad Pro loses around 20% of battery after playing an hour of a movie.

For an optimal experience, I recommend streaming to an Apple TV.

If your router supports Wi-Fi 6 and has gigabit LAN, I recommend modifying its settings to get the best picture quality.

The Plex official help to set the best Playback Quality is a great help to help you choose the best options for your network environment.

Pi-hole for Network-wide Ad Blocking

Difficulty: A Grind

The best thing about the Internet is people accessing helpful content for growth. However, the worst thing about the Internet is people. Yes, we have incorrectly monetised it by using advertisements.

I recommend paying for the service you intend to use, however, not all services offer a paid option, and some products show ads despite paying for them.

I recommend installing an incredible network-wide ad blocker called Pi-hole to stop seeing ads on all your devices.

Pi-hole requires a dedicated hardware with Linux operating system to run efficiently, however, you can run it on Mac, albeit, setting it up is a bit uneasy.

The easiest way of hosting Pi-hole on macOS is through Docker by creating a new container. If you’re unfamiliar with Docker, you can use the official documentation and set it up on your Mac.

I wouldn’t say running Docker on Mac properly is easy. During installation, there’s a chance you might run into issues, so I suggest watching YouTube videos and reading their documentation before doing anything.

Once you installed Docker, get the Docker Container and install it on your Mac. To access Pi-hole, visit pi.hole/admin and log in to the admin panel.

Once you’re in the admin panel, update filters and configure it to your preferences. I recommend the official Pi-hole docs to configure it properly.

With everything configured in Pi-hole, we need to push all DNS queries through it. You can do it by either:

  1. Manually assigning each device to use your Mac’s IP address for DNS.
  2. Setting your router to use Pi-hole as DNS using the Mac’s IP address.

The benefit of adjusting the router to resolve its DNS queries through Pi-hole is that every device will use Pi-hole.

Setting Pi-hole on the router can get problematic, especially since some products could malfunction due to unresolved DNS requests.

So, I recommend setting each device (that you see fit) to use Pi-hole as its DNS server.

By the way, I tried to get rid of YouTube ads using Pi-hole but couldn’t make it work, so I recommend paying for YouTube Premium or using it through a browser with extensions such as Unblock Origin.

Home Assistant for Unifying All Smart Platforms

Difficulty: No Walk in the Park

After using Home Assistant for over six months, I’ve found Home Assistant to be the answer to make smart home products less dumb.

You can install Home Assistant in two ways:

  1. Easy: A paid App Store app to virtualise the OS.
  2. Difficult: The official route with a Docker image.

I wish there were an official macOS client for Home Assistant, similar to Plex Media server, however the developers decided not to invest in Mac.

Home Assistant offers plenty of features for novice and advanced users; however, the best thing it offers is unifying the access to multiple IoT devices with a single interface.

Using Home Assistant (I’ll be using HA instead of the whole word), you can access your smart home appliances without opening each app separately.

The interface might not be straightforward, especially when you’re new to it, but once you get used to it, you’ll appreciate its flexibility.

Installing HA on Mac is through the official Docker Container, which can be time-consuming. There is an easier but paid option through an app called the Server for Home Assistant by Kenneth Kao available on the App Store.

Whatever your choice, be mindful of HA’s steep learning curve. It’s not too difficult, but it’s also not easy.

I recommend experimenting with the online Demo Panel.

Lastly, I must mention that HA needs a lot of RAM. If you’re running it through the Docker container, it can easily take over 2 GB. If it’s through virtualisation, it can surpass 4 GB.

I wouldn’t recommend installing HA on baseline Macs with 8GB of RAM as that can lead to SWAP memory use and negatively affect your SSD’s health.

Is 16 GB of RAM Enough for Your Mac? The Truth Revealed!
Those Saying 16 GB of RAM is Enough are Misinformed or Wrong.

Transloader to Automate Downloading Files

Difficulty: Child’s Play

The Mac Mini can be a great download manager! I use it to receive download requests and automatically initiate downloads.

My internet often experiences packet loss, high ping times, and fluctuating bandwidth. To compensate for such an experience, I usually download.

The advantage of macOS is that it offers plenty of useful apps. Such as:

  • Downie: To download videos from YouTube and other websites.
  • Folx Pro: To speed up and enhance downloading files from the web.
  • Transloader: To automate downloads without user intervention.
  • Permute: To convert (download) videos into MP4 x265.

Transloader has an iOS app to send download links from an iPhone to a Mac.

Here’s a real scenario to use and download YouTube videos:

While waiting for a ride and watching YouTube, you can click the Share button, choose Transloader, and then choose your Mac.

The file will be downloaded, converted and placed in the desired folder when you arrive home, then it’ll be ready to play through Plex on Apple TV!

If you’re interested in how I automate downloading YouTube videos, leave a comment and I’ll write an article explaining how to do it step by step.

My Experience

Small Tips & Findings

  • Running (decent) LLMs requires over 16 GB of RAM. Despite the Mac’s powerful NPU, I won’t recommend running AI models unless your Mac can handle them.
  • There is no macOS Server! There was one, but sadly Apple discontinued them. No matter how capable Macs can get, they won’t replace a server.
  • Using Mac Mini as a server is an inexpensive solution for small houses.
  • Apple Silicon and Docker are a magical combo for self-hosted projects.
  • RAM limitation is a thing. No matter how well Apple Silicon handles memory consumption, you’ll need over 16 GB of RAM to host server-grade software.
  • Remote desktop from a Mac to another Mac is easy. Still, you’ll need a special software if you want to access it using iPhone, Android, or PC.
  • There is no official solution from Apple to install a native Linux distro on Apple Silicon Macs.

🖤 Thank you for reading my stories on Medium.

🙏🏻 Your generous donations enable me to publish more content.