Digital Engines logoDigital Engines
←Back to Journal
Cloud & Deployment·September 22, 2026·9 min read

Hosting APIs, background workers and Postgres on Render

DE
Digital Engines
Design & Technology Studio
Developer workspace for deploying backend services
ESSAY · 9 min read

Serverless platforms are excellent for websites, but some workloads need a server that is always running: a REST API with persistent connections, a queue worker processing jobs, or a WebSocket server for real-time features. Render makes these simple to deploy, with Git-based deployments, managed Postgres and zero server maintenance.

1. When we choose Render

  • Backend APIs built with Node.js (Express, NestJS, Fastify), Python (FastAPI, Django), Go or Docker.
  • Background workers for emails, AI processing, imports and other queued jobs.
  • Cron jobs and scheduled tasks that run longer than a serverless function allows.
  • WebSocket and real-time servers.
  • Managed Postgres and Key Value (Redis-compatible) stores alongside your services.
“Vercel for the frontend, Render for the long-running backend. That split covers most of the products we build.”
— Strategic Takeaway

2. Prepare your app

Render tells your service which port to use through the PORT environment variable. Add a health check route so Render only sends traffic to healthy instances and can restart failing ones.

src/server.ts (Express example)ts
import express from "express";

const app = express();
app.use(express.json());

app.get("/health", (_req, res) => res.json({ status: "ok" }));

app.get("/api/projects", async (_req, res) => {
  // ...read from the database
  res.json([]);
});

const port = Number(process.env.PORT) || 3000;
app.listen(port, () => console.log(`API running on port ${port}`));
Hosting APIs, background workers and Postgres on Render visual illustration
FIG. 01 — Cloud & Deployment Study

3. Describe your stack with a Blueprint (render.yaml)

Instead of clicking through the dashboard for each service, we commit a render.yaml file to the repository. It creates the API, the worker and the database, and connects them automatically.

render.yamlyaml
services:
  - type: web
    name: client-api
    runtime: node
    plan: starter
    buildCommand: npm ci && npm run build
    startCommand: npm start
    healthCheckPath: /health
    envVars:
      - key: NODE_ENV
        value: production
      - key: DATABASE_URL
        fromDatabase:
          name: client-db
          property: connectionString
      - key: OPENAI_API_KEY
        sync: false        # you'll be asked to enter the secret in the dashboard

  - type: worker
    name: client-jobs
    runtime: node
    plan: starter
    buildCommand: npm ci && npm run build
    startCommand: node dist/worker.js
    envVars:
      - key: DATABASE_URL
        fromDatabase:
          name: client-db
          property: connectionString

databases:
  - name: client-db
    plan: basic-256mb
Deploybash
git add render.yaml
git commit -m "Add Render blueprint"
git push
# Then in Render: New → Blueprint → select the repository

4. Pricing

Render charges a workspace plan plus a monthly price for each service you run. Pricing (checked November 2026): the Hobby workspace is free, Pro is $25/month flat and Scale is $499/month flat, with Enterprise custom. Web services and workers start at $7/month for a Starter instance (512 MB RAM, 0.5 CPU), Standard is $25/month (2 GB, 1 CPU) and Pro is $85/month (4 GB, 2 CPU). Postgres starts at around $6/month.

Free web services spin down after about 15 minutes of inactivity and take a while to wake up, so they suit demos but not production. A small production backend (one Starter API, one Starter worker and a basic database) usually starts at roughly $20/month before bandwidth.

5. Production tips

  • Keep the API, worker and database in the same region for low latency and free private networking.
  • Use the internal service URL for service-to-service calls instead of the public internet.
  • Run database migrations in a pre-deploy command so the app never starts with an old schema.
  • Enable daily backups on paid Postgres plans and test a restore.
  • Add autoscaling (on supported plans) for APIs with variable traffic.
  • Send logs to your monitoring tool and set alerts for failed deploys and health checks.
Core Takeaways

Principles for deliberate execution

  • 1Render runs always-on services: APIs, WebSocket servers, background workers and cron jobs.
  • 2A render.yaml Blueprint describes your whole stack as code, so it can be recreated in one click.
  • 3Free web services sleep when idle, so use at least the Starter instance in production.
  • 4You pay a workspace plan plus a price per service, so add up every service when budgeting.
Tagged:#Render#Node.js#Backend#PostgreSQL#Infrastructure as Code
DE
Written by
Digital Engines

Digital Engines engineers SaaS platforms, high-performance websites, mobile apps and AI systems for ambitious teams worldwide. These guides come from the tools we use on real client projects every day.

Get in touch →
Continue reading

More from the journal

All essays →