Installation
Ready to install Saasfly? Follow this guide to using the create saasfly CLI to get started.
Version Notes
We are using Clerk as the default authentication provider after 1st June 2025.
You can find the NextAuth implementation here .
System Requirements
- Node.js - 18.17 or later.
- Bun - 1.0 or later.
- OS - macOS, Windows (including WSL), and Linux are supported.
By the way, we recommend using NVM (Node Version Manager) to run different versions of Node.js.
1. Run the Setup Wizard
Run the following command in your terminal to start our handy install wizard:
bun create saasflyOn installation, you’ll see the following prompts:
- Clone the saasfly repository into the specified folder.
- Remove git history
- Install dependencies
- Generate prisma type
After the prompts, create saasfly will create a folder with your project name and install the required dependencies.
2. Start Saasfly
You should do below lists to run the server.
Set Up The Environment Variables
Enter the saasfly folder, duplicate the .env.example file, rename it to .env.local , and enter your variables.
cd saasflycp .env.example .env.localMake sure you have a Postgres DB (If you don’t have a Postgres, click here) and have created a new database.
POSTGRES_URL must in your .env.local file:
# Format Example# POSTGRES_URL="postgres://{USER}:{PASSWORD}@{DB_HOST}:{DB_PORT}/{DATABASE}"
POSTGRES_URL="postgres://postgres:[email protected]:5432/saasfly"Then, use bun to create database tables:
bun db:pushOutput:
🚀 Your database is now in sync with your Prisma schema. Done in 151ms
┌─────────────────────────────────────────────────────────┐│ Update available 5.9.1 -> 5.10.2 ││ Run the following to update ││ npm i --save-dev prisma@latest ││ npm i @prisma/client@latest │└─────────────────────────────────────────────────────────┘If something went wrong, you can talk to us on Discord , we are glad to answer anything about Saasfly.
Run Build First
Because some basic components are compile-time needed, you should run build first.
bun run buildRun The Development Server
Use bun run to start your web server:
bun run dev:web@saasfly/nextjs:dev: cache bypass, force executing ad8bea47f156e113@saasfly/nextjs:dev: $ bun with-env next dev@saasfly/nextjs:dev: $ dotenv -e ../../.env.local -- next dev@saasfly/nextjs:dev: ▲ Next.js 14.1.0@saasfly/nextjs:dev: - Local: http://localhost:3000@saasfly/nextjs:dev:@saasfly/nextjs:dev: automatically enabled Fast Refresh for 1 custom loader@saasfly/nextjs:dev: ✓ Ready in 12.1sIf all goes well, Saasfly should now be serving your project on http://localhost:3000, and you can see the result:
Congratulations! Now you can start coding to build your SaaS.
If you’re new to Saasfly, see the project structure docs for an overview of all the possible files and folders in your application.
Run With Stripe
Please read the article Stripe. And then use bun dev to run with Stripe:
bun dev