Finderlock logoFinderlock

Finderlock

File protection that lives in Finder.

Sign in
All posts
mac folder lockchflagsmac encryptionfile protectionmacos permissions

How to Lock a Folder on Mac to Not Be Deleted (and Keep It Private)

How to lock a folder on Mac to not be deleted, edited, or opened: Finder's Locked flag, chflags, permissions, and when encryption is the right tool.

11 min read

To stop a folder being deleted or edited by accident, turn on the Locked checkbox in Finder's Get Info window, or run chflags uchg on it in Terminal. Neither is security, because anyone using your account can undo it in a few seconds. If you need to stop other people opening the folder, you need encryption, not a flag.

"Lock" means three different things on a Mac, and each has a different tool. This guide covers all three, says what the built-in options can and can't do, and shows where an encryption app fits.

Decide what you mean by "lock"

Goal What you want Right tool
1. Stop accidents Nobody (including you) deletes or edits files by mistake Locked flag, chflags, read-only permissions
2. Stop others opening it Someone with your Mac or a copy of the files can't read them Encryption
3. Stop sharing The folder isn't visible or editable by other people over the network or cloud Sharing settings

Most searches for how to lock a folder on Mac to not be deleted are goal 1. Start there, but read the limits before you rely on it.

Goal 1: Protect a folder from accidental deletion or editing

Method A: The Locked checkbox in Finder

  1. Select the folder in Finder.
  2. Press Command-I to open Get Info.
  3. Check Locked in the General section.

Finder now treats the item as protected. Trying to change or delete it gives you a warning or an error instead of quietly succeeding. This is the easiest option, and it is good for keeping an archive or a template folder from being altered by a stray drag.

To undo it, open Get Info again and uncheck Locked. That is the whole security model: anyone who can open Get Info on the item can remove the lock.

Method B: chflags in Terminal

The Locked checkbox sets the "user immutable" flag. You can set the same flag from Terminal, and apply it to everything inside a folder:

# Lock the folder itself
chflags uchg ~/Documents/Project

# Lock the folder and everything inside it
chflags -R uchg ~/Documents/Project

# Check the flags (look for "uchg")
ls -ldO ~/Documents/Project

# Unlock it again
chflags -R nouchg ~/Documents/Project

After this, commands like rm fail with "Operation not permitted" until the flag is cleared. As far as I know, the Finder checkbox on a folder affects the folder itself, while -R is what covers the files inside. Try it on a dummy folder first to see exactly what is blocked on your version of macOS.

Warning: chflags -R touches every file under the path. Double-check the path before you run it, and never point it at your home folder or system directories. If you lock files that an app needs to write to, that app will start showing errors until you unlock them.

Method C: Read-only permissions

Permissions are a different mechanism from the Locked flag.

  1. Select the folder and press Command-I.
  2. Expand Sharing & Permissions at the bottom.
  3. Click the padlock and authenticate.
  4. Change your own user's privilege to Read only.

In Terminal, the equivalent is:

# Remove write permission for everyone on the folder and its contents
chmod -R a-w ~/Documents/Project

# Restore write permission for you (the owner)
chmod -R u+w ~/Documents/Project

Read-only permissions stop edits to the files inside, which is often what people want. They are not the same as "can't be deleted". Removing an item depends partly on the permissions of the folder that contains it, so a read-only folder sitting in a writable location may still be movable. Test with a throwaway folder rather than assuming.

What these three methods do well, and where they fall short

Method Blocks accidental delete/edit Stops someone else reading it Easy to undo by anyone on your account
Locked checkbox Yes, for most everyday mistakes No Yes, one click
chflags uchg Yes, rm and Finder both respect it No Yes, one command
Read-only permissions Blocks edits to contents; deletion depends on the parent folder No Yes, for the owner or any admin

Two things to be clear about:

  • The Locked flag is a safety catch, not a lock. It protects you from yourself. It does nothing against another person sitting at your unlocked Mac.
  • Admin users can change permissions. If someone has an admin account on the Mac, or can use sudo, read-only permissions don't stop them. Permissions also say nothing about the data once it's copied elsewhere, such as onto a USB drive.

None of these hide the contents. Files remain fully readable by anyone with access to your account or the disk.

Goal 2: Stop other people opening the folder

If the real concern is privacy, such as tax records, client files, or a shared Mac, you need encryption. An encrypted container is unreadable without the password or key, whether or not someone can change flags or permissions.

macOS gives you a few built-in options:

  • FileVault encrypts the whole startup disk. It protects a powered-off or locked Mac well, but once you are logged in, your folders are readable to anyone using that session. It doesn't help with a single folder you want to close again.
  • Encrypted disk images made with Disk Utility or hdiutil protect a single folder behind a password.
  • Encrypted ZIP files are portable but have their own pitfalls. We cover them in how to password protect a ZIP file on Mac.

For a side-by-side look at the options, see how to password protect a folder on Mac: 4 encryption options compared.

Build an encrypted disk image yourself

This works with nothing but macOS:

  1. Open Terminal.
  2. Run the command below, adjusting the path and name. It prompts you for a password.
hdiutil create -encryption AES-256 -srcfolder ~/Documents/Project \
  -volname "Project" -fs APFS ~/Documents/Project.dmg
  1. Double-click Project.dmg, enter the password, and confirm your files are inside.
  2. Eject the volume when you are done. Re-open it with the password whenever you need the files.

Warning: This command copies the folder. Your original, unencrypted folder is still where it was. Only delete it after you have mounted the image and checked that everything is in there, and keep in mind that a normal delete does not securely erase data. If you forget the password, the image can't be opened, so store it in a password manager.

This is a sound approach, and it is what other tools build on. The downsides are the manual work: you create the image, mount it, remember to eject it, and clean up the original. A mounted image stays open until you eject it.

Goal 3: Stop sharing a folder

Sharing is a separate setting from locking, and it is easy to get wrong because it lives in different places:

  • Local network sharing: open System Settings > General > Sharing, check whether File Sharing is on, and remove the folder from the shared list if it is there.
  • iCloud Drive or other cloud folders: in Finder, a shared folder can be managed from the Share menu, where you can stop sharing or change who can edit. The exact menu wording varies by macOS version.
  • Dropbox, Google Drive and similar: use that app's own sharing controls. A local Finder lock does not change what the cloud service allows.

Stopping sharing does not protect a folder from someone using your Mac. It only controls who can reach it from elsewhere.

When encryption is the right answer

Use encryption when any of these is true:

  • Other people use the Mac, or it could be lost or stolen while logged in or unlocked.
  • The folder holds sensitive data, such as financial, medical, legal, or client material.
  • You want the folder closed by default and opened only when you need it.
  • You want protection that does not depend on someone not clicking a checkbox.

Use the Locked flag when the threat is your own mistakes and nothing else. You can also combine them: encrypt what is private, and flag what is precious but harmless to read.

How Finderlock handles it

Finderlock is a macOS app (macOS 13.5 or later; the Finder right-click menu and badges need macOS 14) that does the encryption for you instead of disk images you manage yourself. It encrypts the files or folders you choose into their own AES-256-GCM containers (Apple CryptoKit, key derived from your password with PBKDF2-HMAC-SHA256). If you want the details, see the security page.

To protect a folder:

  1. Right-click the folder in Finder and choose Protect.
  2. Choose a password for that item, or use Touch ID on plans that include it. The credential is stored in the macOS Keychain.
  3. Finderlock encrypts the contents into its own container and leaves a placeholder file at the original location.
  4. To open the folder again, double-click the placeholder. It unlocks without opening the main app window. Right-click gives you Lock and Unlock whenever you want to do it by hand.

You can also add items from the menu bar app or the dashboard, which has search and drag-and-drop. Auto-lock can close items after inactivity or when the Mac sleeps. Lock-on-close notices when the app that opened a file quits and locks the item again. On Pro, smart rules extend this to logout, user switching, the screen saver, system lock, and process exceptions.

What Finderlock does not do

Be clear on this part. Finderlock is encryption, not a deletion shield. The protected data lives inside the encrypted container, and the placeholder at the original location is a stand-in for it. Don't treat the placeholder as something that can't be removed. Use the same care you would with any other file, and keep a backup of what matters.

Finderlock can back up encrypted containers to iCloud or Google Drive, and it has a recovery tool that uses your master password. The backups are the encrypted containers, so the cloud copy stays encrypted. If you also want protection against accidental deletion, you can combine Finderlock with Time Machine or another backup of your own.

Everything runs locally. The only network use is the license check, optional opt-in analytics, updates, and any backup destination you choose.

Plans

Plan Protected items Touch ID Extras
Free 3 No Core protect, lock, unlock
Personal ($49) Unlimited Yes 2 devices
Pro ($99) Unlimited Yes Bulk operations, smart auto-lock, 5 devices
Lifetime ($149) Unlimited Yes Pro features, secure shredding, unlimited devices

Pricing is one-time. Secure shredding uses a multi-pass overwrite and is Lifetime only. Don't rely on shredding to erase data on an SSD.

The free plan covers three protected items, which is enough to try it on your most sensitive folders. If you're still comparing, see best Mac encryption apps or the FileVault alternative page, and check the docs for setup details.

FAQ

Can I make a folder on Mac impossible to delete?

Not completely. The Locked flag or chflags uchg blocks normal deletion until someone clears it, but the owner or an admin can clear it in seconds. For anything important, keep a backup, because no built-in setting makes deletion truly impossible.

How do I unlock a folder that is locked on Mac?

Select it, press Command-I, and uncheck Locked. In Terminal, run chflags -R nouchg followed by the folder path. If you changed permissions instead, restore write access in Sharing & Permissions or with chmod -R u+w.

Is the Locked checkbox in Finder secure?

No. It prevents accidental changes, but anyone who can open Get Info on the item can uncheck it. It also does not hide or encrypt the contents.

How do I password protect a folder on Mac?

macOS has no single "password protect folder" switch. The usual routes are an encrypted disk image, an encrypted archive, or an app that manages encrypted containers for you. Our comparison of four options walks through each.

Does FileVault protect a single folder?

FileVault encrypts the whole disk, so it protects your data when the Mac is off or locked. It does not add a separate password to one folder while you are logged in. For that, use an encrypted container.

Next step

Pick the goal that matches your problem. For accidental deletes, set the Locked flag and keep a backup. For privacy, encrypt the folder. If you would rather not manage disk images by hand, try Finderlock free with up to three protected items, and read the troubleshooting page if anything behaves unexpectedly.