.env file configuration in Supabase
How to configure .env file in Supabase.
You need to change environment variables in apps/supabase/.env
and apps/web/.env
(copy/paste only SUPABASE_ANON_KEY
and SUPABASE_PUBLIC_URL
) files.
You can find example.env
file in the root of the Supabase project. You can copy this file and rename it to .env
. Then, you can change the values of the variables to match your project's needs.
You can define the variables in the .env
file and then store them in Coolify. For now our task is to run project on local and run Supabase.
Let's go to the .env
file and change the values of the variables to match your project's needs.
Example of apps/web/.env
:
For local development use SUPABASE_PUBLIC_URL=http://localhost:54321
to have access to the Supabase dashboard.
apps/supabase/.env
file:
-
ADDITIONAL_REDIRECT_URLS
- Optional
Used for redirect to the correct URL after the user has authenticated. More info here
-
JWT_SECRET
- Required*
Used for JWT token generation. Copy JWT secret from here here. UnderJWT Secret:
. Don't close the page! The info will be used in the next step.
-
SUPABASE_ANON_KEY
- Required*
Used for anonymous access to the database. When you copiedJWT_SECRET
at the same page select inPreconfigured Payload
optionANON_KEY
and pressGenerate JWT
button. CopySUPABASE_ANON_KEY
fromGenerated Token
field. Don't close the page! The info will be used in the next step.
-
JWT_EXPIRY
- Optional
How long tokens are valid for, in seconds. Defaults to 3600 (1 hour). -
SERVICE_ROLE_KEY
- Required*
The "service_role" is a predefined Postgres role with elevated privileges, designed to perform various administrative and service-related tasks. It can bypass Row Level Security, so it should only be used on a private server. More info here When you copiedJWT_SECRET
at the same page select inPreconfigured Payload
optionSERVICE_KEY
and pressGenerate JWT
button.
-
DASHBOARD_USERNAME
- Required*
The username for the Supabase dashboard.
-
DASHBOARD_PASSWORD
- Required*
Used for the Supabase dashboard. Generate a very long password and paste it. You can use this password generator. Use 50 symbols, Uppercase, Lowercase, Numbers.
-
DISABLE_SIGNUP
- Optional
When signup is disabled the only way to create new users is through invites. Defaults to false, all signups enabled. -
DOCKER_SOCKET_LOCATION
- Required*
Leave the default value.
-
ENABLE_ANONYMOUS_USERS
- Optional
If you do not require anonymous access, you may set this to true. Defaults to false. -
ENABLE_EMAIL_AUTOCONFIRM
- Optional
Use this to enable/disable anonymous sign-ins.. Defaults to false.
-
ENABLE_EMAIL_SIGNUP
- Optional
Use this to disable email signups (users can still use external oauth providers to sign up / sign in). Defaults to true.
-
ENABLE_PHONE_AUTOCONFIRM
- Optional
If you require phone confirmation, you may set this to false. Defaults to true.
-
ENABLE_PHONE_SIGNUP
- Optional
Use this to disable phone signups (users can still use external oauth providers to sign up / sign in). Defaults to true.
-
FUNCTIONS_VERIFY_JWT
- Optional
More info here. Defaults to false. -
GOOGLE_PROJECT_ID
- Optional
Not used in DoFastPro project. Uncomment indocker-compose.yml
to use Big Query backend for analytics. More info here. -
GOOGLE_PROJECT_NUMBER
- Optional
Not used in DoFastPro project. More info here.
-
IMGPROXY_ENABLE_WEBP_DETECTION
- Optional
More info here and how Supabase uses it read here. Defaults to true.
-
LOGFLARE_API_KEY
- Optional
Register your app athttp://localhost:4000/dashboard
LogFlare. Then copy the API key and paste it here. If you want to use it, read more here and official LogFlare docs here. -
MAILER_TEMPLATES_MAGIC_LINK
- Required*
The link to the magic link template that will be used in the email during user auth process. More details are described in Auth docs section. -
MAILER_URLPATHS_CONFIRMATION
,MAILER_URLPATHS_EMAIL_CHANGE
,MAILER_URLPATHS_INVITE
,MAILER_URLPATHS_RECOVERY
- Required*
The url paths for auth process. Just leave the default values. -
PGRST_DB_SCHEMAS
- Required*
Leave the default values to have public access topublic ,storage ,graphql_public
schemas. -
POSTGRES_PASSWORD
- Required*
The password for thepostgres
role. You can use this password generator. Use 50 symbols for maximum security, Uppercase, Lowercase, Numbers. -
POSTGRES_PORT
- Required*
The port for thepostgres
role. Defaults to 5432. -
SITE_URL
- Required*
The url of the site. Defaults tohttp://localhost:3000
for local development. Replace with your site url for production in Coolify environment settings.
For more info about email (SMTP) configuration read Emails section.
-
SMTP_ADMIN_EMAIL
- Required*
The From email address for all emails sent. Defaults to[email protected]
as the example. Sure, you must replace it with your email address. -
SMTP_PASS
- Required*
The password for the SMTP server. We use Resend.com for email sending. You can find the password in the Resend.com dashboard. -
SMTP_PORT
- Required*
The port for the SMTP server. Defaults to 587. -
SMTP_SENDER_NAME
- Required*
The name of the sender. Defaults toDoFastPro.com
. You must replace it with your name. -
SMTP_USER
- Required*
The username for the SMTP server. We use Resend.com for email sending. You can find the username in the Resend.com dashboard. -
STUDIO_PORT
- Required*
The port for the Supabase studio. Defaults to 3000. -
SUPABASE_PUBLIC_URL
- Required*
The public url for the Supabase. Defaults tohttps://supabase.dofastpro.com/
as the example. Replace it with your Supabase url in Coolify environment settings.