DEV Community

Cover image for Facing problem in starting Supabase on MacOs?
Ananna Dristy
Ananna Dristy

Posted on

Facing problem in starting Supabase on MacOs?

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
Enter fullscreen mode Exit fullscreen mode

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.

Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode
  • Once Homebrew is updated, you can proceed to install Docker by running the following command:
brew install --cask docker
Enter fullscreen mode Exit fullscreen mode
  • 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
Enter fullscreen mode Exit fullscreen mode

Docker will start up.

Then, start giving all the supabase commands in your terminal:

  • Initialize the Supabase login process:
supabase login
Enter fullscreen mode Exit fullscreen mode
  • Then you need to provide your access token by generating it from this site.

  • Initialize a new Supabase project:

supabase init
Enter fullscreen mode Exit fullscreen mode
  • Start the Supabase CLI:
supabase start
Enter fullscreen mode Exit fullscreen mode

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"
Enter fullscreen mode Exit fullscreen mode

And you will be good to go!

Top comments (0)