The short answer
Press Control + Command + Q to lock your screen immediately. Locking the screen does not quit your apps and does not put the Mac to sleep, so downloads, renders, backups and music carry on while the screen is secured. The two things people confuse are locking and sleeping: locking hides and protects the screen while the Mac stays awake, whereas sleep suspends the machine and pauses most work. For the lock to actually protect anything you need "Require password after screen saver begins or display is turned off" set to "immediately" in System Settings. If your Mac is also set to sleep on a timer, that timer still applies after you lock, so for a very long unattended job you set the energy options to keep the Mac awake as well.
Locking is not the same as sleeping
This is the distinction that the question hinges on, and it is worth being precise because the two states behave very differently:
- Lock the screen. The screen is hidden behind the login window and a password is required to get back in. The Mac is still awake. Apps keep running, downloads continue, a render keeps rendering, music keeps playing, and the network stays connected. You are securing the view, not stopping the work.
- Sleep the Mac. The system suspends itself to save power. Active downloads and renders stop, and most background work pauses until you wake it. This is what happens when you choose Sleep from the Apple menu or, on a laptop, when you close the lid.
- Display sleep or screen saver. The display turns off or the saver starts, but the Mac itself keeps running, so work continues. This only becomes a lock if you have set the password requirement above. The difference between these dark-screen states is covered in detail in does your Mac lock when it sleeps.
So "lock the screen but keep it running" is not a special trick. It is simply what locking already does, as long as you lock the screen rather than sleeping the whole Mac.
Lock the screen and keep working: Control-Command-Q
The fastest method is the keyboard shortcut. Press Control + Command + Q and the screen locks at once. Nothing you have running is affected: a file copy keeps copying, a compile keeps compiling, a long export keeps exporting. When you come back, you type your password and your work is exactly where you left it.
If you prefer a menu, the Apple menu in the top-left corner has a Lock Screen item that does the same thing. Both routes, and a few others, are laid out in the full guide to how to lock your Mac screen.
What to avoid: closing the lid
On a MacBook, the instinct is to close the lid when you step away. That does lock the screen, but it also puts the Mac to sleep, which is the opposite of what you want when a job is running. A download or render will usually pause until you open the lid again. The exception is clamshell mode, where a laptop connected to power and an external display can stay awake with the lid shut, but for the ordinary case, if you want the work to continue, leave the lid open and lock the screen with the shortcut instead.
Stop the Mac sleeping during a long job
Locking the screen keeps the Mac awake at that moment, but it does not change your energy-saver settings. If your Mac is configured to sleep after, say, twenty minutes of inactivity, it will still sleep after you lock it, because locking the screen still counts as no input. For a quick coffee break this rarely matters; for a multi-hour render or a large overnight download it does. There are two clean ways to hold the Mac awake.
Adjust the energy settings
- Open System Settings.
- Go to Battery on a laptop, or Energy on a desktop Mac.
- Enable the option to prevent automatic sleeping when the display is off, which on laptops is available while on the power adapter. With that on, the display can turn off and the screen can lock, but the system will not sleep, so your task keeps running.
The other way is from the command line. The caffeinate tool keeps the Mac awake for as long as it runs, and it is handy when you want to hold the machine awake only for one task. The important caveat is that caffeinate prevents sleep but does not lock anything, so you pair it with the lock shortcut: start caffeinate, lock the screen with Control + Command + Q, and you have a locked screen on an awake Mac. The guide to locking a Mac from the Terminal covers caffeinate and the related commands in full.
Make sure the lock is actually a lock
None of this protects anything unless macOS is set to demand a password when the screen is hidden. Open System Settings, then Lock Screen, and set "Require password after screen saver begins or display is turned off" to "immediately". Without it, the screen can darken or the saver can start while the Mac stays unlocked, and anyone can tap a key to get straight back in. If your Mac is not locking when you expect it to, the walkthrough in why your Mac is not locking automatically covers the settings that control it.
Lock automatically when you walk away
The shortcut works, but it depends on you remembering to press it every single time you stand up. The reason people search for this in the first place is that they keep forgetting, and an unlocked screen sitting next to a running job is exactly the exposure they were trying to avoid. Presence-based locking removes the need to remember.
This is what Peeku does when you walk away. It watches three signals that all stay on your Mac:
- Face presence from the built-in camera, analysed locally with Apple's Vision framework. No image or video leaves the Mac, and it checks whether a face is present, not who it is.
- An optional Apple Watch proximity gate over Bluetooth, so it only locks when both the camera and the Watch agree you have gone.
- Keyboard and mouse idle time, so a brief pause to read or think does not trigger a lock.
When it decides you have left, Peeku locks the screen using the screen saver and display sleep, which secures the view without suspending the system, so the lock itself does not stop a running task, in the same way the manual shortcut does not. All detection runs on-device, which is the reasoning behind Peeku's privacy-first design. Two honest caveats apply. Peeku needs the same "Require password immediately" setting to make its lock secure, and the same energy options above if you want the Mac to keep working through a long job; and the full locking app ships free outside the Mac App Store, on Gumroad and as a notarised DMG, because the App Store sandbox blocks the screen-lock calls it relies on. The two-minute setup guide covers the whole sequence.
Quick reference
- Lock the screen, keep working: press
Control+Command+Q, or use the Apple menu's Lock Screen item. Apps, downloads and music keep running. - Locking is not sleeping: a locked screen stays awake; sleep suspends the Mac and pauses work.
- Avoid closing the lid on a MacBook unless you are in clamshell mode, because it sleeps the Mac.
- For a long unattended job, also prevent system sleep in Battery or Energy settings, or run
caffeinatealongside the lock. - Make it secure: set "Require password immediately" or a dark screen is not a locked screen.
- Stop relying on memory: presence-based locking locks the screen the moment you walk away, while your task keeps running.
Lock the screen the moment you leave, without stopping your work
Peeku locks your Mac when you walk away, using on-device presence detection with an optional Apple Watch gate. It secures the screen without putting the system to sleep, so your downloads, renders and backups keep running. Free, no account, no cloud face data, and all detection stays on your Mac.
macOS 14+, Apple Silicon. About 3.1 MB. Developer ID signed and notarised. Pay what you want on Gumroad (₹0 option available).
Free Mac App Store build
Prefer the App Store path?
Install Peeku Presence Coach for eye-rest nudges, walk reminders, optional Desk Health, and private local presence signals. The full walk-away lock still needs the direct Mac build because the App Store sandbox blocks automatic screen-lock commands.