Deployment

Vercel

How to deploy your TurboStarter app to Vercel.

In general you can deploy the application to any hosting provider that supports Node.js, but we recommend using Vercel for the best experience.

Vercel is the easiest way to deploy Next.js apps. It's the company behind Next.js and has first-class support for Next.js.

Prerequisite: Vercel account

To deploy to Vercel, you need to have an account. You can create one here.

TurboStarter has two, separate ways to deploy to Vercel, each ships with one-click deployment. Choose the one that best fits your needs.

Deploying with this method is the easiest and fastest way to get your app up and running on the cloud provider. Follow these steps:

Connect your git repository

After signing up you will be promted to import a git repository. Select the git provider of your project and connect your git account with Vercel.

Vercel import project

Configure project settings

As we're working in monorepo, some additional settings are required to make the build process work.

Make sure to set the following settings:

  • Build command: pnpm run -w build:web - to build only the web app
  • Root directory: apps/web - to make sure Vercel uses the web folder as the root directory (make sure to check Include files outside the root directory in the Build Step option, it will ensure that all packages from your monorepo are included in the build process)

Vercel project settings

Configure environment variables

Please make sure to set all the environment variables required for the project to work correctly.

Here is an example of correctly configured environment variables for production deployments (it may vary depending on the project configuration):

Vercel environment variables

Failure to set the environment variables will result in the project not working correctly.

If the build fails, deep dive into the logs to see what is the issue. Our Zod configuration will validate and report any missing environment variables. To find out which environment variables are missing, please check the logs.

First deployment may fail

The first time this may fail if you don't yet have a custom domain connected since you cannot place it in the environment variables yet. It's fine. Make the first deployment fail, then pick the domain and add it. Redeploy.

Deploy

Click on the Deploy button to start the deployment process.

Vercel deploy

That's it! Your app is now deployed to Vercel, congratulations! 🎉

Vercel

vercel.com

Last updated on

On this page

Ship your startup everywhere. In minutes.