Guide · Open source
How to use rqlite: run a node, create tables and query over HTTP
Updated · written with AI from the project's own documentation and checked against our catalogue data
rqlite is a relational database built on SQLite that can run as a cluster of nodes, replicating data so the database stays available if one node goes down. This guide shows how to start a node with Docker, create a table, insert a row and query it using plain HTTP requests and SQL. By the end you will have a working node you can talk to and know where to look next for clustering.
Quick start
- 1Start a node. Run docker run -p 4001:4001 rqlite/rqlite to start a rqlite node. The HTTP API listens on port 4001.
- 2Create a table and insert a row. POST a JSON array of SQL statements to localhost:4001/db/execute. The example creates table foo and inserts one row.
- 3Query the data. Send a GET request to localhost:4001/db/query with the SELECT statement in the q parameter.
- 4Read the docs for clustering. Follow the rqlite clustering guide to run multiple nodes for replication and high availability.
What you need before you start
The only prerequisite listed for the Docker install method is Docker itself. The examples below also use curl to send requests to the node's HTTP API, so having curl available on your machine makes the steps easy to follow.
- Docker installed and running
- curl available in your terminal
Run a rqlite node with Docker
Start a single rqlite node by running the official image and mapping port 4001. The HTTP API is then reachable on localhost port 4001.
docker run -p 4001:4001 rqlite/rqliteCreate a table and insert data
rqlite accepts ordinary SQL statements over its HTTP API. Send a POST request to the /db/execute endpoint with a JSON array of statements. This example creates a table called foo and inserts one row. The ?pretty parameter formats the response so it is easier to read.
curl -XPOST 'localhost:4001/db/execute?pretty' -H 'Content-Type: application/json' -d '[
"CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name TEXT)",
"INSERT INTO foo(id, name) VALUES(1, \"fiona\")"
]'Query your data
Read data by sending a GET request to the /db/query endpoint with your SQL in the q parameter. The -G flag tells curl to send the data as a query string, and --data-urlencode encodes the statement for you.
curl -G 'localhost:4001/db/query?pretty' --data-urlencode 'q=SELECT * FROM foo'Understand the main features
rqlite is built on SQLite, so it supports full SQL including full-text search and JSON support. Multiple SQL statements can be executed atomically within a single API request. It is distributed as a single binary with no external dependencies.
- Relational: full SQL via SQLite, including full-text search and JSON support
- Atomic requests: run multiple statements atomically in one API request
- High availability: a node outage does not impact the cluster
- Dynamic clustering via Kubernetes, Docker Compose, Consul, etcd, or DNS
- Backups, including automatic backups to AWS S3, MinIO and Google Cloud
- Security: end-to-end encryption with TLS and authentication/authorization controls
- Tunable read consistency and durability
Next steps: form a cluster
A single node is useful for trying things out, but the replication and fault tolerance come from running multiple nodes. The rqlite clustering guide explains how to form a multi-node cluster. The Developer Guide covers the full HTTP API and client libraries are also available.
What people use it for
- Storing important application data for services deployed in the cloud that must stay available
- Running a replicated SQL database for small-to-medium services without operating a large database server
- Powering lightweight applications at the edge where a single-binary database is useful
- Building apps that use SQL and JSON through a simple HTTP interface
Frequently asked questions
Is rqlite free to use?
rqlite is released under the MIT licence, which is an open-source licence. The source material does not describe any paid tiers, so check the licence file in the repository for the exact terms.
What do I need to install rqlite?
For the Docker method, the only listed prerequisite is Docker. You run the rqlite/rqlite image with a single docker run command, and the node starts listening on port 4001.
Is rqlite the same as SQLite?
No. rqlite is built on SQLite and uses SQLite's SQL support, but adds replication across a cluster of nodes and an HTTP API. Plain SQLite is simpler when you only need one local database file with no network access.
How is rqlite different from etcd?
The project itself describes rqlite as similar to etcd but with relational modeling available. etcd is a key-value store, while rqlite lets you use SQL tables.
Can rqlite handle very high write volumes?
The source does not make performance claims. Writes go through cluster consensus, so rqlite may not suit workloads that need very high write throughput. Benchmark it with your own workload before relying on it.
Which alternatives should I compare rqlite with?
Projects often compared with rqlite include etcd, Litestream, dqlite and Turso (libSQL). Pick based on whether you need replicated SQL, backups of a single SQLite file, or a key-value store.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
rqlite suits developers and small-to-medium cloud or edge teams who want a replicated SQL database with a simple HTTP interface and minimal operational work. If you only need one local SQLite file with no network access, or you need very high write throughput that you have not benchmarked, plain SQLite or another database is likely the better choice.
Install options & downloads