Self-host SurrealDB with Levelrail
A multi-model database for documents, graphs and relations with a SQL-like query language, using the RocksDB engine on a named volume. The root password is generated at install. Source available under the BSL.
- Authorsurrealdb
- LicenceLicenseRef-BUSL-1.1
- Memory512 MiB
- Services1
How to self-host SurrealDB
-
Pull the images
One image is pulled on your server.
Show images
surrealdb/surrealdb:v2.1.2
-
Create the app
One service starts in a single Compose app, with 1 named volume mount for your data, on port 8000.
-
Fill in the secrets
1 secret is generated and stored encrypted, 1 setting is preset, you do not have to fill in anything.
-
Open it
Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.
After the first start
- Read the generated root password from the app secrets, then connect over HTTP or WebSocket on port 8000 as user root.
SurrealDB requirements
- Memory
- About 512 MiB
- Architectures
- amd64 unknown, arm64 unknown
- Ports
- 8000
- Domain
- Optional, an sslip.io address is used without one
- Settings
- none to fill in
- License
- LicenseRef-BUSL-1.1, source available
- Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
Install Levelrail first
On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then SurrealDB. New to Levelrail? Install it on a fresh VPS first.
docker pull ghcr.io/glincker/levelrail:latest Then levelrail-cli login --device. See Getting started and the SurrealDB docs page.
Deploy SurrealDB your way
Every format below deploys the same pinned images. Pick the one that fits how you work.
Deploy SurrealDB from the CLI
levelrail-cli templates deploy surrealdb --name my-surrealdb Deploy SurrealDB with the API
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://levelrail.example.com/api/v1/service-templates/surrealdb/deploy SurrealDB configuration
SurrealDB services
| Service | Image | Ports | Volumes |
|---|---|---|---|
| surrealdb | surrealdb/surrealdb:v2.1.2 | 8000 | surreal_data -> /data |
SurrealDB environment variables
| Variable | Service | Value |
|---|---|---|
| SURREAL_PASS | surrealdb | Generated at deploy |
| SURREAL_USER | surrealdb | Preset by the template |
Ports and volumes
- Ports
- 8000
- Volumes
- 1 named mount: surreal_data -> /data
SurrealDB FAQ
How much memory does SurrealDB need?
The catalog lists about 512 MiB of memory for SurrealDB.
Does SurrealDB run on arm64?
For SurrealDB, arm64 support is not confirmed; amd64 is unknown.
What licence is SurrealDB under?
SurrealDB is licensed under LicenseRef-BUSL-1.1, which is source-available, so read the terms before commercial use.
Does SurrealDB need configuration before it starts?
No. The template fills in its own defaults and generates secrets at deploy time.
Which ports does SurrealDB use?
SurrealDB listens on port 8000 inside the stack.
Where does SurrealDB keep its data?
In a named volume: surreal_data mounted at /data.
Can I deploy SurrealDB on Dokploy or Dokku?
The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id surrealdb for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image surrealdb/surrealdb:v2.1.2 is what you deploy there.