Quick start with one node
We show you how to install TeselaDB, start a node and connect to it with mongosh from this very page.
You will install TeselaDB, start a node on your machine and connect to it with mongosh. A single node is already a
complete database: it stores your collections, splits them into ranges and serves the drivers.
What you will get
It takes about five minutes. At the end you have a node listening on 127.0.0.1 with TLS and users on, and a
mongosh session open as root. With the driver of your language you connect as you would to a MongoDB server, with
the same kind of connection string except for the node's address and its CA.
Before you begin
You need mongosh and one of these two: Linux (x86_64 or aarch64) or macOS Apple Silicon with curl, or Docker on
any system.
Step 1. Install and start the node
Pick how to start it and paste the commands in one terminal, in order. There is nothing to edit. The install script looks at your system and your CPU, downloads the binary that matches them and checks its SHA-256 before it copies it.
For Linux x86_64 and aarch64 and macOS Apple Silicon. The script installs teseladb in /usr/local/bin and asks for sudo when it needs it.
- 01.
Install TeselaDB with the script, which picks the binary for your system and checks its SHA-256
$curl -fsSL https://downloads.teseladb.com/install.sh | sh - 02.
Start a node in the background; the first start creates the certificate authority and the root user
$teseladb start --dbpath ./data > teseladb.log 2>&1 & - 03.
Wait until the node is ready
$until grep -q '^ready' teseladb.log; do sleep 1; done - 04.
Read the root user's password
$ROOT_PASSWORD=$(sed -n 's/^password=//p' ./data/root-credentials.txt) - 05.
Connect with mongosh over TLS
$mongosh "mongodb://root:$ROOT_PASSWORD@127.0.0.1:27017/?tls=true&tlsCAFile=./data/pki/ca.pem&authSource=admin"
The last step opens mongosh connected as root. On start, the node opens four ports on 127.0.0.1, each for one
kind of traffic, and the client one only takes TLS:
| Port | What for |
|---|---|
| 27017 | Clients and drivers, always over TLS |
| 27100 | Traffic between nodes, with mutual TLS |
| 27200 | Administration with teseladb admin, /metrics and /healthz |
| 27080 | REST API and MCP server |
Step 2. See what the first start created
In an empty directory, the first start creates the security of the cluster and leaves these files in the data
directory, ./data with the script or /data inside the container. The log says where the credentials file is, but
never writes what it holds, so the root password is only read from that file:
| File | What it holds | Permissions |
|---|---|---|
pki/ca.pem, pki/ca.key | Certificate authority of the cluster | 0644 / 0600 |
pki/node.pem, pki/node.key | Certificate and key of this node | 0644 / 0600 |
master.key | Master key, which encrypts the other keys | 0600 |
root-credentials.txt | The root user and its first password | 0600 |
Check that it works
db.runCommand({ ping: 1 });Type it in the mongosh session the last step opened and it should answer { ok: 1 }. If mongosh does not connect, read the node's log in teseladb.log if you used the script, or with docker logs teseladb if you used Docker, because it says what is missing there.
Clean up
pkill -f "teseladb start --dbpath ./data"
rm -rf ./data teseladb.logLeave mongosh first with exit. If you started the node with the script, these two commands stop it and remove its
data and its log. If you started it with Docker, remove instead the container, its volume and the CA you copied:
docker rm -f teseladb
docker volume rm teseladb-data
rm ./ca.pemNext steps
To connect from your code, follow Connect your application. For several nodes on your machine, follow Quick start with a local cluster.