Start here: complete step-by-step guides

Next.js app: from create-next-app to live, step by step

Create a Next.js app, push it to GitHub, deploy it with the Next.js preset, add environment variables and go live.

  1. Create the app
  2. Push it to GitHub
  3. Launch a Node.js app
  4. Choose the Next.js preset
  5. Environment variables before the build
  6. Connect GitHub and deploy
  7. Go live on your domain
  8. Images, API routes and middleware

1. Create the app

Accept the suggested answers if you are unsure. Then open http://localhost:3000.

npx create-next-app@latest my-site
cd my-site
npm run dev

2. Push it to GitHub

create-next-app has already run git init and made a .gitignore. Create an empty private repository on GitHub and push:

git add .
git commit -m "First version"
git branch -M main
git remote add origin https://github.com/you/my-site.git
git push -u origin main

3. Launch a Node.js app

Launch an app → Node.js → a current version (20 or newer) → plan → domain → pay. Next.js builds use a fair amount of memory: if a build stops with an out-of-memory error, move to a larger plan from the dashboard (you pay only the difference).

4. Choose the Next.js preset

App settings → Framework Next.js. It fills in install npm ci || npm install, build npm run build and start npx next start -p $PORT -H 127.0.0.1. Save.

5. Environment variables before the build

Add your variables with + Add variable → Save all. Variables starting with NEXT_PUBLIC_ are baked in at build time, so add them before deploying, and deploy again after changing them.

6. Connect GitHub and deploy

Git deployments → GitHub → repository address → branch main → Test connection → Connect repository → Deploy now. Add the webhook in GitHub so pushes deploy by themselves. The log shows the install, next build and the switch to the new release.

Go live on your domain

Point the domain's @ and www A records to the IP shown in Domains, wait for Points here, then Issue free SSL → Always use HTTPS → Save changes.

Images, API routes and middleware

next start runs the full Next.js server, so API routes, server components, middleware and next/image optimisation all work. Files users upload should go to object storage or a database, not into the project folder — each deploy is a fresh release.

Stuck? Our engineers answer support tickets around the clock. Contact us, or create an account and open a ticket from the dashboard — the same guides are there too.

Next step

Move your site, or your whole cloud estate

Shared hosting you can buy in two minutes. Infrastructure and managed services quoted by an engineer within one business day.