Dolt is a SQL database with Git-style version control built in. Every table, row, and schema change can be branched, diffed, merged, and pushed to a remote – just like source code. Dolt speaks the MySQL wire protocol, so any MySQL client or ORM connects to it without changes. Under the hood, each commit stores a full snapshot of the database, giving you time travel queries, instant rollbacks, and a complete audit trail of who changed what and when.

This guide covers installing Dolt on Ubuntu 24.04 and Rocky Linux 10, creating databases, running SQL operations, branching and merging data, working with remotes through DoltHub, running Dolt as a MySQL-compatible server, resolving merge conflicts, and practical use cases for version-controlled databases.

Prerequisites

  • A server running Ubuntu 24.04 LTS or Rocky Linux 10 with root or sudo access
  • At least 2 GB RAM and 10 GB free disk space
  • curl installed for downloading the installer
  • A free DoltHub account (optional, for remote push/pull operations)

Step 1: Install Dolt on Ubuntu 24.04 / Rocky Linux 10

Dolt ships as a single binary with no external dependencies. The official install script downloads the latest release and places it in /usr/local/bin/.

Install Dolt using the official installer

Run the following command on both Ubuntu 24.04 and Rocky Linux 10:

$ sudo bash -c 'curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | bash'

Sample output:

Downloading: https://github.com/dolthub/dolt/releases/download/v1.48.2/dolt-linux-amd64.tar.gz
Installing dolt to /usr/local/bin.

Verify the installation by checking the version:

$ dolt version
dolt version 1.48.2

Alternative: Install from source

If you prefer building from source, you need Go 1.22 or later installed on your system. Clone the repository and build:

$ git clone https://github.com/dolthub/dolt.git
$ cd dolt/go
$ go install ./cmd/dolt

The binary lands in your $GOPATH/bin directory. Make sure that path is in your $PATH.

Step 2: Configure Dolt User Identity

Before making any commits, set your username and email. Dolt uses these for commit authorship, the same way Git does.

$ dolt config --global --add user.name "SysAdmin"
Config successfully updated.

$ dolt config --global --add user.email "[email protected]"
Config successfully updated.

Confirm the configuration:

$ dolt config --list
user.name = SysAdmin
user.email = [email protected]

Step 3: Create a Dolt Database

Each Dolt database lives in its own directory, similar to a Git repository. Create a directory and initialize it:

$ mkdir ~/inventory_db && cd ~/inventory_db
$ dolt init
Successfully initialized dolt data repository.

This creates the internal Dolt storage structure inside the directory. The dolt init command also creates an initial commit on the main branch.

Step 4: SQL Operations – CREATE, INSERT, and SELECT

Dolt supports standard SQL syntax. You can run queries inline with the -q flag or open an interactive SQL shell with dolt sql.

Create a table

$ dolt sql -q "CREATE TABLE products (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(100) NOT NULL,
    category VARCHAR(50),
    price DECIMAL(10,2),
    stock INT DEFAULT 0
)"

Verify the table was created:

$ dolt sql -q "SHOW TABLES"
+----------+
| Table    |
+----------+
| products |
+----------+

Insert data

Insert several rows into the products table:

$ dolt sql -q "INSERT INTO products (name, category, price, stock) VALUES
('Ubuntu Server License', 'Software', 0.00, 999),
('Dell PowerEdge R760', 'Hardware', 8500.00, 15),
('Cisco Catalyst 9300', 'Networking', 4200.00, 8),
('Samsung 990 PRO 2TB', 'Storage', 189.99, 120),
('Veeam Backup Suite', 'Software', 1200.00, 50)"
Query OK, 5 rows affected

Query data

Run SELECT queries exactly as you would against MySQL:

$ dolt sql -q "SELECT * FROM products"
+----+-----------------------+------------+---------+-------+
| id | name                  | category   | price   | stock |
+----+-----------------------+------------+---------+-------+
| 1  | Ubuntu Server License | Software   | 0.00    | 999   |
| 2  | Dell PowerEdge R760   | Hardware   | 8500.00 | 15    |
| 3  | Cisco Catalyst 9300   | Networking | 4200.00 | 8     |
| 4  | Samsung 990 PRO 2TB   | Storage    | 189.99  | 120   |
| 5  | Veeam Backup Suite    | Software   | 1200.00 | 50    |
+----+-----------------------+------------+---------+-------+

Filtered queries work the same way:

$ dolt sql -q "SELECT name, price FROM products WHERE category = 'Software'"
+-----------------------+---------+
| name                  | price   |
+-----------------------+---------+
| Ubuntu Server License | 0.00    |
| Veeam Backup Suite    | 1200.00 |
+-----------------------+---------+

Interactive SQL shell

For multiple operations, the interactive shell is more practical. Launch it with dolt sql:

$ dolt sql
# Welcome to the DoltSQL shell.
# Statements must be terminated with ';'.
# "exit" or "quit" (or Ctrl-D) to exit.
inventory_db> SELECT COUNT(*) AS total_products FROM products;
+----------------+
| total_products |
+----------------+
| 5              |
+----------------+
inventory_db> exit
Bye

Step 5: Commit Changes with Dolt

Dolt tracks changes to your tables just like Git tracks file changes. Stage and commit your work:

$ dolt add .
$ dolt commit -m "Add products table with initial inventory data"
commit abc123def456ghi789jkl012mno345pq
Author: SysAdmin <[email protected]>
Date:   Wed Mar 19 10:30:00 +0000 2026

        Add products table with initial inventory data

Check the status after committing:

$ dolt status
On branch main
nothing to commit, working tree clean

Step 6: Branching and Merging Data

One of the most powerful features of Dolt is branching. You can create isolated branches to test schema changes or data modifications, then merge them back when ready. This is the same workflow that developers use with Git for source code.

Create and switch to a new branch

$ dolt checkout -b price-update
Switched to branch 'price-update'

Make changes on the branch:

$ dolt sql -q "UPDATE products SET price = 7999.00 WHERE name = 'Dell PowerEdge R760'"
Query OK, 1 row affected
Rows matched: 1  Changed: 1  Warnings: 0

Add a new product while on this branch:

$ dolt sql -q "INSERT INTO products (name, category, price, stock) VALUES ('HPE ProLiant DL380', 'Hardware', 9200.00, 10)"
Query OK, 1 row affected

Commit the branch changes:

$ dolt add .
$ dolt commit -m "Update Dell pricing and add HPE server"
commit rst456uvw789xyz012abc345def678ghi
Author: SysAdmin <[email protected]>
Date:   Wed Mar 19 10:45:00 +0000 2026

        Update Dell pricing and add HPE server

Merge the branch back to main

Switch back to the main branch and merge:

$ dolt checkout main
Switched to branch 'main'

$ dolt merge price-update
Updating abc123def456ghi789jkl012mno345pq..rst456uvw789xyz012abc345def678ghi
Fast-forward

Verify the merged data:

$ dolt sql -q "SELECT id, name, price FROM products ORDER BY id"
+----+-----------------------+---------+
| id | name                  | price   |
+----+-----------------------+---------+
| 1  | Ubuntu Server License | 0.00    |
| 2  | Dell PowerEdge R760   | 7999.00 |
| 3  | Cisco Catalyst 9300   | 4200.00 |
| 4  | Samsung 990 PRO 2TB   | 189.99  |
| 5  | Veeam Backup Suite    | 1200.00 |
| 6  | HPE ProLiant DL380    | 9200.00 |
+----+-----------------------+---------+

List all branches

View your branches with:

$ dolt branch
* main
  price-update

Delete a merged branch when you no longer need it:

$ dolt branch -d price-update
Deleted branch 'price-update'

Step 7: Use dolt diff and dolt log

The dolt diff command shows row-level differences between commits, branches, or the working set. This is one of the features that sets Dolt apart from traditional databases.

View uncommitted changes

Make a change and see the diff before committing:

$ dolt sql -q "UPDATE products SET stock = 100 WHERE id = 4"
Query OK, 1 row affected

Now run the diff:

$ dolt diff
diff --dolt a/products b/products
--- a/products @ h8k2m4n6p8r0t2v4x6z8
+++ b/products @ a1b3c5d7e9f1g3h5i7j9
+-----+----+---------------------+----------+--------+-------+
|     | id | name                | category | price  | stock |
+-----+----+---------------------+----------+--------+-------+
|  <  | 4  | Samsung 990 PRO 2TB | Storage  | 189.99 | 120   |
|  >  | 4  | Samsung 990 PRO 2TB | Storage  | 189.99 | 100   |
+-----+----+---------------------+----------+--------+-------+

The < symbol shows the old row value, and > shows the new value. Commit this change:

$ dolt add .
$ dolt commit -m "Adjust Samsung SSD stock count"

View commit history with dolt log

The dolt log command displays the full commit history of your database:

$ dolt log
commit jkl012mno345pqr678stu901vwx234yz
Author: SysAdmin <[email protected]>
Date:   Wed Mar 19 11:00:00 +0000 2026

        Adjust Samsung SSD stock count

commit rst456uvw789xyz012abc345def678ghi
Author: SysAdmin <[email protected]>
Date:   Wed Mar 19 10:45:00 +0000 2026

        Update Dell pricing and add HPE server

commit abc123def456ghi789jkl012mno345pq
Author: SysAdmin <[email protected]>
Date:   Wed Mar 19 10:30:00 +0000 2026

        Add products table with initial inventory data

commit 0000000000000000000000000000000000
Author: SysAdmin <[email protected]>
Date:   Wed Mar 19 10:25:00 +0000 2026

        Initialize data repository

Diff between specific commits

Compare any two commits by passing their hashes:

$ dolt diff abc123def456 rst456uvw789

You can also diff between branches:

$ dolt diff main feature-branch

Step 8: Clone and Push to DoltHub Remotes

DoltHub is a hosting platform for Dolt databases – think of it as GitHub for data. You can clone public databases, push your own, and collaborate with others.

Clone a public database

Clone any public database from DoltHub with a single command:

$ dolt clone dolthub/us-jails
cloning https://doltremoteapi.dolthub.com/dolthub/us-jails
32,150 of 32,150 chunks complete. 0 chunks being downloaded currently.

Navigate into the cloned database and query it:

$ cd us-jails
$ dolt sql -q "SHOW TABLES"
+----------------+
| Table          |
+----------------+
| jails          |
| jail_capacity  |
| jail_locations |
+----------------+

Push your database to DoltHub

First, authenticate with DoltHub using your credentials. Create an account at dolthub.com if you do not have one yet.

$ dolt login

This opens your browser for authentication. After logging in, add a remote and push:

$ cd ~/inventory_db
$ dolt remote add origin dolthub/yourusername/inventory_db
$ dolt push origin main
Uploading...
Push completed successfully.

Pull changes from a remote

Pull updates from a remote repository to sync your local copy:

$ dolt pull origin main
Already up to date.

The push/pull workflow lets teams collaborate on datasets the same way developers collaborate on code. If you manage MySQL database backups, Dolt remotes offer an alternative approach through versioned snapshots.

Step 9: Run Dolt as a MySQL-Compatible Server

Dolt can run as a persistent database server that accepts connections over the MySQL wire protocol. Any tool that connects to MySQL – clients, ORMs, BI tools – works with Dolt without modification.

Start the Dolt SQL server

From your database directory, start the server:

$ cd ~/inventory_db
$ dolt sql-server --host 0.0.0.0 --port 3306 --user root --password "SecurePass123"

The server runs in the foreground by default. For production, run it as a systemd service. Create the service file:

$ sudo tee /etc/systemd/system/dolt.service > /dev/null << 'UNIT'
[Unit]
Description=Dolt SQL Server
After=network.target

[Service]
Type=simple
User=dolt
WorkingDirectory=/home/dolt/inventory_db
ExecStart=/usr/local/bin/dolt sql-server --host 0.0.0.0 --port 3306 --user root --password SecurePass123
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
UNIT

Create a dedicated system user and enable the service:

$ sudo useradd -r -m -s /bin/bash dolt
$ sudo cp -r ~/inventory_db /home/dolt/
$ sudo chown -R dolt:dolt /home/dolt/inventory_db
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now dolt.service

Verify the server is running:

$ sudo systemctl status dolt.service
  dolt.service - Dolt SQL Server
     Loaded: loaded (/etc/systemd/system/dolt.service; enabled)
     Active: active (running)

Configure the firewall

On Ubuntu 24.04 with UFW:

$ sudo ufw allow 3306/tcp
$ sudo ufw reload

On Rocky Linux 10 with firewalld:

$ sudo firewall-cmd --permanent --add-port=3306/tcp
$ sudo firewall-cmd --reload

Server configuration file

For more control, create a YAML configuration file instead of passing flags:

$ sudo tee /home/dolt/inventory_db/.dolt/config.yaml > /dev/null << 'CONF'
log_level: info
behavior:
  read_only: false
  autocommit: true
listener:
  host: 0.0.0.0
  port: 3306
  max_connections: 100
user:
  name: root
  password: "SecurePass123"
CONF

Then start the server without inline flags:

$ dolt sql-server --config /home/dolt/inventory_db/.dolt/config.yaml

Step 10: Connect with MySQL Clients

Since Dolt speaks the MySQL protocol, you can connect using the standard mysql command-line client or any MySQL-compatible tool.

Connect with the MySQL CLI

Install the MySQL client on Ubuntu 24.04:

$ sudo apt install mysql-client -y

On Rocky Linux 10:

$ sudo dnf install mysql -y

Connect to the Dolt server:

$ mysql -h 127.0.0.1 -P 3306 -u root -pSecurePass123 inventory_db
mysql> SELECT * FROM products WHERE price > 1000;
+----+---------------------+----------+---------+-------+
| id | name                | category | price   | stock |
+----+---------------------+----------+---------+-------+
|  2 | Dell PowerEdge R760 | Hardware | 7999.00 |    15 |
|  3 | Cisco Catalyst 9300 | Networking | 4200.00 |   8 |
|  5 | Veeam Backup Suite  | Software | 1200.00 |    50 |
|  6 | HPE ProLiant DL380  | Hardware | 9200.00 |    10 |
+----+---------------------+----------+---------+-------+
4 rows in set (0.01 sec)

Dolt-specific SQL functions

When connected through the MySQL protocol, you can use Dolt-specific functions to access version control features directly from SQL. This makes it possible to manage branches and commits without leaving your SQL session.

mysql> SELECT * FROM dolt_log LIMIT 3;
+----------------------------------+----------+---------------------+-------------------------------------------+
| commit_hash                      | committer | date               | message                                   |
+----------------------------------+----------+---------------------+-------------------------------------------+
| jkl012mno345pqr678stu901vwx234yz | SysAdmin | 2026-03-19 11:00:00 | Adjust Samsung SSD stock count           |
| rst456uvw789xyz012abc345def678ghi | SysAdmin | 2026-03-19 10:45:00 | Update Dell pricing and add HPE server   |
| abc123def456ghi789jkl012mno345pq | SysAdmin | 2026-03-19 10:30:00 | Add products table with initial inventory |
+----------------------------------+----------+---------------------+-------------------------------------------+

Query data as it existed at a previous commit:

mysql> SELECT * FROM products AS OF 'abc123def456' WHERE id = 2;
+----+---------------------+----------+---------+-------+
| id | name                | category | price   | stock |
+----+---------------------+----------+---------+-------+
|  2 | Dell PowerEdge R760 | Hardware | 8500.00 |    15 |
+----+---------------------+----------+---------+-------+

The AS OF clause lets you time-travel to any commit in the history. This is useful for auditing and understanding how data evolved over time.

Step 11: Resolve Dolt Merge Conflicts

When two branches modify the same row, Dolt detects a conflict during merge - just like Git detects file conflicts. Here is how to handle them.

Create a conflict scenario

Start from main and create two branches that edit the same row:

$ dolt checkout main
$ dolt checkout -b team-a
$ dolt sql -q "UPDATE products SET price = 175.00 WHERE id = 4"
$ dolt add . && dolt commit -m "Team A: lower SSD price"

$ dolt checkout main
$ dolt checkout -b team-b
$ dolt sql -q "UPDATE products SET price = 210.00 WHERE id = 4"
$ dolt add . && dolt commit -m "Team B: raise SSD price"

Merge team-a into main first (this succeeds as a fast-forward), then merge team-b:

$ dolt checkout main
$ dolt merge team-a
$ dolt merge team-b
Auto-merging products
CONFLICT (content): Merge conflict in products

View and resolve conflicts

List tables with conflicts:

$ dolt conflicts cat products
+-----+----+---------------------+----------+--------+-------+
|     | id | name                | category | price  | stock |
+-----+----+---------------------+----------+--------+-------+
| base| 4  | Samsung 990 PRO 2TB | Storage  | 189.99 | 100   |
| ours| 4  | Samsung 990 PRO 2TB | Storage  | 175.00 | 100   |
|theirs| 4 | Samsung 990 PRO 2TB | Storage  | 210.00 | 100   |
+-----+----+---------------------+----------+--------+-------+

Resolve the conflict by choosing the value you want:

$ dolt sql -q "UPDATE products SET price = 185.00 WHERE id = 4"
$ dolt conflicts resolve products
All conflicts resolved for table 'products'

Commit the resolution:

$ dolt add .
$ dolt commit -m "Resolve SSD pricing conflict - compromise at 185.00"

Step 12: Import Data from CSV and JSON

Dolt supports importing data from CSV and JSON files using the dolt table import command. Use the -c flag to create a new table from a file, or -u to update an existing table.

Create a sample CSV file with additional products:

$ echo "id,name,category,price,stock" > new_products.csv
$ echo "7,APC Smart-UPS 1500,Power,650.00,25" >> new_products.csv
$ echo "8,Ubiquiti UniFi AP,Networking,99.00,200" >> new_products.csv
$ echo "9,WD Red Plus 8TB,Storage,179.99,75" >> new_products.csv

Import the CSV data into the existing products table:

$ dolt table import -u products new_products.csv
Rows Processed: 3, Additions: 3, Modifications: 0, Had No Effect: 0
Import completed successfully.

Verify the import:

$ dolt sql -q "SELECT * FROM products WHERE id > 6"
+----+--------------------+------------+--------+-------+
| id | name               | category   | price  | stock |
+----+--------------------+------------+--------+-------+
| 7  | APC Smart-UPS 1500 | Power      | 650.00 | 25    |
| 8  | Ubiquiti UniFi AP  | Networking | 99.00  | 200   |
| 9  | WD Red Plus 8TB    | Storage    | 179.99 | 75    |
+----+--------------------+------------+--------+-------+

Dolt Use Cases

Dolt fills a gap that traditional databases and version control systems cannot cover individually. Here are the most common production use cases.

Data versioning and auditing

Every change to every row is tracked with a commit hash, author, timestamp, and message. Regulatory environments that need complete audit trails - finance, healthcare, government - benefit from this built-in history. There is no need for trigger-based audit tables or separate change data capture pipelines.

Machine learning dataset management

ML teams frequently need to reproduce training runs against specific versions of a dataset. With Dolt, you tag a dataset version with a branch or commit, train your model, and always know exactly which data produced which results. When the dataset changes, a dolt diff shows precisely which rows were added, removed, or modified.

Collaborative data editing

Multiple team members can work on different branches of the same database, make independent changes, and merge them back together. DoltHub provides pull request-style reviews for data changes, similar to how code reviews work on GitHub. This is useful for managing SQL databases where multiple teams contribute to reference data.

Testing and staging databases

Branch a production database, run destructive tests or schema migrations on the branch, and discard or merge the results. No need to maintain separate database copies or restore from backups after testing.

Configuration and reference data

Store configuration tables, lookup values, pricing data, or geospatial reference data in Dolt. Every change is attributed to a person with a clear commit message, making it easy to answer "who changed this value and why?"

Dolt Command Reference

Here is a quick reference of the most used Dolt commands and their Git equivalents:

Dolt CommandGit EquivalentDescription
dolt initgit initInitialize a new database
dolt sqlN/AOpen interactive SQL shell
dolt add .git add .Stage all changes
dolt commit -m "msg"git commit -m "msg"Commit staged changes
dolt checkout -b namegit checkout -b nameCreate and switch branch
dolt merge branchgit merge branchMerge a branch
dolt diffgit diffShow row-level changes
dolt loggit logView commit history
dolt clone remote/dbgit clone urlClone a remote database
dolt push origin maingit push origin mainPush to remote
dolt pull origin maingit pull origin mainPull from remote
dolt conflicts resolveManual editResolve merge conflicts

Conclusion

Dolt brings Git-style version control to SQL databases, giving you branching, merging, diffing, and full commit history on structured data. The MySQL wire protocol compatibility means you can drop it into existing workflows without changing your application code or tooling.

For production deployments, run the Dolt SQL server behind a reverse proxy with TLS termination, set up regular dolt push schedules to DoltHub or a self-hosted remote for offsite backups, and monitor the server with Prometheus and Grafana using the built-in metrics endpoint.

Related Guides

LEAVE A REPLY

Please enter your comment!
Please enter your name here