# urbestack-protected-folder-add

First published 4 Nov 2026 (release 0.2.24) · Unchanged since publication

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-protected-folder-add --user CUSTOMER --path /web/example.com/public_html/private [--no-list-files]
```

## Description

Protects a customer's folder with HTTP Basic authentication. Use the path shown in the Files section, where / represents the customer's home directory. Choose an existing directory served by one of the customer's sites. UrbeStack refuses paths with a symbolic link in any component. Every site whose document root is the folder or contains it requires a username and password for the folder and everything below it. Apache prompts for credentials and denies access until you add a user with urbestack-protected-user-add.

By default, Apache uses Options +Indexes to list files for signed-in visitors when there is no index page. With --no-list-files, Apache returns Forbidden in that case. A site that uses the folder as its document root applies its own directory listing setting.

UrbeStack regenerates the sites' virtual host configurations and reloads Apache immediately.

## Same in the API

- [POST /protected-folders](https://urbestack.com/docs/api/post-protected-folders.md): Protect a folder with HTTP Basic authentication

## Command family: protected

- [urbestack-protected-folder-del](https://urbestack.com/docs/commands/urbestack-protected-folder-del.md): Removes HTTP Basic authentication from a protected folder and deletes its folder users.
- [urbestack-protected-folder-set](https://urbestack.com/docs/commands/urbestack-protected-folder-set.md): Changes whether Apache lists a protected folder's files for signed-in visitors when there is no index page.
- [urbestack-protected-list](https://urbestack.com/docs/commands/urbestack-protected-list.md): Lists password-protected folders for a customer or reseller.
- [urbestack-protected-user-add](https://urbestack.com/docs/commands/urbestack-protected-user-add.md): Adds a user to a customer's password-protected folder.
- [urbestack-protected-user-del](https://urbestack.com/docs/commands/urbestack-protected-user-del.md): Removes the user named by --name from a protected folder and reloads Apache.
- [urbestack-protected-user-set](https://urbestack.com/docs/commands/urbestack-protected-user-set.md): Changes the password, username, enabled status, or access end time of a user in a protected folder.
