Skip to main content

Overview

SQLPage is distributed as a single executable file with zero dependencies. Choose the installation method that best fits your workflow.

Executables

Download pre-built binaries for instant setup

Docker

Run in containers for easy deployment

Package Managers

Install via Homebrew, Scoop, or Cargo

Build from Source

Compile from the Rust source code

Using Executables

The fastest way to get started. Download the appropriate binary for your operating system.

Download and Extract

# Download the latest release
wget https://github.com/sqlpage/SQLPage/releases/latest/download/sqlpage-linux.tgz

# Extract
tar -xzf sqlpage-linux.tgz

# Make executable
chmod +x sqlpage.bin

# Run SQLPage
./sqlpage.bin

Install System-Wide (Optional)

sudo mv sqlpage.bin /usr/local/bin/sqlpage
sqlpage  # Run from anywhere
Linux binaries are compiled for x86_64. For ARM architectures (Raspberry Pi, ARM cloud instances), use the Docker image.

Using Docker

Run SQLPage in a container with consistent behavior across all platforms. Docker images support x86_64, ARM64, and ARMv7.

Quick Start

docker run -it --name sqlpage -p 8080:8080 \
  --volume "$(pwd):/var/www" \
  --rm lovasoa/sqlpage
This mounts your current directory as /var/www inside the container, allowing SQLPage to serve your .sql files.

Docker Compose

Create a docker-compose.yml for more complex setups:
docker-compose.yml
services:
  sqlpage:
    image: lovasoa/sqlpage:latest
    ports:
      - "8080:8080"
    volumes:
      - ./website:/var/www
      - ./config:/etc/sqlpage:ro
    environment:
      - DATABASE_URL=postgres://user:password@db:5432/myapp
    depends_on:
      - db

  db:
    image: postgres:16
    environment:
      - POSTGRES_PASSWORD=password
      - POSTGRES_USER=user
      - POSTGRES_DB=myapp
    volumes:
      - postgres_data:/var/lib/postgresql/data

volumes:
  postgres_data:
Run with:
docker compose up

Docker Image Variants

SQLPage provides specialized images for different use cases:
docker pull lovasoa/sqlpage:latest
docker pull lovasoa/sqlpage:main
  • Busybox-based, minimal size (~20 MB)
  • Supports SQLite, PostgreSQL, MySQL, SQL Server
  • No additional database drivers

Custom Docker Image

To add your own dependencies or customize the environment:
Dockerfile
FROM debian:stable-slim

# Copy SQLPage binary from official image
COPY --from=lovasoa/sqlpage:main /usr/local/bin/sqlpage /usr/local/bin/sqlpage

# Add your custom setup
RUN apt-get update && apt-get install -y \
    ca-certificates \
    your-dependencies \
    && rm -rf /var/lib/apt/lists/*

# Copy your application
COPY ./website /var/www
COPY ./config /etc/sqlpage

EXPOSE 8080
CMD ["sqlpage"]
The official SQLPage image is intentionally minimal. Don’t use it as a base image directly—it won’t have the dependencies you need. Use Debian as shown above.

Package Managers

Homebrew (macOS)

The easiest installation method for macOS users:
# Install
brew install sqlpage

# Run
sqlpage

Scoop (Windows)

For Windows users who prefer command-line package management:
# Add the extras bucket (first time only)
scoop bucket add extras

# Install SQLPage
scoop install sqlpage

# Run
sqlpage

Cargo (Rust)

Install from source via Cargo:
# Install Rust if needed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install SQLPage
cargo install sqlpage --locked

# Run
sqlpage

Nix

For NixOS or Nix users:
nix-shell -p sqlpage

ODBC Setup (Optional)

SQLPage includes native drivers for SQLite, PostgreSQL, MySQL, and SQL Server. ODBC support is only needed for other databases like DuckDB, Snowflake, Oracle, BigQuery, MongoDB, or ClickHouse.
Skip this section if you’re using SQLite, PostgreSQL, MySQL, or SQL Server.

Linux

SQLPage binaries include a statically-linked unixODBC driver manager. You only need to install database-specific ODBC drivers.
# Ubuntu/Debian
wget https://github.com/duckdb/duckdb/releases/latest/download/duckdb_odbc-linux-amd64.zip
unzip duckdb_odbc-linux-amd64.zip -d /opt/duckdb

# Configure connection
export DATABASE_URL="Driver=/opt/duckdb/libduckdb_odbc.so;Database=/path/to/my.duckdb"
Use the lovasoa/sqlpage:latest-duckdb Docker image to skip manual installation.

macOS

macOS binaries also include a statically-linked unixODBC driver manager:
# Install unixODBC (for driver management tools)
brew install unixodbc

# Install DuckDB ODBC driver example
brew install duckdb

# Configure connection
export DATABASE_URL="Driver=/usr/local/lib/libduckdb_odbc.dylib;Database=/path/to/my.duckdb"

Windows

Windows uses native ODBC drivers:
  1. Download and install the ODBC driver for your database
  2. Configure a DSN (Data Source Name) using ODBC Data Source Administrator:
    • Press Win + R, type odbcad32, press Enter
    • Go to System DSN tab → Add
    • Select your driver and configure connection details
  3. Set the connection string:
$env:DATABASE_URL="DSN=MyDataSource"
Or use a driver string directly:
$env:DATABASE_URL="Driver={PostgreSQL Unicode};Server=localhost;Database=mydb;UID=user;PWD=password"

ODBC Connection String Format

ODBC connection strings follow this pattern:
Driver=/path/to/driver.so;Server=hostname;Database=dbname;UID=user;PWD=password;[Additional=Options]
Examples:
DATABASE_URL="Driver=/opt/duckdb/libduckdb_odbc.so;Database=/data/analytics.duckdb"
Refer to your database’s official ODBC documentation for connection string parameters and driver paths.

Configuration

After installation, configure SQLPage using environment variables or a configuration file.

Environment Variables

Set environment variables before running SQLPage:
export DATABASE_URL="sqlite://myapp.db?mode=rwc"
export SQLPAGE_WEB_ROOT="/var/www/myapp"
export SQLPAGE_PORT=8080
sqlpage

Configuration File

Create sqlpage/sqlpage.json in your web root:
sqlpage/sqlpage.json
{
  "database_url": "postgres://user:password@localhost/myapp",
  "listen_on": "0.0.0.0:8080",
  "web_root": ".",
  "max_uploaded_file_size": 10485760
}
Configuration files support JSON, JSON5, TOML, and YAML formats.

Common Configuration Options

OptionDescriptionDefault
database_urlDatabase connection stringsqlite://sqlpage.db?mode=rwc
listen_onIP and port to bind0.0.0.0:8080
web_rootDirectory containing .sql files. (current directory)
configuration_directoryLocation of sqlpage/ config folder./sqlpage/
https_domainDomain for automatic HTTPS/SSL(disabled)
environmentdevelopment or productiondevelopment
See the Configuration Guide for all options.

Verify Installation

Test that SQLPage is working:
# Create a test page
echo "SELECT 'text' as component, 'SQLPage is working!' as contents;" > test.sql

# Start SQLPage
sqlpage

# Visit http://localhost:8080/test.sql
You should see “SQLPage is working!” in your browser.

Running as a Service

systemd (Linux)

Create /etc/systemd/system/sqlpage.service:
[Unit]
Description=SQLPage Web Server
After=network.target

[Service]
Type=simple
User=www-data
WorkingDirectory=/var/www/myapp
Environment="DATABASE_URL=postgres://user:pass@localhost/myapp"
ExecStart=/usr/local/bin/sqlpage
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable sqlpage
sudo systemctl start sqlpage
sudo systemctl status sqlpage

Docker with Restart Policy

docker run -d --name sqlpage \
  --restart unless-stopped \
  -p 8080:8080 \
  -v $(pwd)/website:/var/www \
  -v $(pwd)/data:/var/lib/sqlpage \
  lovasoa/sqlpage:latest

Next Steps

Quickstart Tutorial

Build your first application

Database Connections

Configure your database

HTTPS Setup

Enable automatic SSL certificates

Deployment Guide

Deploy to production

Troubleshooting

Port Already in Use

If port 8080 is occupied:
export SQLPAGE_PORT=3000
sqlpage

Permission Denied (Linux/macOS)

Ensure the binary is executable:
chmod +x sqlpage.bin

Database Connection Fails

Enable debug logging:
export RUST_LOG=sqlpage=debug
sqlpage
This will show detailed connection information.

Docker Volume Permissions

If SQLPage can’t write to mounted volumes:
# Fix ownership
sudo chown -R 1000:1000 ./website

# Or run as root (development only)
docker run --user root ...

Need Help?

Ask questions on GitHub Discussions

Build docs developers (and LLMs) love