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, thennext 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 buildwrites into the browser bundle, such asNEXT_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.
Check the scripts in package.json
DASTER reads the scripts your app already has. A typical Next.js app needs these two:
{ "scripts": { "build": "next build", "start": "next start" } }next startlistens on port 3000 unless you pass-por setPORT.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.
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.
Review the build settings
Setting Typical value for Next.js Install command npm installBuild command npm run buildStart command npm startPort 3000Health check path /Choose a health check path that answers quickly, such as
/or a small route handler.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.
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
- Deploy from GitHub: connect GitHub and use the Deploy an app wizard.
- Deploy on push and previews: push rules, preview addresses and when previews are removed.
- Sizes and scaling: sizes, instances and the scaling API.
- Upload a .zip, autoscale and promote: deploy without GitHub and move a release to Production.
- Deploy a Next.js app from GitHub to the Mumbai region: the same steps on the blog.