Skip to main content
Self-hosting is currently in beta. Please report any issues on GitHub.
Better Auth Studio can be self-hosted and deployed alongside your application for production use. This allows you to have complete control over your authentication admin interface and keep it within your infrastructure.

Why Self-Host?

Self-hosting Better Auth Studio provides several benefits:
  • Full Control: Deploy and manage the studio within your own infrastructure
  • Production Ready: Run the admin interface alongside your production application
  • Custom Branding: Apply your own branding, themes, and customization
  • Access Control: Restrict access to specific roles or email addresses
  • Framework Agnostic: Works with Next.js, Express, Hono, SvelteKit, Remix, Nuxt, and more

Installation

For self-hosting, install better-auth-studio as a regular dependency (not devDependency) since it’s required at runtime in production.
npm install better-auth-studio
The CLI usage (standalone studio) can be installed as a dev dependency, but self-hosting requires it in dependencies for production deployments.

Quick Start

1

Initialize Configuration

Run the initialization command to create a studio.config.ts file:
pnpx better-auth-studio init
This creates a configuration file in your project root:
studio.config.ts
import type { StudioConfig } from "better-auth-studio";
import { auth } from "./lib/auth";

const config: StudioConfig = {
  auth,
  basePath: "/api/studio",
  metadata: {
    title: "Admin Dashboard",
    theme: "dark",
  },
  access: {
    roles: ["admin"],
    allowEmails: ["[email protected]"],
  },
};

export default config;
2

Set Up Framework Adapter

Choose your framework and follow the appropriate setup guide:
3

Access the Studio

Once configured, access the studio at the path you specified in basePath:
http://localhost:3000/api/studio

Configuration Options

The StudioConfig type accepts the following options:
OptionTypeRequiredDescription
authBetterAuthYesYour Better Auth instance
basePathstringYesURL path where studio is mounted (e.g., /api/studio)
accessStudioAccessConfigNoAccess control configuration
metadataStudioMetadataNoCustom branding and UI configuration
lastSeenAtStudioLastSeenAtConfigNoEnable last-seen tracking
ipAddressStudioIpAddressConfigNoIP geolocation for Events/Sessions
eventsEventsConfigNoEvent tracking configuration
toolsToolsConfigNoConfigure which tools to show/hide
For detailed configuration options, see the Configuration page.

Supported Frameworks

Better Auth Studio provides adapters for all major frameworks:
  • Next.js - App Router with catch-all routes
  • Express - Express.js middleware
  • Hono - Hono framework handler
  • SvelteKit - SvelteKit server routes
  • Remix - Remix resource routes
  • Nuxt - Nuxt server API routes
Each adapter provides a betterAuthStudio() function that creates a framework-specific handler.

Next Steps

Next.js Setup

Set up Better Auth Studio with Next.js App Router

Express Setup

Integrate with Express.js applications

Other Frameworks

Hono, SvelteKit, Remix, and Nuxt setup guides

Configuration

Learn about all configuration options

Build docs developers (and LLMs) love