Skip to main content

Installation

This guide covers everything you need to install and configure ShipFree for development and production.

Prerequisites

Before installing ShipFree, make sure you have the following installed on your system:

Required

Bun

Version: 1.2.20 or higherBun is a fast JavaScript runtime and package manager.
Verify installation:

PostgreSQL

Version: 14 or higherPostgreSQL is the database used by ShipFree.macOS:
Ubuntu/Debian:
Windows: Download from postgresql.org

Optional

  • Git: For cloning the repository
  • OpenSSL: For generating secure secrets
  • Docker: For containerized development (alternative to local PostgreSQL)

Step-by-step setup

1

Clone the repository

Start by cloning the ShipFree repository:
You can also download the ZIP file from GitHub if you prefer not to use Git.
2

Install dependencies

Install all required packages using Bun:
This will install all dependencies listed in package.json, including:
  • Next.js 16.1 framework
  • Better-Auth for authentication
  • Drizzle ORM for database operations
  • TailwindCSS 4 for styling
  • And many more packages
Bun automatically uses the exact version specified in package.json (bun@1.2.20).
3

Configure environment variables

Create your environment file from the example:

Core configuration

Edit .env and set these required variables:

Generate a secure auth secret

Use OpenSSL to generate a secure random secret:
Copy the output and paste it as your BETTER_AUTH_SECRET value.
Never commit your .env file to version control. The .env.example file is for reference only.
4

Set up PostgreSQL database

Create a new database for ShipFree:

Using psql

Using PostgreSQL CLI

Then in the PostgreSQL prompt:

Using Docker (alternative)

If you prefer using Docker for PostgreSQL:

Verify database connection

Test your database connection:
5

Run database migrations

Apply the database schema using Drizzle:
This command:
  1. Connects to your database using DATABASE_URL
  2. Runs all migrations from the migrations/ folder
  3. Creates all required tables (users, sessions, accounts, etc.)
The migration script is located at scripts/migrate.ts and uses Drizzle’s migration runner.

Available migration commands

6

Start development server

Launch the Next.js development server:
The application will start at http://localhost:3000You should see output similar to:
The dev server includes hot module replacement (HMR) for instant updates as you code.

Environment configuration details

Here’s a comprehensive overview of all environment variables:

Database

Application

Authentication

OAuth providers (optional)

Get credentials from Google Cloud Console
Get credentials from GitHub Developer Settings
Get credentials from Azure Portal
Get credentials from Facebook Developers

Email providers (optional)

Payment providers (optional)

Get credentials from Stripe Dashboard
Get credentials from Polar Settings
Get credentials from Lemon Squeezy Settings

Cloudflare R2 storage (optional)

Sentry monitoring (optional)

Troubleshooting

Problem: bun: command not foundSolution:
  1. Install Bun using the official installer:
  2. Restart your terminal
  3. Verify with bun --version
Problem: Wrong Bun versionSolution:
Problem: Connection refused or ECONNREFUSEDSolution:
  1. Check if PostgreSQL is running:
  2. Start PostgreSQL if it’s not running:
  3. Verify your DATABASE_URL credentials
Problem: database "shipfree" does not existSolution:
Problem: Migration fails with table already existsSolution: For a fresh start, drop and recreate the database:
Problem: Permission denied errorsSolution: Ensure your PostgreSQL user has proper permissions:
Problem: Port 3000 is already in useSolution: Use a different port:
Or kill the process using port 3000:
Problem: Environment variables not loadingSolution:
  1. Ensure .env file exists in the root directory
  2. Restart the development server after changing .env
  3. Check that variables are properly formatted (no spaces around =)
  4. For client-side variables, ensure they start with NEXT_PUBLIC_
Problem: BETTER_AUTH_SECRET validation errorSolution: Generate a new secret:
Problem: Type errors in the editorSolution:
  1. Restart your TypeScript server in VS Code (Cmd+Shift+P > “Restart TS Server”)
  2. Run type check:
  3. Ensure you have the latest dependencies:

Next steps

Now that ShipFree is installed, you can:

Configure authentication

Set up OAuth providers and customize the auth flow

Set up payments

Configure your payment provider and pricing plans

Customize branding

Update your app’s colors, logo, and brand identity

Deploy to production

Learn how to deploy your application
Join the ShipFree community for support, updates, and to share what you’re building!