Environment Variables
Info: The@/web
app typically only requires public environment variables (prefixed withNEXT_PUBLIC_
). For backend or sensitive variables, refer to Quickstart.
- In most cases, you do not need to add custom
.env
variables for@/web
unless integrating with external APIs or services directly from the frontend.
Info: If you want to add, you do not need to add custom.env
variables for@/web
unless integrating with external APIs or services directly from the frontend.
-
To set up environment variables, copy the
.env.example
file inapps/web/
to a new file named.env
: -
Edit
.env
to include variables such as: -
Note: If your CMS is running on a different route or port (by default it runs on http://localhost:3003), you must set
PAYLOAD_PUBLIC_SERVER_URL
in your.env
file to the correct URL. For example: - For backend or advanced configuration, refer to the main environment Guide.