Install as a Docker Container
On this page: Everything you need to install and run TerminusDB server as a docker container on your computer or on a remote server.
Key topics

Requirements

A list of prerequisite components depending on your operating system. Click on the required component to download it from the provider's website.

Table: Installation requirements

Component
Version
Required to:
Linux
macOS
Windows
Git
Latest
Clone the TerminusDB bootstrap and run the container script.
Git Bash
Latest
Clone the TerminusDB bootstrap and run the container script.
Sudo
Latest
Access security.
Docker
Latest
Use the TerminusDB docker container.
Docker memory allocation on Windows On Windows, the default memory allocated for the Docker is 2GB. TerminusDB is an in-memory database so it is advised to increase the allocation in Docker desktop settings.
Linux package manager On Linux, use your distro's package manager for containerized deployments. Click on the Package manager link in the requirements table above for more information.

Install steps

Install and run the TerminusDB container with the following steps.

Clone the TerminusDB bootstrap

clone the terminusdb-bootstrap repository and cd to it.
1
git clone https://github.com/terminusdb/terminusdb-bootstrap
Copied!
1
cd terminusdb-bootstrap
Copied!

Run the container

Run the container using script terminusdb-container.

Running for the first time

Run the container with the parameter run. See Environment configuration for further configuration options.
1
./terminusdb-container run
Copied!
This generates the message: terminusdb-server container started http://127.0.0.1:6363/. This is the TerminusDB Server and Console URL.

Subsequent runs

  • Stop the container if it is running.
  • Remove previous volumes. Enter y to confirm removal when prompted.
  • Rerun the container.
Warning: Removing previous volumes will erase local data.
1
./terminusdb-container stop
2
./terminusdb-container rm
3
./terminusdb-container run
Copied!

Use the console

Open the TerminusDB console in a web browser using the container script or the URL.

Script

1
./terminusdb-container console
Copied!

URL

1
http://127.0.0.1:6363/
Copied!

Console commands

Run container script without a parameter to list the available commands.
1
./terminusdb-container
Copied!
The available commands are listed as follows.
1
USAGE:
2
terminusdb-container [COMMAND]
3
4
help show usage
5
run run container
6
stop stop container
7
console launch console in web browser
8
attach attach to prolog shell
9
exec execute a command inside the container
10
rm remove volumes
Copied!

Environment configuration

The container script uses a set of environment variables with default values. You can configure the environment by setting these variables.

The environment file

The terminusdb-bootstrap directory contains the file ENV.example. This file holds all configurable environment variables. The container script uses the file ENV if it exists in the terminusdb-bootstrap directory.
To run the container script with values specific to your environment:
  • Copy ENV.example to ENV: cp ENV.example ENV
  • Edit ENV to uncomment and set environment variable/s: vi ENV
  • Run the container as usual: ./terminusdb-container run

Environment variables reference

A description of some of the environment variables in ENV.example and their defaults.

Table: Environment variables reference

Environment variable name
Default value
Description
TERMINUSDB_DOCKER
sudo docker
Default docker command
TERMINUSDB_CONTAINER
terminusdb-server
Name of the running container
TERMINUSDB_REPOSITORY
terminusdb/terminusdb-server
TerminusDB docker image
TERMINUSDB_NETWORK
bridge
Docker network mode
TERMINUSDB_TAG
latest
The latest version of the terminusdb-server docker image
TERMINUSDB_STORAGE
terminusdb_storage_local
Storage volume name
TERMINUSDB_PORT
6363
The port used for TerminusDB
TERMINUSDB_LOCAL
your-folder-name
Local folder to mount inside container
TERMINUSDB_SERVER
127.0.0.1
Server on which TerminusDB runs
TERMINUSDB_PASS
root
Password for accessing TerminusDB

Examples of setting environment variables

Examples of environment variables you can set when running the container script. Replace the [COMMAND] property in the examples below with the parameter you want to use.

Mount a local directory inside the container

1
TERMINUSDB_LOCAL=/path/to/dir ./terminusdb-container [COMMAND]
Copied!

Set the Docker Volume name

1
TERMINUSDB_STORAGE=terminus_storage_local ./terminusdb-container [COMMAND]
Copied!

Use the latest release

1
TERMINUSDB_TAG=latest ./terminusdb-container [COMMAND]
Copied!

Use the development release

1
TERMINUSDB_TAG=dev ./terminusdb-container [COMMAND]
Copied!

Use a specific release instead of the latest release

1
TERMINUSDB_TAG=v1.1.2 ./terminusdb-container [COMMAND]
Copied!

Use local version of the TerminusDB console instead of the published version

1
TERMINUSDB_CONSOLE_BASE_URL=//127.0.0.1:3005 ./terminusdb-container [COMMAND]
Copied!

Do not use sudo even when sudo is available

1
TERMINUSDB_DOCKER=docker ./terminusdb-container [COMMAND]
Copied!

Use podman instead of docker

1
TERMINUSDB_DOCKER="podman" ./terminusdb-container [COMMAND]
Copied!

Server deployment

The TerminusDB server is deployed to your computer by default.

Local computer deployment

By default, the Docker container binds to IP 127.0.0.1. This prevents insecure deployments and ensures the TerminusDB server is accessible on a local computer only.

Remote server deployment

To deploy the TerminusDB server to a remote machine:

Run the container

Run the container script with the run parameter as usual.
1
./terminusdb-container run
Copied!