Docs
.env file configuration in Supabase

.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:

SUPABASE_ANON_KEY=
SUPABASE_PUBLIC_URL=

For local development use SUPABASE_PUBLIC_URL=http://localhost:54321 to have access to the Supabase dashboard.

apps/supabase/.env file:

ADDITIONAL_REDIRECT_URLS=
SUPABASE_ANON_KEY=
API_EXTERNAL_URL=http://localhost:8000
DASHBOARD_PASSWORD=
DASHBOARD_USERNAME=
DISABLE_SIGNUP=false
DOCKER_SOCKET_LOCATION=/var/run/docker.sock
ENABLE_EMAIL_AUTOCONFIRM=false
ENABLE_EMAIL_SIGNUP=true
ENABLE_PHONE_AUTOCONFIRM=true
ENABLE_PHONE_SIGNUP=true
FUNCTIONS_VERIFY_JWT=false
GOOGLE_PROJECT_ID=GOOGLE_PROJECT_ID
GOOGLE_PROJECT_NUMBER=GOOGLE_PROJECT_NUMBER
IMGPROXY_ENABLE_WEBP_DETECTION=true
JWT_EXPIRY=3600
JWT_SECRET=
LOGFLARE_API_KEY=
MAILER_TEMPLATES_MAGIC_LINK=https://dofastpro.com/templates/magic-link.html
MAILER_URLPATHS_CONFIRMATION=/auth/v1/verify
MAILER_URLPATHS_EMAIL_CHANGE=/auth/v1/verify
MAILER_URLPATHS_INVITE=/auth/v1/verify
MAILER_URLPATHS_RECOVERY=/auth/v1/verify
PGRST_DB_SCHEMAS=public,storage,graphql_public
POSTGRES_DB=postgres
POSTGRES_HOST=db
POSTGRES_PASSWORD=
POSTGRES_PORT=5432
SERVICE_ROLE_KEY=
SITE_URL=http://localhost:3000
[email protected]
SMTP_HOST=smtp.resend.com
SMTP_PASS=
SMTP_PORT=587
SMTP_SENDER_NAME=DoFastPro.com
SMTP_USER=resend
STUDIO_DEFAULT_ORGANIZATION=Default Organization
STUDIO_DEFAULT_PROJECT=Default Project
STUDIO_PORT=3000
SUPABASE_PUBLIC_URL=https://supabase.dofastpro.com/
  • 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. Under JWT 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 copied JWT_SECRET at the same page select in Preconfigured Payload option ANON_KEY and press Generate JWT button. Copy SUPABASE_ANON_KEY from Generated 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 copied JWT_SECRET at the same page select in Preconfigured Payload option SERVICE_KEY and press Generate 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 in docker-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 at http://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 to public ,storage ,graphql_public schemas.

  • POSTGRES_PASSWORD - Required*
    The password for the postgres role. You can use this password generator. Use 50 symbols for maximum security, Uppercase, Lowercase, Numbers.

  • POSTGRES_PORT - Required*
    The port for the postgres role. Defaults to 5432.

  • SITE_URL - Required*
    The url of the site. Defaults to http://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 to DoFastPro.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 to https://supabase.dofastpro.com/ as the example. Replace it with your Supabase url in Coolify environment settings.