Deploy guide

Deploy a Next.js app on Gheima

Connect the app's GitHub or GitLab repository and create a web service. Gheima builds it with Nixpacks, which runs your `build` script and starts the app with `npm start`, listening on the `PORT` Gheima sets. Every push to the branch redeploys it, served over HTTPS on a gheima.ma address from Oracle Cloud's Casablanca region.

Deploy it

  1. 1

    Create a web service from the repository

    Pick the repository and branch. Leave the build and start commands blank for Nixpacks to detect them, or set them yourself, for example npm run build and npm start.

  2. 2

    Add environment variables

    Server-side values are injected when the container starts. NEXT_PUBLIC_ values are inlined into the browser bundle at build time, so mark them with the build toggle in the Environment tab.

  3. 3

    Connect a database

    Create a managed Postgres database and link it to the service: DATABASE_URL and the PG* variables are set for you. Run migrations as the service's release command, for example npx prisma migrate deploy, so a failed migration stops the rollout.

  4. 4

    Add your domain

    Add the domain on the service, point its DNS at Gheima, and the HTTPS certificate is issued and renewed for you.

Read next

Questions

Can I deploy a static export instead?

Yes. A Next.js app built with `output: 'export'` can run as a static site, served from an nginx edge with no server process. Pick the Next.js (static export) preset in the site's settings.

Which port should my app listen on?

The one in the `PORT` environment variable. Gheima sets it to the service's port, 3000 by default, and `next start` reads it.

How much does it cost?

A Next.js app runs on the Free plan, where a web service sleeps after 30 minutes without traffic. Paid plans start at 90 MAD a month and keep it awake. The pricing page lists every limit.

Your next deploy is a git push away

New accounts are by invitation for now. Ask for an invite and we'll email you when we can let you in.