How to deploy private GitHub NextJS app
This guide explains how to deploy your own apps from GitHub, from creating an app in DollarDeploy to deploying automatically on the push to GitHub.
We will be using T3 App template to create a deploy a modern, high-performance NextJS app https://create.t3.gg/
How to deploy T3 app with DollarDeploy (6 min)
Creating a new host
First, we need to create a host in DollarDeploy and configure it with PostgreSQL. Create or provision a host and make sure you add PostgreSQL service to it.
(Add new host then enter the IP address, username and SSH key or use integration with Hetzner, DigitalOcean or DataCrunch to automatically create new VPS)
Do not forget to create DNS records, see this guide for more information:


Access to the Github Private repositories
Currently, to access repos you need to configure your github username and PAT (personal access token) in DollarDeploy settings.

To get this token you go to Github => Settings => Developer settings => Personal Access Token and create token with repo access level. This token is stored encrypted in DollarDeploy and only used when you build the app for deployment.

Adding new app in DollarDeploy
After you create new app, set type to next and enter Github repo url (http only) and select your host and hostname.


Since we are using PostgreSQL and prisma, we need to add pre-start command, to create or update the DB each time we deploy.
npx prisma db push --skip-generate

We will add variable for postgres installed on the server. I also want to enable auth using discord, adding configuration values for that. Do not forget to adfd AUTH_TRUST_HOST=true to the config so T3 app will work behind the reverse proxy.

My private project is based on T3 app I forked from this publically available github repository https://github.com/huksley/t3-dollardeploy
TLDR: Essential configuration needed for your app:
- App name (it will also serve as a folder on the host with the app) for example, t3
- Github URL: your forked from https://github.com/huksley/t3-dollardeploy repository url or created from scratch with T3 app (use http URLs only)
- Github branch name: (default main)
- Pre-start command: Used to run Prisma ORM migrations or whatever you use for database access
- Environment variables (AUTH_URL, AUTH_TRUST_HOST, DATABASE_URL etc)
Deploying
Once the app is added, you can deploy by pressing Deploy in the app. It takes less than a minute from getting the source code, building the package and starting new version on the host.

Testing the app
Since T3 app does not really have an UI for login, we can use well-known URLs to test. Use url like https://tempvps.dev.wizecore.com/api/auth/signin to login with Discord.

After login, if everything right, we can test we successfully logged in by going to https://tempvps.dev.wizecore.com/api/auth/session

Deploying automatically on push
We now have our own app deployed, but we also want to make it deploy automatically when we push code changes to the GitHub, instead of going to DollarDeploy everytime.
Go to the app on DollarDeploy and press Connect to Github. Select the specific Github repo you have configured in the app (do not click use all repositories).
After that, on every push you will get the app deployed automatically.