Use this tutorial to install SurrealDB on macOS using the SurrealDB install script, or using the third-party Homebrew package manager. Both the SurrealDB database server and the SurrealDB command-line tool are packaged and distributed as a single executable file, which is easy to install, and easy to uninstall.
Installing SurrealDB using the install script
To get started, you can use the SurrealDB install script. This script securely downloads the latest version for the platform and CPU type. It attempts to install SurrealDB into the /usr/local/bin folder, falling back to a user-specified folder if necessary.
Installing a specific version of SurrealDB
To install a specific version of SurrealDB, a version argument (-v or --version) can be passed to the install script.
Updating SurrealDB
To ensure that you are using the latest stable version (v3.0.4), update SurrealDB using the following command.
Installing SurrealDB using Homebrew
The quickest way to get going with SurrealDB on macOS is to use Homebrew. This will install both the command-line tools, and the SurrealDB server as a single executable. If you don't use Homebrew, follow the instructions for Linux below to install SurrealDB.
Updating SurrealDB
To ensure that you are using the latest stable version (v3.0.4), update SurrealDB using the following command.
Confirming the installation
Once installed, you can run the SurrealDB command-line tool by using the surreal command. To check whether the install was successful, run the following command in your terminal.
The result should look similar to the output below, confirming that the SurrealDB command-line tool was installed successfully.
