Next.js hosting on DASTER

Host a Next.js app on DASTER from GitHub: what runs, the build settings, variables, sizes, previews and your own domain, with today's limits.

Last updated

DASTER hosts a Next.js app as a Node web service. You connect a GitHub repository, DASTER detects the install, build and start commands, and the app runs next start in Mumbai at https://<app id>.apps.daster.io. Pushes to its branch deploy again, other branches can get previews, and you can add your own domain with HTTPS.

What does a Next.js app get on DASTER?

  • A web service built from a GitHub repository, a .zip of up to 100 MB or a public Docker image. Each app runs in its own gVisor sandbox.
  • Node and npm servers: next build, then next start. Static build output served by Node runs too.
  • Deploy on every push to the branch the service was created with, and preview deployments for pushes to other branches.
  • Sizes: Starter (0.5 vCPU · 256 MB) or Standard (1 vCPU · 1 GB), with 1 or 2 instances, or Autoscale between a minimum (0 is allowed) and a maximum of 2.
  • Variables: up to 64 per service, each value up to 8,192 characters, encrypted at rest.
  • Promote to Production: the exact image of your live Development deployment runs in Production, without a new build. Roll back Production returns it to its previous release.
  • Logs and metrics: build logs (the newest 2,000 lines per deployment, for 30 days), runtime logs (the newest 10,000 lines per app, for 7 days) and 7 days of metrics.

What are the limits today?

  • Apps run in Mumbai (ap-south-1) only.
  • Variables are not passed to build commands. Values that next build writes into the browser bundle, such as NEXT_PUBLIC_* variables, are empty while it builds.
  • The Plus and Pro sizes are not offered yet.
  • Apps reach the internet over HTTP and HTTPS. Private addresses and port 25 are blocked.
  • Before a deploy starts, DASTER checks that your organization's wallet can pay the next hour of everything you run on Hosting. Prices are not final.
  1. Check the scripts in package.json

    DASTER reads the scripts your app already has. A typical Next.js app needs these two:

    JSON
    {
      "scripts": {
        "build": "next build",
        "start": "next start"
      }
    }

    next start listens on port 3000 unless you pass -p or set PORT.

  2. Connect GitHub

    Open Hosting › Build & deploy settings and choose Connect GitHub. DASTER's GitHub App reads your repositories' contents and metadata, nothing else, and receives push and branch-delete events.

  3. Pick the repository

    In Hosting, choose Deploy an app. Pick Web service and a size, then pick the repository and its branch under Source. If the app lives in a subfolder, set the root directory. DASTER inspects the selected commit and fills in what it detected; it runs no command at this point.

  4. Review the build settings

    SettingTypical value for Next.js
    Install commandnpm install
    Build commandnpm run build
    Start commandnpm start
    Port3000
    Health check path/

    Choose a health check path that answers quickly, such as / or a small route handler.

  5. Add variables and deploy

    Add the app's server-side variables for Development. Choose Review, then Deploy to Development, and follow the build to LIVE. The live card shows the address, https://<app id>.apps.daster.io.

    Warning: Log lines are redacted, but only values of 8 characters or more are searched for. Keep secrets at least 8 characters long.

  6. Connect your own domain

    Open Domains › Your domains, choose Add domain, enter the hostname and pick the web service. Add the TXT record and the routing record DASTER shows, then choose Check now. DASTER gets a Let's Encrypt certificate and renews it by itself. The Domains and DNS guide has the details.

Questions about Next.js on DASTER

Does server-side rendering work?

Yes. The app runs as a Node server with next start, so pages rendered on the server and route handlers run in that Node process.

Why is my NEXT_PUBLIC_ variable empty?

Variables are not passed to build commands, and next build writes NEXT_PUBLIC_* values into the browser bundle while it builds. Read such settings on the server at runtime instead, for example in a route handler, and pass them to the page.

Can a preview deployment use my production database?

No. A preview starts with no variables. Production variables, shared variables and the project connection are never copied to previews, so code from an unreviewed branch never receives your secrets.

Can the app stop when nobody visits?

Yes. Turn on Autoscale on the web service's Scaling tab and set the minimum to 0. The next visit then waits a few seconds while an instance starts. You pay only for hours in which an instance ran.

Can I deploy without GitHub?

Yes. In Deploy an app, upload a .zip of the app folder (up to 100 MB), or enter a public Docker image from a supported registry, such as Docker Hub or ghcr.io.

In the docs

Next steps