Deployment

How to Deploy a Node.js App on ComputeSphere

P
By Peter Ekhator

Deploying a Node.js app to production usually means writing a Dockerfile, renting a server or learning Kubernetes, wiring up CI, and then watching the bill climb as traffic grows. ComputeSphere collapses that into one command — and the price is fixed per spherelet, so you know the cost before you ship.

This guide takes a standard Express app from your machine to a live HTTPS URL, then layers on environment variables, a custom domain, and autoscaling.

Prefer to start from a working app? Clone the ComputeSphere Node.js example and follow along.

Before you start

  • A Node.js app that listens on a port — Express, Fastify, NestJS, or plain http
  • Docker installed locally (ComputeSphere runs your app as a container image)
  • A free ComputeSphere account — the trial runs 14 days, no card required

Install the csph CLI

Pick one:

brew install computesphere/tap/csph
# or
curl -fsSL https://install.computesphere.com | sh
# or
npm install -g @computesphere/csph

Then sign in. The CLI prints a code and a URL — confirm it in your browser:

csph auth login

Make your app read the port

ComputeSphere assigns a port and routes public traffic to it. Read it from the environment instead of hardcoding one:

const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`listening on ${port}`));

That is the only code change most Node apps need.

Containerize your app

A small production Dockerfile is enough:

FROM node:22-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "server.js"]

Deploy

From your project directory:

csph deploy

ComputeSphere builds the image, runs it on a spherelet, terminates TLS, and routes a public URL:

https://amber-finch.computesphere.app

Already publish your own image? Skip the build and deploy it directly:

csph deploy --image registry.example.com/my-api:1.0.0

Connect your GitHub repo once and every push redeploys — build, deploy, and a zero-downtime cutover.

Set environment variables

Keep config and secrets out of your image. Set them per environment:

csph services set-env NODE_ENV=production
csph services set-secret DATABASE_URL=postgres://user:pass@host:5432/db

General variables and secrets are injected at runtime. Point DATABASE_URL at whatever database you already run.

Add a custom domain

Open Console → Domains, add your hostname, then create the DNS record it shows. For a subdomain that is a single CNAME to your service URL:

Type    Name    Value
CNAME   app     amber-finch.computesphere.app

ComputeSphere issues and renews the SSL certificate automatically — no certificate file to upload, no renewal to track.

Scale with spherelets

A spherelet is your unit of compute, and you pay a fixed price per spherelet — no per-seat fees, no surprise bandwidth charges. Pick a size (Flex, Standard, or Performance), run as many spherelets as you need, and turn on autoscaling: set a minimum and maximum spherelet count and a target CPU, and ComputeSphere scales between them. Because each spherelet has a known price, scaling up never produces a surprise invoice.

Wrap-up

A standard Node.js app reaches production on ComputeSphere in one command: read PORT, containerize, run csph deploy — then add env vars, a custom domain, and autoscaling when you need them. No Kubernetes, no YAML, no DevOps hire.

Ready to ship? Start your free trial or book a 15-minute demo.

Predictable cloud, from your first push.

Fixed price per spherelet, flat plan per team — ship without DevOps or surprise bills.

Start free trial

14-day free trial

Share this article

Ship your next service on ComputeSphere

Predictable per-spherelet pricing, a flat plan per team, and managed primitives built in — no DevOps, no surprise bills.

Deploy your first spherelet in minutes.

Connect a repo or start from a template — live URL, SSL, and zero DevOps, on predictable per-spherelet pricing. 14-day free trial.