Supabase provides a CLI so that you can develop your application locally, rather than connecting to a live project.
Before you begin
If you're using the CLI, please record your steps! You can help us improve by adding missing details and fixing errors.
Our CLI is still under heavy development, and is missing some features:
- You cannot yet deploy your local changes to your live project using the CLI. You will need to take a "dump" of your database schema and run it on your live database.
- We have not yet added Storage to the local development suite.
- The self-hosted version of Supabase does not include a UI yet. We are working on this in stages, starting with our UI library (more context).
In the meantime, here are some suggested tools for interacting with your Postgres Database:
Table Plus: https://www.tableplus.io
Our CLI makes heavy use of Docker Compose, so make sure it is installed and configured on your machine before starting.
You will also need to install NPM.
Install the CLI
Initialize your project
You will be guided through a series of questions, and if everything goes well, you will see an output similar to this:
This command will create a
.supabase folder which holds all the configuration for developing your project locally. You don't need to check this into version control.
This command uses Docker Compose to start all the open source services of Supabase. This command will take a while to run, there are a lot of services to build.
Once this is running, you will see the healthy services in Docker Dashboard:
Accessing Services Directly
- API Gateway
Now that we've learned how to install and start Supabase locally, let's see how you can use it with a frontend application. This quick-start guide will show you, how you can configure a React app which uses the Supabase stack.
Now that your application is prepared, you can use Supabase anywhere in your application:
Copy this snippet into
App.js, and then start the backend and the frontend:
If everything is working, you should have a React app running on
http://localhost:3000 and Supabase services running on
When you're finished with Supabase, run
supabase stop to stop the Docker services.