Skip to content
⚠️ Open SaaS is now running on Wasp v0.13! If you're running an older version of Open SaaS, please follow the migration instructions here ⚠️

Getting Started

This guide will help you get your new SaaS app up and running.

Install Wasp

Pre-requisites

You must have Node.js (and NPM) installed on your machine and available in PATH to use Wasp. Your version of Node.js must be >= 18.

To switch easily between Node.js versions, we recommend using nvm.

Linux and macOS

Open your terminal and run:

Terminal window
curl -sSL https://get.wasp-lang.dev/installer.sh | sh

Windows

In order to use Wasp on Windows, you need to install WSL2 (Windows Subsystem for Linux) and a Linux distribution of your choice. We recommend using Ubuntu.

You can refer to this article for a step by step guide to using Wasp in the WSL environment. If you need further help, reach out to us on Discord.

Once in WSL2, run the following command in your WSL2 environment:

Terminal window
curl -sSL https://get.wasp-lang.dev/installer.sh | sh

Finalize Installation

Run the following command to verify that Wasp was installed correctly:

Terminal window
wasp version

Also be sure to install the Wasp VSCode extension to get the best DX, e.g. syntax highlighting, code scaffolding, autocomplete, etc.

Setting up your SaaS app

Cloning the OpenSaaS template

From the directory where you’d like to create your new project run:

Terminal window
wasp new

Then select option [3] saas from the list of templates after entering the name of your project.

This will clone a clean copy of the Open SaaS template into a new directory! 🎉

Start your DB

Before you start your app, you need to have a Postgres Database connected and running. With Wasp, that’s super easy!

First, make sure you have Docker installed and running. If not, download and install it here

With Docker running, open a new terminal window/tab and position yourself in the app directory:

Terminal window
cd app

Then run:

Terminal window
wasp start db

This will start and connect your app to a Postgres database for you. No need to do anything else! 🤯 Just make sure to leave this terminal window open in the background while developing. Once you terminate the process, your DB will no longer be available to your app.

Now let’s initalize the database. Open a new terminal tab/window and run the following command:

Terminal window
wasp db migrate-dev

You will also need to run wasp db migrate-dev whenever you make changes to your Prisma schema (entities).

If you want to see or manage your DB via Prisma’s DB Studio GUI, open yet another separate terminal tab/window and run:

Terminal window
wasp db studio

Start your app

In a new terminal window/tab, first make sure you’re in the app/ directory:

Terminal window
cd app

Copy the .env.server.example file to .env.server.

Terminal window
cp .env.server.example .env.server

You don’t have to fill in your API keys right away, but leave the placeholder strings for the time being as this will allow you to run the app.

Then run:

Terminal window
wasp start

This will install all dependencies and start the client and server for you :)

Go to localhost:3000 in your browser to view it (your NodeJS server will be running on port 3001)

Run Blog and Docs

This SaaS app comes with a docs and blog section built with the Starlight template on top of the Astro framework. You can use this as a starting point for your own blog and documentation, if necessary.

If you do not need this, you can simply delete the blog folder from the root of the project.

If you want to run the Starlight docs and blog, first navigate to the blog folder:

Terminal window
cd blog

Then run:

Terminal window
npm install

Then start the development server:

Terminal window
npm run dev

Getting Updates to the Open SaaS Template

We will be updating the Open SaaS template with new features and improvements. To get these updates, you can pull the changes from the original template into your own repository.

First, you need to add the original template as a remote upstream repository:

Terminal window
git remote add upstream https://github.com/wasp-lang/open-saas.git

Then, you can fetch the changes from the original template:

Terminal window
git fetch upstream

And finally, merge the changes into your local repository:

Terminal window
git merge upstream/main

What’s next?

Awesome! We have our new app ready and we know how to run both it and the blog/docs! Now, in the next section, we’ll give you a quick “guided tour” of the different parts of the app we created and understand how it works.