The PowerShell install script installs surreal, the SurrealDB command-line tool, and the database with it. surreal installs, updates and runs the database as a component, so surreal db start works from then on without a network connection. Chocolatey and Scoop install the same surreal.
Installing with the PowerShell install script
The install script downloads surreal and the database, checks each download against its published SHA-256, and installs surreal.exe into C:\Program Files\SurrealDB from an elevated shell, or %LOCALAPPDATA%\SurrealDB otherwise. It adds that folder to your user PATH.
irm https://windows.surrealdb.com | iexirm | iex cannot pass options. To pass them, run the script as a script block. The database is installed by default; -NoDb installs surreal alone, and the database installs on first use instead.
& ([scriptblock]::Create((irm https://windows.surrealdb.com))) -NoDbThe SURREAL_CLI_INSTALL_DB environment variable (1 or 0) sets the same switch for callers that cannot pass options. See Install the SurrealDB CLI for every option, including installing the Cloud component alongside.
Installing a specific version of the database
Use -Version to install and pin a database release.
& ([scriptblock]::Create((irm https://windows.surrealdb.com))) -Version <version>SurrealDB 4.0 is in beta. To install it, use -Beta instead. See Install the beta.
Updating
Once installed, surreal upgrades itself and every installed component. The database stays on its current major line.
surreal upgradeTo move the database to another release, name it: surreal upgrade db@<version>. See Managing components.
Confirming the installation
Run the following command to check that the database component runs.
surreal db version4.0.0 for windows on x86_64To list surreal and every component with the version that runs, use surreal list.
Installing with Chocolatey or Scoop
The Chocolatey and Scoop packages install surreal, the same command-line tool as the install script. Install the database with surreal afterwards, or let it install the first time you run a surreal db command:
choco install surreal
surreal install dbscoop install surrealdb
surreal install dbsurreal then installs, upgrades and runs the database as a component, so surreal db start and surreal upgrade work as they do after the install script. The package manager updates only surreal itself:
choco upgrade surrealscoop update surrealdbTroubleshooting
DLLs not installed
Attempting to open the executable at the install location throws errors that the following DLLs are not installed
If you encounter an error saying that the following DLLs are not installed:
VCRUNTIME140.dll
MSVCP140.dll
VCRUNTIME140_1.dll
Then you may need to install the Microsoft Visual C++ Redistributable for Visual Studio.