StudyStudio
Custom Server Environment

Authentication

Production auth on your own server

Set the Auth Secret

Ensure BETTER_AUTH_SECRET is set in both the server .env and the Convex dashboard environment.

Point URLs at Your Domain

Set NEXT_PUBLIC_APP_URL to your server's public URL so auth callbacks and email links resolve correctly.

Seed the Admin

After deploying, visit https://yourdomain.com/en/admin/login and click Initialize to create the admin account. Change the default password afterwards.

Nginx must forward requests for /api/* to the Next.js server (port 3000) so the Better Auth HTTP routes work. See the Deploy step for the proxy config.

On this page