Connect a repo or start from a template — we build, deploy, and route it with SSL.
Docs, an API, and a CLI — wired to the same platform your services run on.
How to Deploy a Next.js App on ComputeSphere
Next.js gives you server rendering, the App Router, and API routes in one framework. Putting it in production, though, usually means a platform that bills per seat and per build — or hand-rolled infrastructure you have to keep patched. ComputeSphere runs your Next.js app as a container on a fixed per-spherelet price, so you get full SSR without the per-seat tax or the ops work.
This guide takes a Next.js app to a live HTTPS URL, then adds environment variables, a custom domain, and autoscaling.
brew install computesphere/tap/csph
# or
npm install -g @computesphere/csph
Then sign in:
csph auth login
Set output: "standalone" in next.config.js. Next then emits a minimal, self-contained server you can run anywhere:
const nextConfig = { output: "standalone" };
module.exports = nextConfig;
A multi-stage Dockerfile keeps the final image small:
FROM node:22-slim AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:22-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
EXPOSE 3000
CMD ["node", "server.js"]
From your project directory:
csph deploy
ComputeSphere builds the image, runs it on a spherelet, terminates TLS, and returns a public URL:
https://teal-otter.computesphere.app
Already have an image in a registry? Deploy it directly with csph deploy --image <ref>. Connect your GitHub repo once and every push ships a new version with a zero-downtime cutover.
Next.js has two kinds of config. NEXT_PUBLIC_* values are baked in at build time; server-only secrets are read at runtime:
csph services set-env NEXT_PUBLIC_API_URL=https://api.example.com
csph services set-secret DATABASE_URL=postgres://user:pass@host:5432/db
Set build-time public variables before you build; set runtime secrets on the service.
Open Console → Domains, add your hostname, and create the CNAME it shows pointing to your service URL:
Type Name Value
CNAME www teal-otter.computesphere.app
ComputeSphere issues and auto-renews the SSL certificate — no Cloudflare config, no cert files.
SSR scales well horizontally, and a spherelet is your unit of compute. Pick a size (Flex, Standard, or Performance), run as many spherelets as your traffic needs, and turn on autoscaling with a minimum, a maximum, and a target CPU. You pay a fixed price per spherelet — no per-seat fees, so a traffic spike doesn't turn into a surprise invoice.
A Next.js app with full SSR reaches production on ComputeSphere in one command: set output: "standalone", containerize, and run csph deploy. You get HTTPS, custom domains, and autoscaling on pricing you can predict.
Ready to ship? Start your free trial or book a 15-minute demo.
Fixed price per spherelet, flat plan per team — ship without DevOps or surprise bills.
Start free trial14-day free trial
Predictable per-spherelet pricing, a flat plan per team, and managed primitives built in — no DevOps, no surprise bills.
Browse Some Related Blogs
Connect a repo or start from a template — live URL, SSL, and zero DevOps, on predictable per-spherelet pricing. 14-day free trial.