Install SurrealDB

There are a number of ways of running SurrealDB. It can either be installed from a binary image, or it can be run from within Docker. Once installed, the surreal command is a single executable which can be used to backup, interact with, and run SurrealDB server instances.

Install on macOS

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.

brew install surrealdb/tap/surreal

Install on Linux

The easiest and preferred way to get going with SurrealDB on Unix operating systems is to install and use the SurrealDB command-line tool. Run the following command in your terminal and follow the on-screen instructions.

curl -sSf https://install.surrealdb.com | sh

Install on Windows

The easiest and preferred way to get going with SurrealDB on Windows is to install and use the SurrealDB command-line tool. Run the following command in your terminal and follow the on-screen instructions.

iwr https://windows.surrealdb.com -useb | iex

Alternatively SurrealDB is available for installation, on Windows, via the Chocolatey package manager, from an administrative shell - enabling easy installation and upgrading.

choco install surreal --pre

Using Chocolatey, SurrealDB can be upgraded to the latest version with the following command.

choco upgrade surreal --pre

Run using Docker

Docker can be used to manage and run SurrealDB database instances without the need to install any command-line tools. The SurrealDB docker container contains the full command-line tools for importing and exporting data from a running server, or for running a server itself.

docker run --rm -p 8000:8000 surrealdb/surrealdb:latest start