Skip to main content
Get your TrailBase backend server running and create your first API in under 5 minutes.

Install TrailBase

The install script downloads the latest release binary and adds it to your PATH. For more installation options, see the Installation Guide.

Start the Server

Run TrailBase with a single command:
On first start, TrailBase will:
  • Create a ./traildepot directory for data and configuration
  • Initialize a SQLite database
  • Create an admin user with credentials printed to the terminal
  • Start the server on http://localhost:4000
Save the admin credentials displayed in the terminal - you’ll need them to access the dashboard.

Access the Admin Dashboard

Open http://localhost:4000/_/admin/ in your browser and log in with the credentials from the previous step. The admin dashboard lets you:
  • Create and manage database tables
  • Configure Record APIs with access rules
  • Manage users and authentication
  • View logs and monitor your server

Create Your First Table

Let’s create a simple “posts” table for a blog:
1

Navigate to Tables

In the admin dashboard, go to SchemaTables and click Create Table.
2

Define the Schema

Create a table with the following columns:
Click Execute to create the table.
3

Configure the API

Go to APIsRecord APIs and click Create API:
  • Table: posts
  • Name: posts
  • Read Access: Public (for now)
  • Create Access: Authenticated
  • Update/Delete Access: Owner only
Click Save.

Test Your API

Your posts API is now live! Test it with curl:

List all posts

Create a post (requires authentication)

First, create a user and get an auth token:
Then create a post using the auth token:

Query posts

Use a Client SDK

Instead of raw HTTP requests, use one of TrailBase’s client libraries:

Enable Realtime Subscriptions

Subscribe to live updates on your posts table:
Any changes to the posts table will trigger your callbacks in realtime!

Next Steps

Build Your First App

Complete tutorial building a full application

Database Setup

Learn about schema design and migrations

Authentication

Add user auth with OAuth providers

API Reference

Explore the complete REST API