Deploy a Node.js App on Render — Free, Fast, and Simple (2026)

Deploy a Node.js App on Render — Fast & Free

Contents

Prep your Node app

Make sure your app listens on process.env.PORT and has a start script in package.json.

// example: src/index.js
const express = require('express');
const app = express();
app.get('/', (req,res) => res.send('Hello from Render!'));
const PORT = process.env.PORT || 3000;
app.listen(PORT, ()=> console.log('Listening on', PORT));

Method A — Connect Git repo to Render

  1. Push your repo to GitHub.
  2. Create a new Web Service on Render → connect your GitHub repo.
  3. Choose branch, set Build Command (e.g. npm ci && npm run build) and Start Command (e.g. npm start).
  4. Render auto-builds and gives you a URL (https://your-app.onrender.com).
Tip: Add a render.yaml if you want reproducible infra-as-code.

Method B — Docker (if your app needs it)

# Dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
EXPOSE 3000
CMD ["node","src/index.js"]

Push image to Docker Hub / registry, then create a Web Service in Render using the image URL.

Testing & environment variables

  • Use Render dashboard → Environment → Add secret keys (DB_URL, API_KEY).
  • Open the public URL and confirm startup logs in Render dashboard.
  • Use curl or Postman to test endpoints.

Comments

Popular posts from this blog

Graph Data Structure – Complete Beginner to Advanced Guide with BFS, DFS and Examples

Top Coding Mistakes Beginners Make (And How to Fix Them the Right Way)

Top 10 Free Coding Websites Every Beginner Should Use in 2026