Supabase is an open-source platform that provides a suite of tools and services to simplify the process of building and managing backend infrastructure for web and mobile applications. It combines the functionalities of a real-time database (PostgreSQL), authentication, and authorization system, and RESTful API generation.
The Supabase CLI provides tools to develop the project locally and deploy to the Supabase Platform.
To run Supabase locally, we use the commands:
supabase init
supabase start
The command supabase start requires Docker Desktop to be running because it utilizes Docker to spin up a local instance of the Supabase server. Docker is a popular containerization platform that allows us to package applications and their dependencies into isolated container.
When you give the command in the terminal specially in case of macos,
> supabase start
you may get an error even after you have your Docker Desktop running,
Error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
in github.com/supabase/cli/internal/utils.AssertDockerIsRunning:48
in github.com/supabase/cli/internal/start.Run:39
Try rerunning the command with --debug to troubleshoot the error.
The solution of this problem is simple. Just don't get overwhelmed with the installation process. Install docker using homebrew.
Steps are:
Open a terminal on your macOS system.
Ensure that Homebrew is installed and up to date by running the following command:
brew update
- Once Homebrew is updated, you can proceed to install Docker by running the following command:
brew install --cask docker
- After the installation is complete, you can launch Docker by either searching for it in your Applications folder or by running the following command in the terminal:
open /Applications/Docker.app
Docker will start up.
Then, start giving all the supabase commands in your terminal:
- Initialize the Supabase login process:
supabase login
Then you need to provide your access token by generating it from this site.
Initialize a new Supabase project:
supabase init
- Start the Supabase CLI:
supabase start
Then you may get the above error of Cannot connect to the Docker daemon
Just you need to add a command after that to set the path of docker.sock
export DOCKER_HOST=unix://"$HOME/.docker/run/docker.sock"
And you will be good to go!
Top comments (0)