# How to Lock Your Mac from iPhone

Updated: November 24, 2026

- [Hyperduck](https://sindresorhus.com/hyperduck.md): Send links from your iOS and visionOS devices to your Mac. Price: $5, one-time purchase for all platforms. Platforms: macOS, iOS, visionOS. Get it from: [App Store](https://apps.apple.com/app/id6444667067). Requires macOS, iOS, or visionOS 26 or later. Size: 7 MB on Mac, 13 MB on iPhone and iPad. Free older versions for macOS 15, 14, and 13: [download](https://sindresorhus.com/hyperduck#older-versions). US App Store rating: 4.9/5 (174 ratings).

URL: https://sindresorhus.com/guides/lock-mac-from-iphone

With [Hyperduck](https://sindresorhus.com/hyperduck.md) on your iPhone and your Mac, a shortcut on the iPhone runs a Mac shortcut with the “Lock Screen” action. The Mac locks at once, from anywhere, as it uses iCloud. At the Mac, press Control+Command+Q.

## With Hyperduck

1. Install [Hyperduck](https://sindresorhus.com/hyperduck.md) on your iPhone and on your Mac, with the same Apple Account. Open it on the Mac, and keep it running.
1. On the Mac, make a shortcut in the Shortcuts app with only the “Lock Screen” action, and name it “Lock Mac”.
1. On the iPhone, make a shortcut with the “Run Shortcut on Mac” action of Hyperduck, and type “Lock Mac” in its shortcut field.
1. Run the iPhone shortcut. The Mac locks.

- Turn on “Open Shortcuts URLs in the background” in the settings of Hyperduck on the Mac, so the Shortcuts app does not come to the front before the Mac locks.
- Add the iPhone shortcut to the Home Screen, or say its name to Siri.
- The same setup can [shut down the Mac](https://sindresorhus.com/guides/shut-down-mac-from-iphone.md), or [run any Mac shortcut](https://sindresorhus.com/guides/run-mac-shortcut-from-iphone.md).

The Mac must be awake and online to get the command. To unlock it, you must be at the Mac.

## Without an app

iPhone has no button to lock a Mac. At the Mac, there are fast ways ([Apple’s guide](https://support.apple.com/guide/mac-help/mchl8e8b6a34/mac)):

- Press Control+Command+Q, or choose “Apple menu › Lock Screen”.
- Press Touch ID, or the lock key, on a keyboard that has it.
- **SSH:** If you know the Terminal, turn on “Remote Login” in “[System Settings › General › Sharing](x-apple.systempreferences:com.apple.Sharing-Settings.extension)” on the Mac. Then use the “Run Script Over SSH” action of Shortcuts on the iPhone to run `pmset displaysleepnow`. It turns off the display, and the Mac asks for the password when “Require password after screen saver begins or display is turned off” in “[System Settings › Lock Screen](x-apple.systempreferences:com.apple.Lock-Screen-Settings.extension)” is “Immediately”. It works only when the iPhone can reach the Mac, like on the same network.

Hyperduck is the easy way when you are not at the Mac, like when you left it open at work.
