Environment Variables
Info: The@/webapp 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
.envvariables for@/webunless integrating with external APIs or services directly from the frontend.
Info: If you want to add, you do not need to add custom.envvariables for@/webunless integrating with external APIs or services directly from the frontend.
-
To set up environment variables, copy the
.env.examplefile inapps/web/to a new file named.env: -
Edit
.envto 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_URLin your.envfile to the correct URL. For example: - For backend or advanced configuration, refer to the main environment Guide.