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
A Next.js app with full server rendering reaches a live HTTPS URL on ComputeSphere with one command, csph deploy, after one config change: output: "standalone". This guide makes that change, containerizes the app and deploys it, then adds environment variables, a custom domain and autoscaling. You pay per spherelet, not per seat or per build.
brew install computesphere/cli/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 variables set NEXT_PUBLIC_API_URL=https://api.example.com --service <service-id> --environment <environment-id>
csph services secrets set DATABASE_URL="$DATABASE_URL" --service <service-id> --environment <environment-id>
csph services list shows the service id and csph environments list the environment id.
Set DATABASE_URL in your shell first, for example from a file or your password manager, so the secret itself never appears in the command or your shell history.
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 Plus), 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, with no per-seat fees, and every plan includes data out each month (10 GB to 1,000 GB, by plan), so you know what compute costs as traffic grows. Autoscaling is a Team plan feature; on Hobby and Pro you set the spherelet count yourself.
Your Next.js app now runs on ComputeSphere with full SSR, HTTPS, its config in variables and secrets, and your own domain.
Next step: get started and run csph deploy from your project, 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 monthly pricing. 14-day free trial.