Skip to content

Installation

Before installing Scalar, make sure you have:

  • Node.js 18 or later
  • A package manager (npm, yarn, or pnpm)
  • A database (PostgreSQL, MySQL, or SQLite)
  1. Terminal window
    npx create-next-app@latest my-scalar-app
    cd my-scalar-app
  2. Terminal window
    npm install @scalar/core @scalar/ui @scalar/cli
  3. Terminal window
    npx scalar init
  4. Add your database configuration to .env.local:

    .env.local
    DATABASE_URL="postgresql://username:password@localhost:5432/mydb"
    SCALAR_SECRET="your-secret-key"
Terminal window
# Install PostgreSQL (macOS)
brew install postgresql
brew services start postgresql
# Create a database
createdb my-scalar-db
Terminal window
# Install MySQL (macOS)
brew install mysql
brew services start mysql
# Create a database
mysql -u root -p -e "CREATE DATABASE my_scalar_db;"

For development, you can use SQLite which requires no additional setup:

.env
DATABASE_URL="file:./dev.db"

After installation, verify everything is working:

Terminal window
npx scalar generate
npx scalar migrate
npm run dev

Visit your application and you should see the Scalar admin interface at /admin.