SurrealDB
What is SurrealDB?
SurrealDB is a multi-model database combining document, graph, and relational data behind a single SQL-like query language (SurrealQL), reachable over both REST and WebSocket. Laradock runs it from the official surrealdb/surrealdb image with a RocksDB storage backend.
Start SurrealDB
docker compose up -d surrealdb
Stop SurrealDB
docker compose stop surrealdb
This stops the container without deleting its data. Data is kept in the named surrealdb Docker volume, not under DATA_PATH_HOST.
Configuration
All settings live in surrealdb/defaults.env and can be overridden by adding the same line to your own .env:
| Variable | Default | What it does |
|---|---|---|
SURREALDB_VERSION | v2.6.5 | Image tag from SurrealDB's Docker Hub image. |
SURREALDB_PORT | 8010 | Host-side port for the REST/WebSocket API (container port 8000). |
SURREALDB_USER | root | Root user, passed to surreal start --user. |
SURREALDB_PASSWORD | secret | Root password, passed to surreal start --pass. |
The container runs as root (set in surrealdb/compose.yml) so the server can create its RocksDB store inside the named volume, and starts with:
start --user ${SURREALDB_USER} --pass ${SURREALDB_PASSWORD} --bind 0.0.0.0:8000 rocksdb:/data/database.db
Check it's up
curl http://localhost:8010/health
Connect
Use the SurrealDB CLI or any SurrealDB client library against http://localhost:8010 (from your host) or http://surrealdb:8000 (from another container), authenticating with SURREALDB_USER / SURREALDB_PASSWORD.
Common issues
- Changing
SURREALDB_VERSIONdoesn't take effect. SurrealDB is pulled by image tag, not built locally, restart after changing it:docker compose up -d surrealdb. - Credential changes don't take effect.
--user/--passare only meaningful the first time the RocksDB store is created inside the volume. If you changeSURREALDB_USER/SURREALDB_PASSWORDafterward, either drop thesurrealdbvolume (data loss) or manage users through SurrealQL instead. - Data isn't where you expect. Persists to a named Docker volume (
surrealdb), notDATA_PATH_HOST. Usedocker volume inspect <project>_surrealdbto find it, ordocker compose down -vto wipe it (data loss). - Port already in use on your host. Change
SURREALDB_PORTin.envand restart.
Need a different multi-model option? See ArangoDB. Back to the Getting Started guide.