Installing Turso CLI (Spoiler: It's Less Painful Than Expected)

Turso Database Dashboard

Look, I've installed enough database CLIs to know they usually break in creative ways. Postgres psql needs 47 environment variables set just right. MongoDB's CLI randomly forgets how to connect. MySQL's CLI still feels like it's from 1995.

Turso CLI is different. As of September 2025, it actually fucking works on the first try. They're pushing updates every few weeks - audit logging, database branching, performance improvements. Someone's clearly eating their own dog food because this thing doesn't feel abandoned like half the database tools gathering dust on GitHub.

Homebrew Installation (Usually Works, Sometimes Doesn't)

If you're on macOS or Linux, start here:

brew install tursodatabase/tap/turso

Homebrew is usually the fastest route unless brew decides to rebuild half the universe because you touched a dependency. Takes 30 seconds on a good day, 20 minutes if you're unlucky.

After installation, the binary should be in your PATH. Should be. If you get command not found: turso, restart your terminal or run source ~/.zshrc (macOS) or source ~/.bashrc (Linux). On macOS Monterey and newer, sometimes the PATH doesn't update until you close everything and open a new terminal window. Don't ask me why.

To upgrade when they inevitably fix something you didn't know was broken:

brew upgrade turso

Universal Install Script (For When Homebrew Breaks)

For all Unix-like systems, there's the usual curl-pipe-bash approach:

curl -sSfL https://get.tur.so/install.sh | bash

The script detects your platform automatically unless you're on some weird ARM setup or Alpine Linux, which confuses the hell out of everything. Drops the binary in /usr/local/bin and needs sudo access.

The install script works great until you're behind a corporate firewall. Then you'll spend 2 hours figuring out HTTP_PROXY and HTTPS_PROXY settings, only to discover your company blocks the domain entirely. If you see "Connection refused" or timeouts, blame your network team.

Go Installation (For the Masochistic)

If you're already in the Go ecosystem and have Go set up:

go install github.com/tursodatabase/turso-cli/cmd/turso@latest

Go installation looks deceptively simple until you realize:

  1. You need Go 1.21+ and your Ubuntu box has 1.19 from the stone age
  2. Your $GOPATH/bin isn't in PATH (it never fucking is)
  3. The build fails with some cryptic dependency error about golang.org/x/sys

When it works, it works great. When it doesn't, you'll question your life choices. The binary ends up in $GOPATH/bin/turso or ~/go/bin/turso if you didn't set GOPATH.

Manual Binary Download

Download pre-compiled binaries from GitHub releases for your platform:

  • Linux AMD64: turso-linux-amd64
  • Linux ARM64: turso-linux-arm64
  • macOS AMD64: turso-darwin-amd64
  • macOS ARM64: turso-darwin-arm64
  • Windows: turso-windows-amd64.exe

Extract and add to your $PATH manually. This approach works for air-gapped environments or when you need specific version control.

Verification and Initial Setup

After installation, make sure it actually works:

turso --version

If you get command not found, the binary isn't in your PATH. Check your shell config file and add the path, then restart your terminal.

Config files get scattered across your system like every other CLI tool:

  • Linux: ~/.config/turso/settings.json (or wherever XDG Base Directory thinks it should be)
  • macOS: ~/Library/Application Support/turso/settings.json (buried in Application Support)
  • Windows: %APPDATA% urso\settings.json

The config file has your auth tokens. Don't commit this to Git unless you want to leak your API keys to everyone. For CI/CD, use environment variables instead of config files. The auth docs cover headless authentication for automated deployments.

Essential Commands and Authentication Hell

Getting Started with Authentication (aka The OAuth Shitshow)

The CLI needs to talk to Turso Cloud, so you get to dance the authentication tango. For new users:

turso auth signup

This tries to launch your default browser for GitHub OAuth. "Tries" being the operative word here. Sometimes it opens Internet Explorer on Windows (yes, really). Sometimes it opens nothing at all. Sometimes it opens your browser but to the wrong URL.

For existing users who already went through this pain:

turso auth login

OAuth login breaks in the stupidest ways. I've seen it:

  • Hang forever on WSL2 because the browser bridge is fucked
  • Fail silently on Linux desktop environments that hate life
  • Open the browser but not actually complete the handshake
  • Work perfectly 9 times, then randomly break on attempt 10

When OAuth decides to shit the bed, kill the process (Ctrl+C) and use the headless version:

turso auth login --headless

This gives you a URL to copy-paste manually, which actually works reliably. Perfect for CI/CD environments or when your desktop decides browsers are optional today.

Database Management (That Usually Works)

Creating Databases

## Auto-generated name in closest location
turso db create

## Specify database name (do this or you'll get random garbage)
turso db create my-project-db

## Create in specific location
turso db create my-db --location ord

The CLI picks the closest location automatically. Usually works fine - gets you Chicago, Frankfurt, Sydney, whatever's closest. Sometimes it picks weird locations for no apparent reason.

turso db create will shit itself if you pick a name someone already took globally. Yes, it's globally namespaced across all Turso users, which is fucking annoying until you realize it prevents name conflicts. You'll get this useless error:

Error: database name 'test' is already taken

Cool, thanks. Try my-test-db-2025 or test-dont-delete like the rest of us.

Database Operations

## List all databases (check if you created too many)
turso db list

## Show database details and connection info
turso db show my-db

## Get connection URL for applications
turso db show my-db --url

## Delete database (there's no undo button)
turso db destroy my-db

Interactive SQL Shell

Access your database directly from the terminal:

## Launch interactive shell
turso db shell my-db

## Execute single command
turso db shell my-db \"SELECT * FROM users LIMIT 5\"

## Run SQL file
turso db shell my-db < migration.sql

The shell uses SQLite syntax with some extra libSQL features for vector search and other stuff.

Database Replication and Groups

Turso Schema Database Overview

Location Management

## List available edge locations
turso db locations

## Replicate database to multiple regions
turso db replicate my-db lhr  # London
turso db replicate my-db syd  # Sydney

Replication reduces latency by creating read replicas in multiple regions. The edge architecture puts your data closer to users with sub-100ms latency worldwide. The replication system handles conflict resolution automatically.

Group Management

Groups manage databases sharing the same schema across locations:

## Create group with primary location
turso group create production-group --location ord

## Add locations to group
turso group locations add production-group fra

## Create database in group
turso db create prod-db --group production-group

Groups enable schema synchronization and consistent replication policies across related databases. The Multi-DB Schema feature supports database-per-tenant architectures with automatic schema migrations across thousands of databases.

Token and Access Management

Turso Token Creation Interface

API Tokens

## Create read-write token for specific database
turso db tokens create my-db

## Create read-only token
turso db tokens create my-db --readonly

## Token with expiration
turso db tokens create my-db --expiration 1h

The token system supports fine-grained permissions including ATTACH permissions for multi-database queries. For production deployments, use long-lived tokens with appropriate scoping.

Organization Management

## View current organization
turso org show

## Invite team members
turso org invite user@company.com

## Manage billing (requires admin role)
turso plan show
turso plan upgrade

The CLI integrates with Turso's pricing tiers and organization features for team collaboration. Billing management includes usage monitoring and overage controls, while team management supports role-based access across enterprise deployments.

Database CLI Tools Comparison

Feature

Turso CLI

SQLite CLI

PostgreSQL psql

MySQL CLI

Installation

Homebrew, curl script, Go

Pre-installed most systems

Package managers

Package managers

Authentication

GitHub OAuth via browser

None (local files)

Username/password

Username/password

Cloud Integration

Native Turso Cloud

None

External hosting required

External hosting required

Database Creation

turso db create

Manual file creation

createdb command

mysql -e \"CREATE DATABASE\"

Interactive Shell

turso db shell

sqlite3 file.db

psql database

mysql database

Replication

Built-in edge replication

Manual file copying

Streaming replication setup

Master-slave configuration

Schema Migration

SQL files via shell

SQL files via sqlite3

Migration tools required

Migration tools required

Multi-user Access

Token-based with roles

File system permissions

Role-based access control

User privileges system

Remote Connections

HTTPS API integration

Local files only

TCP/SSL connections

TCP/SSL connections

Backup/Export

Cloud-managed

.backup` command

pg_dump

mysqldump

Vector Search

Built-in libSQL support

Extensions required

pgvector extension

No native support

Branching

Database branches

File copies

Manual schema management

Manual schema management

Global Distribution

Automatic edge locations

Manual deployment

Complex replication setup

Complex replication setup

Pricing Model

Freemium cloud service

Free (local only)

Self-hosted or cloud pricing

Self-hosted or cloud pricing

Questions Every Developer Asks (And The Real Answers)

Q

Why does my terminal say "command not found: turso" after I installed it?

A

Because the binary isn't in your $PATH, which is the #1 reason any CLI installation "doesn't work." It's installed, it's just hiding where your shell can't find it.For Homebrew: Restart your terminal or run source ~/.zshrc (macOS) or source ~/.bashrc (Linux). Sometimes macOS is a bitch about PATH updates and you need to fully quit Terminal.app and reopen it.For manual installations: Add it to your PATH like this:bashexport PATH="$PATH:/usr/local/bin"On Windows: Add the directory containing turso.exe to your system PATH through Environment Variables. That menu is buried in Control Panel → System → Advanced → Environment Variables. Windows makes this way harder than it needs to be.

Q

I lost my auth token or it stopped working, now what?

A

Just run turso auth login again.

The CLI generates a new token and overwrites the old one in your settings file. Your databases don't disappear

  • the token is just for CLI access.For CI/CD, regenerate API tokens with turso db tokens create. Auth tokens expire eventually and the CLI gives you helpful error messages like "unauthorized" with zero context about why. So you'll be debugging for 20 minutes before you remember tokens expire.
Q

Can I use Turso CLI with existing SQLite files?

A

Yes, migrate existing SQLite databases using:bashturso db create my-db --from-file ~/path/to/existing.dbThe CLI uploads your local SQLite file to Turso Cloud, creating a new managed database. Your original file remains unchanged. Check the migration guide for detailed steps.

Q

How do I work with Turso CLI in CI/CD pipelines?

A

Use the headless authentication mode:bash# Set environment variable with your tokenexport TURSO_TOKEN="your-api-token"# Login without browser interaction turso auth login --headless# Run database operationsturso db shell my-db "CREATE TABLE users (id INTEGER PRIMARY KEY)"Generate long-lived API tokens using turso auth api-tokens mint for automated deployments.

Q

Why does `turso db shell` give me connection errors?

A

Connection errors are usually one of these fun problems:

  1. Wrong database name (check with turso db list
  • it's probably not what you think it is)2. Your network is fucked
    • corporate firewalls love blocking api.turso.tech3. Auth token expired
    • run turso auth login again
  1. The database actually doesn't exist
  • you deleted it by accidentThe error messages are about as helpful as a chocolate teapot:Error: failed to connect to databaseThanks, Turso. Real useful. Check turso db list first, then curse your corporate IT team.
Q

How do I delete all data without destroying the database?

A

Connect to the database shell and drop all tables:bashturso db shell my-db# In the SQL shell:.schema # List all tablesDROP TABLE table1;DROP TABLE table2;# Repeat for all tablesAlternatively, destroy and recreate the database if you don't need to preserve the database URL or configuration.

Q

Can I run Turso CLI commands from scripts?

A

Yes, the CLI is designed for automation. Use --json flags for machine-readable output:bashturso db list --json | jq '.[] | .name'Combine with standard Unix tools like jq for processing results. All commands return appropriate exit codes for error handling in scripts.

Q

How much can I store before they start charging me?

A

Turso Usage DashboardTurso's free tier gives you 100 databases with 5GB total storage. That's pretty generous for getting started, but the free tier limits hit faster than you think if you're prototyping multiple apps.Check your current usage:bashturso org showMonitor storage through the Turso Cloud dashboard. You'll get warnings before hitting limits, unlike some cloud services that surprise you with bills.

Q

How do I backup databases created with Turso CLI?

A

Turso manages backups automatically through their cloud infrastructure. For manual exports:bash# Export SQL dumpturso db shell my-db ".dump" > backup.sql# Or export as SQLite fileturso db shell my-db ".backup backup.db"The CLI doesn't provide direct backup commands since Turso Cloud handles disaster recovery and point-in-time restoration.

Q

Does Turso CLI work offline?

A

No, the CLI requires internet connectivity to communicate with Turso Cloud. For offline development, use local development mode:bashturso dev --port 8080This starts a local SQLite-compatible server for development without cloud connectivity.

Related Tools & Recommendations

tool
Similar content

libSQL - SQLite That Actually Works Over the Network

libSQL overview: network-enabled SQLite. Learn its purpose, key features (embedded replicas), and how it solves distributed database challenges for modern appli

libSQL
/tool/libsql/overview
100%
tool
Similar content

Turso CLI Database Branching: Git-like Workflows for Databases

Database versioning that doesn't make you want to quit programming

Turso CLI
/tool/turso-cli/database-branching-workflow
87%
tool
Recommended

SQLite Performance: When It All Goes to Shit

Your database was fast yesterday and slow today. Here's why.

SQLite
/tool/sqlite/performance-optimization
70%
tool
Recommended

SQLite - The Database That Just Works

Zero Configuration, Actually Works

SQLite
/tool/sqlite/overview
70%
compare
Recommended

PostgreSQL vs MySQL vs MariaDB vs SQLite vs CockroachDB - Pick the Database That Won't Ruin Your Life

alternative to sqlite

sqlite
/compare/postgresql-mysql-mariadb-sqlite-cockroachdb/database-decision-guide
70%
tool
Similar content

GitHub CLI - Stop Alt-Tabbing to GitHub Every 5 Minutes

Discover GitHub CLI (gh), the essential command-line tool that streamlines your GitHub workflow. Learn why you need it, how to install it, and troubleshoot comm

/tool/github-cli/overview
63%
tool
Similar content

Turso: SQLite Rewritten in Rust – Fixing Concurrency Issues

They rewrote SQLite from scratch to fix the concurrency nightmare. Don't use this in production yet.

Turso Database
/tool/turso/overview
53%
integration
Recommended

Stop Making Users Refresh to See Their Subscription Status

Real-time sync between Supabase, Next.js, and Stripe webhooks - because watching users spam F5 wondering if their payment worked is brutal

Supabase
/integration/supabase-nextjs-stripe-payment-flow/realtime-subscription-sync
53%
integration
Recommended

Vercel + Supabase + Stripe: Stop Your SaaS From Crashing at 1,000 Users

competes with Vercel

Vercel
/integration/vercel-supabase-stripe-auth-saas/vercel-deployment-optimization
53%
integration
Recommended

Deploy Next.js + Supabase + Stripe Without Breaking Everything

The Stack That Actually Works in Production (After You Fix Everything That's Broken)

Supabase
/integration/supabase-stripe-nextjs-production/overview
53%
howto
Similar content

Install GitHub CLI: A Step-by-Step Setup Guide

Tired of alt-tabbing between terminal and GitHub? Get gh working so you can stop clicking through web interfaces

GitHub CLI
/howto/github-cli-install/complete-setup-guide
47%
tool
Similar content

MariaDB Overview: The MySQL Alternative & Installation Guide

Discover MariaDB, the powerful open-source alternative to MySQL. Learn why it was created, how to install it, and compare its benefits for your applications.

MariaDB
/tool/mariadb/overview
44%
howto
Similar content

Pyenv: Master Python Versions & End Installation Hell

Stop breaking your system Python and start managing versions like a sane person

pyenv
/howto/setup-pyenv-multiple-python-versions/overview
44%
tool
Similar content

LM Studio: Run AI Models Locally & Ditch ChatGPT Bills

Finally, ChatGPT without the monthly bill or privacy nightmare

LM Studio
/tool/lm-studio/overview
44%
tool
Similar content

Warp Terminal Overview: A Modern CLI Experience That Works

The first terminal that doesn't make you want to throw your laptop

Warp
/tool/warp/overview
42%
tool
Similar content

Bulma CSS Framework: Overview, Installation & Why It Makes Sense

Finally, a CSS framework that doesn't make you want to rage-quit frontend development

Bulma
/tool/bulma/overview
42%
tool
Similar content

Vertical Pod Autoscaler (VPA) Overview: Optimize Kubernetes Resources

Watches your pods and figures out how much CPU and memory they actually need, then adjusts requests so you don't have to guess

Vertical Pod Autoscaler (VPA)
/tool/vertical-pod-autoscaler/overview
41%
tool
Similar content

kubectl: Kubernetes CLI - Overview, Usage & Extensibility

Because clicking buttons is for quitters, and YAML indentation is a special kind of hell

kubectl
/tool/kubectl/overview
39%
tool
Similar content

rust-analyzer - Finally, a Rust Language Server That Doesn't Suck

After years of RLS making Rust development painful, rust-analyzer actually delivers the IDE experience Rust developers deserve.

rust-analyzer
/tool/rust-analyzer/overview
39%
news
Recommended

Google Avoids $2.5 Trillion Breakup in Landmark Antitrust Victory

Federal judge rejects Chrome browser sale but bans exclusive search deals in major Big Tech ruling

OpenAI/ChatGPT
/news/2025-09-05/google-antitrust-victory
38%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization