DEV Community

Anjan Shomodder
Anjan Shomodder

Posted on

How to set up a Supabase project Locally

To set up a Supabase project locally, follow these steps:

  • Install Docker: Ensure you have Node.js and Docker installed on your machine. Supabase uses Docker to run its services locally.
    You can also use this guide for docker setup on linux:

  • Install Supabase CLI:

    • Check the documentation for your operating system. If you are using arch, you can use:
     yay -S supabase-bin
     #
     sudo npm install -g supabase
    

You can also check the video tutorial on YouTube:

  • Initialize a Supabase Project:

    • Navigate to your project directory in the terminal.
    • Run the following command to initialize a new Supabase project:
     supabase init
    
    • This will create a supabase directory with necessary configuration files.
  • Start Supabase Locally:

    • In the terminal, run:
     supabase start
    
    • This command will start the Supabase services using Docker. It includes a Postgres database, authentication, and storage services. You will get necessary urls and keys.
         API URL: http://127.0.0.1:54321
     GraphQL URL: http://127.0.0.1:54321/graphql/v1
   S3 Storage URL: http://127.0.0.1:54321/storage/v1/s3
          DB URL: postgresql://postgres:postgres@127.0.0.1:54322/postgres
      Studio URL: http://127.0.0.1:54323
    Inbucket URL: http://127.0.0.1:54324
      JWT secret: super-secret-jwt-token-with-at-least-32-characters-long
        anon key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
   service_role key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
   S3 Access Key: 625729a08b95bf1b7ff351a663f3a23c
   S3 Secret Key: 850181e4652dd023b7a98c58ae0d2d34bd487ee0cc3254aed6eda37307425907
       S3 Region: local
Enter fullscreen mode Exit fullscreen mode
  • You can get the url and keys again by running:

     supabase status
    
    • Stop Supabase Project:
  • To stop the Supabase services, run:

     supabase stop
    

Top comments (0)