By default you can't: closing the lid puts a MacBook to sleep, and Spotify, Apple Music and AirPlay stop with it. Apple's built-in exception needs an external display, keyboard, mouse and power. To keep music playing with only the lid shut, arm Clamshell for Mac before you close it.
Clamshell for Mac keeps the Mac awake with the lid closed while armed, so the app that is playing keeps playing. Free for 7 days.
Download free trialApple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99
You want to fold the laptop away and keep a playlist going: on the desk, beside the bed, or feeding a speaker across the room. A MacBook does not allow that by default, and no setting in System Settings changes it without an external display. This guide explains why the music stops, which free fixes really work, and how to keep music playing with the lid closed and nothing plugged in.
Why does music stop when I close my MacBook?
Closing the lid is one of Apple's documented ways to put a Mac laptop to sleep. In sleep the Mac is still on but draws much less power, and apps stop running. Spotify, Apple Music, a browser tab or a podcast app all go quiet at the same moment, whether the sound was going to the built-in speakers, headphones, a Bluetooth speaker or an AirPlay speaker.
The one built-in exception is closed-display mode. Apple's guidance says a closed Mac laptop driving an external display should be connected to power and use an external keyboard and mouse. That is a desk setup, not a way to fold the laptop and walk away.
Free ways to keep music playing
Try these first. Each one works for a specific situation, and none of them costs anything.
Lid open, display off, on power
In System Settings, Lock Screen, set Turn display off on power adapter when inactive to a short time. Then in Battery, Options, turn on Prevent automatic sleeping on power adapter when the display is off. Both are in Apple's sleep settings guide. The screen goes dark and the music keeps playing, as long as the lid stays up.
Lid open on battery
Run caffeinate -i in Terminal. It holds off idle sleep until you press Control-C. It does not stop sleep when the lid closes: here is why.
Let the speaker stream, not the Mac
Spotify says Spotify Connect lets you use one device to remotely control listening on another (as of October 2026). If your speaker supports it, start playback on the speaker from your phone and the Mac is not involved, so it can sleep. Playing from your iPhone over AirPlay leaves the Mac out too. The best fit when you only need music in the room.
Closed-display mode at a desk
With an external display, keyboard, mouse and power connected, the closed MacBook stays awake and keeps playing. The best fit if you already work that way.
Keep music playing with the lid closed, no monitor
When the Mac itself has to be the player, for a local library, a DJ app, a browser stream or an AirPlay or Bluetooth speaker, the Mac has to stay awake with the lid down. Clamshell for Mac does that while armed: no external display, no sudo, no admin password, no kernel extension. It needs an Apple Silicon MacBook on macOS 14 or later.
- Install Clamshell and open it once. It lives in the menu bar.
- Start the music and pick the output. Choose the speaker or headphones in the app or in Control Center while the lid is still open.
- Disconnect external displays. With a display connected Clamshell pauses (yellow menu bar icon) instead of arming. It arms automatically once displays disconnect.
- Arm it. Arming from the menu bar menu covers the next close only. Holding Option while you close the lid is also a one-close action, on a MacBook Air M2 (2022) or later or a 14-inch or 16-inch MacBook Pro (2021) or later. Arming from the right-click menu or a Shortcuts action stays on across reopenings until you disarm.
- Check the armed state, then close the lid. The built-in display stays black while the Mac keeps playing. When you open the lid again, the Mac locks.
Does it work with AirPlay, Bluetooth speakers and headphones?
Clamshell does not change your audio output or routing. It keeps the Mac awake, so the app that was playing keeps playing to whatever output macOS was already using. The Mac also stays on the network, which AirPlay and streaming apps need.
Before you rely on it for a long session or at night, play a short track, arm Clamshell, close the lid and listen for a minute. That one check covers your exact app, speaker and headphones.
One thing does change with the lid down: Apple disconnects the built-in microphone in hardware whenever the lid of an Apple silicon MacBook is closed. Listening is fine. For calls, use a headset or an external microphone.
Battery and heat while the music plays
- Battery works. Clamshell keeps the Mac awake on battery and through plug and unplug changes. The optional Disarm on low battery setting (off by default) lets the Mac sleep below a level you choose. More in keeping a MacBook awake with the lid closed on battery.
- Heat is watched. If macOS reports serious or critical thermal pressure, Clamshell disarms toward normal lid sleep and blocks arming until the Mac cools. That is a backstop, not a reason to play music from a closed bag: see running a MacBook with the lid closed in a bag.
- Normal sleep comes back. Disarm or quit and normal lid sleep returns. Clamshell's lid change is never saved across a restart.
Clamshell keeps your Mac awake with the lid closed. Free for 7 days, then $9.99 once for one Mac. 14-day money-back guarantee.
Download free trialWhich option fits you
Music in the room, speaker supports Spotify Connect
Use Spotify Connect from your phone. Free, and the Mac can sleep.
Lid can stay open on the desk
Turn the display off and prevent automatic sleep on power. Free and built in.
Monitor, keyboard and mouse already on the desk
Closed-display mode is Apple's supported setup.
Lid closed, nothing plugged in
Clamshell keeps the Mac awake while armed, on power or battery.
Other keep-awake apps and caffeinate mostly prevent idle sleep, not lid-close sleep. sudo pmset -a disablesleep 1 does keep a closed Mac awake, but as a global admin switch with no timer: see what pmset disablesleep does and how to undo it.
Frequently asked questions
Can a MacBook play music with the lid closed?
Not by default. Closing the lid puts a MacBook to sleep and playback stops. Music keeps playing with the lid closed in Apple's closed-display mode, which needs power, an external display, keyboard and mouse, or with a lid-sleep tool such as Clamshell for Mac that keeps the Mac awake.
Does Spotify keep playing when I close my MacBook?
Not from the Mac itself, because the Mac goes to sleep. If your speaker supports Spotify Connect, start playback on the speaker from your phone and the Mac does not need to stay awake at all. To keep Spotify on the Mac playing with the lid shut, keep the Mac awake with Clamshell.
Will AirPlay keep working with the MacBook lid closed?
AirPlay from a Mac needs the Mac awake, so it stops when the lid closes and the Mac sleeps. With Clamshell armed the Mac stays awake and on the network, so the app sending the audio keeps playing. Test it once with a short track before you rely on it.
Can I keep music playing on battery with the lid closed?
Yes, with Clamshell. It works on battery and keeps working when you plug in or unplug. An optional Disarm on low battery setting, off by default, lets the Mac sleep below a level you choose.
Can I take a call with the MacBook lid closed?
Use a headset or an external microphone. Apple disconnects the built-in microphone in hardware whenever the lid of an Apple silicon MacBook is closed. Sound output can keep going as long as the Mac stays awake.
Related guides
- Keep a MacBook awake with the lid closed
- Keep a MacBook awake with the lid closed on battery
- Clamshell mode without an external display
- Does a MacBook keep downloading with the lid closed?
- Use a MacBook as a home server with the lid closed
- Running a MacBook with the lid closed in a bag
Sources checked October 5, 2026: Apple's guides on putting a Mac to sleep, sleep and wake settings, closed-display mode and hardware microphone disconnect, and Spotify's Spotify Connect support page. Clamshell behavior is described from its changelog and FAQ. Clamshell is an independent app, not affiliated with or endorsed by Apple or Spotify. Spotify and AirPlay are trademarks of their owners.