content/manuals/compose/how-tos/project-name.md
By default, Compose assigns the project name based on the name of the directory that contains the Compose file. You can override this with several methods.
This page offers examples of scenarios where custom project names can be helpful, outlines the various methods to set a project name, and provides the order of precedence for each approach.
[!NOTE]
The default project directory is the base directory of the Compose file. A custom value can also be set for it using the
--project-directorycommand line option.
Compose uses a project name to isolate environments from each other. There are multiple contexts where a project name is useful:
Project names must contain only lowercase letters, decimal digits, dashes, and underscores, and must begin with a lowercase letter or decimal digit. If the base name of the project directory or current directory violates this constraint, alternative mechanisms are available.
The precedence order for each method, from highest to lowest, is as follows:
-p command line flag.name: attribute in your Compose file. Or the last name: if you specify multiple Compose files in the command line with the -f flag.-f flag.