Deployment guide

SQLite 3.53

Overview

This guide covers the deployment and use of SQLite 3.53 on Ubuntu 24.04 on Azure using SecureAnyCloud Azure Marketplace images. SQLite is the world's most widely deployed embedded SQL engine — a single file, no daemon, no admin password, just a library and a CLI shell.

The image ships SQLite 3.53.0 built from upstream source with all modern compile options enabled: FTS3/4/5 full-text search, JSON1 functions and JSON path syntax, RTREE and GEOPOLY spatial virtual tables, math functions, the loadable-extensions API, column metadata, DBSTAT, and STMT. The library, CLI, headers, and pkg-config metadata are installed under /usr/local. PATH ordering puts /usr/local/bin/sqlite3 ahead of any system sqlite3 so the latest 3.53.0 is what sqlite3 resolves to on the customer's shell.

What is included:

SQLite 3.53.0 source build from sqlite.org installed to /usr/local with sha256 verification at install time

sqlite3 command line shell at /usr/local/bin/sqlite3 with readline support for interactive querying and dot commands

Shared library /usr/local/lib/libsqlite3.so and static library /usr/local/lib/libsqlite3.a for application linking

Header files /usr/local/include/sqlite3.h and sqlite3ext.h for C and C++ development

pkg-config metadata at /usr/local/lib/pkgconfig/sqlite3.pc for build system integration

FTS5 full-text search, JSON1 functions, RTREE / GEOPOLY spatial, math functions, and loadable extensions all compiled in

sqlite-firstboot.service systemd oneshot that writes a per-VM build-info banner to /stage/scripts/sqlite-credentials.log on first boot

Ubuntu 24.04 LTS base with latest security patches applied at build time

Azure Linux Agent for seamless cloud integration and SSH key injection

24/7 SecureAnyCloud support with guaranteed 24 hour response SLA

Prerequisites

You need an active Azure subscription, a subscription to the SQLite 3.53 on Ubuntu 24.04 listing on Azure Marketplace, an SSH public key for VM authentication, and a virtual network with a subnet in the target region.

Recommended VM size: Standard_B2s (2 vCPU, 4 GB RAM) for typical embedded application backends, prototyping and development workflows. SQLite is very efficient. Choose a larger size only for workloads that operate on multi-gigabyte database files or need high concurrent reader throughput.

1

Deploy from the Azure Portal

Open the Marketplace in the Azure Portal, search for SQLite 3.53 and select the SecureAnyCloud publisher entry. Choose Create.

On the Networking tab, attach a network security group that allows inbound TCP 22 from your management IP range. SQLite has no daemon and no listening ports, so TCP 22 (SSH) is the only port that must be reachable from wherever you administer the VM.

Select Review + create, wait for validation, then select Create. Deployment takes around two minutes.

2

Deploy from the Azure CLI

RG="sqlite-prod" LOCATION="eastus" VM_NAME="sqlite-01" ADMIN_USER="azureuser" GALLERY_IMAGE_ID="/subscriptions/<sub-id>/resourceGroups/azure-sac/providers/Microsoft.Compute/galleries/sacGallery/images/sqlite-3-53-ubuntu-24-04/versions/<version>" SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" az group create --name "$RG" --location "$LOCATION" az network vnet create \
  --resource-group "$RG" \
  --name sqlite-vnet --address-prefix 10.96.0.0/16 \
  --subnet-name sqlite-subnet --subnet-prefix 10.96.1.0/24 az network nsg create --resource-group "$RG" --name sqlite-nsg az network nsg rule create \
  --resource-group "$RG" --nsg-name sqlite-nsg \
  --name allow-ssh --priority 100 \
  --source-address-prefixes "<your-mgmt-cidr>" \
  --destination-port-ranges 22 --access Allow --protocol Tcp az vm create \
  --resource-group "$RG" --name "$VM_NAME" \
  --image "$GALLERY_IMAGE_ID" \
  --size Standard_B2s --storage-sku StandardSSD_LRS \
  --admin-username "$ADMIN_USER" --ssh-key-values "$SSH_KEY" \
  --vnet-name sqlite-vnet --subnet sqlite-subnet --nsg sqlite-nsg \
  --public-ip-sku Standard
3

Connect via SSH

ssh azureuser@<vm-ip>

By the time you connect, sqlite-firstboot.service has already run on first boot, written the build-info banner and disabled itself.

4

Verify the build-info banner and sentinel

Confirm that the first-boot sentinel exists. The command prints FIRSTBOOT_DONE:

sudo test -f /var/lib/sac/data/sqlite-firstboot.done && echo FIRSTBOOT_DONE

Read the build-info banner:

sudo cat /stage/scripts/sqlite-credentials.log

The banner includes SQLITE_VERSION=3.53.0, the binary, library and header paths, and a quickstart snippet.

5

Verify SQLite 3.53.0 on PATH

Check the version. Expect a single line that begins with 3.53.0, followed by the build date and source ID:

sqlite3 -version

Confirm which binary the shell resolves. Expect /usr/local/bin/sqlite3:

which sqlite3

Confirm the version that pkg-config reports. Expect 3.53.0:

pkg-config --modversion sqlite3

List the libraries and headers. Expect libsqlite3.so (symlink), libsqlite3.so.0 (symlink), libsqlite3.so.0.8.6 (real file), libsqlite3.a (static) and the two header files:

ls -la /usr/local/lib/libsqlite3.* /usr/local/include/sqlite3*.h
6

Open a database and run CREATE, INSERT and SELECT

Create a database, add three rows and read them back:

sqlite3 ~/notes.sqlite <<'SQL' CREATE TABLE notes(id INTEGER PRIMARY KEY, body TEXT NOT NULL, created TEXT DEFAULT CURRENT_TIMESTAMP); INSERT INTO notes(body) VALUES ('first note from sac'), ('second note'), ('third note'); SELECT id, body, created FROM notes ORDER BY id; SQL

The shell prints three rows with their auto-assigned ids and timestamps.

You can also open the interactive shell:

sqlite3 ~/notes.sqlite

Useful dot commands inside the shell include .tables, .schema notes, .headers on, .mode column, and .quit.

7

Try FTS5 full-text search

Run a full-text query against an in-memory FTS5 table:

sqlite3 :memory: <<'SQL' CREATE VIRTUAL TABLE doc USING fts5(body); INSERT INTO doc VALUES ('the quick brown fox jumps over the lazy dog'); INSERT INTO doc VALUES ('a stitch in time saves nine'); INSERT INTO doc VALUES ('the early bird catches the worm'); SELECT body FROM doc WHERE body MATCH 'fox OR bird'; SQL

The query returns two rows: the fox sentence and the bird sentence.

8

Try JSON1 functions

Extract a value from a JSON document and build a JSON object:

sqlite3 :memory: <<'SQL' SELECT json_extract('{"product":"sqlite","version":"3.53","modules":["fts5","rtree","json1"]}', '$.modules[1]'); SELECT json_object('a', 1, 'b', json_array(2, 3, 4)); SQL

The first query returns rtree, and the second returns a JSON object string.

9

Try math functions

Call the built-in math functions:

sqlite3 :memory: <<'SQL' SELECT round(pi(), 4); SELECT round(pow(2, 10)); SELECT round(sqrt(2), 6); SQL

The queries return 3.1416, 1024.0 and 1.414214.

10

Compile a C program against libsqlite3

Install gcc, then compile and run a small program that links the installed library:

sudo apt-get install -y --no-install-recommends gcc cat > /tmp/sqlite_demo.c <<'C' #include <stdio.h> #include <sqlite3.h> int main(void) { sqlite3 *db; sqlite3_stmt *stmt; sqlite3_open(":memory:", &db); sqlite3_prepare_v2(db, "SELECT sqlite_version();", -1, &stmt, NULL); sqlite3_step(stmt); printf("linked sqlite version: %s\n", sqlite3_column_text(stmt, 0)); sqlite3_finalize(stmt); sqlite3_close(db); return 0; } C gcc /tmp/sqlite_demo.c $(pkg-config --cflags --libs sqlite3) -o /tmp/sqlite_demo LD_LIBRARY_PATH=/usr/local/lib /tmp/sqlite_demo

The program prints linked sqlite version: 3.53.0.

Notes on concurrency and backups

SQLite handles many concurrent readers but serializes writers with a per-database lock. For higher write throughput, enable WAL mode after you create a database:

sqlite3 ~/notes.sqlite "PRAGMA journal_mode = WAL;"

The command prints wal. For most workloads, WAL mode lets readers and a single writer operate concurrently without blocking each other.

For backups, the safest approach is the online .backup command. It works while readers and writers are active:

sqlite3 ~/notes.sqlite ".backup ~/notes.sqlite.bak" ls -la ~/notes.sqlite ~/notes.sqlite.bak

For point-in-time copies of static databases, plain cp is also safe.

Where things live

Path Purpose

/usr/local/bin/sqlite3 SQLite 3.53.0 command line shell (in PATH ahead of any system sqlite3)

/usr/local/lib/libsqlite3.so Shared library (symlink to libsqlite3.so.0.8.6)

/usr/local/lib/libsqlite3.a Static library

/usr/local/include/sqlite3.h Public C API header

/usr/local/include/sqlite3ext.h Loadable extensions API header

/usr/local/lib/pkgconfig/sqlite3.pc pkg-config metadata

/stage/scripts/sqlite-credentials.log Build-info banner (mode 0600 root:root)

/var/lib/sac/data/sqlite-firstboot.done First-boot sentinel

/var/log/sqlite-firstboot.log First-boot service log

Stock Ubuntu sqlite3 coexistence

Ubuntu 24.04 noble main ships an older sqlite3 package (3.45.x), which is not preinstalled on this image. If system tooling needs the stock 3.45.x binary at /usr/bin/sqlite3, install it alongside the upstream build:

sudo apt-get install -y sqlite3 which -a sqlite3

PATH still resolves sqlite3 to /usr/local/bin/sqlite3 first, so the upstream 3.53.0 build remains the default. To use the stock binary, call it explicitly as /usr/bin/sqlite3.

Support

For technical support, contact sales@secureanycloud.com. We provide 24/7 expert support with a guaranteed 24 hour response for all requests and a one hour average for critical issues. Visit secureanycloud.com for documentation and additional resources.

Deploy on Azure

Launch SQLite 3.53 on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure