All posts.
Every EasySpawn article, newest first — deploying AI-built apps, Claude Code, databases, security, and the infrastructure underneath.
822 posts · page 18 of 34
ERR_CONNECTION_REFUSED: What It Means and How to Fix It
Connection refused means your browser reached the computer, but nothing was listening on that port. The causes on localhost (dev server not running, wrong port, crashed) and on a live site (app or web server down, firewall, wrong address), and how to check each.
Why Is My Environment Variable Undefined? (Vite, Next.js, Node)
Your .env file has the value but the code sees undefined. The reasons are almost always the same: the wrong prefix (VITE_, NEXT_PUBLIC_), the wrong file name or folder, not restarting the dev server, build-time vs runtime, or the variable never being set in production.
ECONNREFUSED 127.0.0.1:5432: Why Your App Can't Reach the Database
"connect ECONNREFUSED 127.0.0.1:5432" means nothing was listening where your app tried to connect. The causes: database not running, wrong host inside Docker, wrong port, listening on the wrong address, or a firewall. How to find which, plus the related timeout and authentication errors.
"duplicate key value violates unique constraint": Causes and Fixes
Postgres refused an insert because a value that must be unique already exists. The two very different cases — a real duplicate (like an email that's taken) and an out-of-sync ID sequence after importing data — and how to fix each, including ON CONFLICT and resetting sequences.
Dockerfile Explained: Every Line of a Simple Dockerfile
A Dockerfile is the recipe Docker follows to build an image. A line-by-line walkthrough of a real Dockerfile — FROM, WORKDIR, COPY, RUN, ENV, EXPOSE, CMD — why the order matters for caching, .dockerignore, and the beginner mistakes that make images slow, huge or insecure.
Docker vs Docker Compose: What's the Difference?
Docker runs individual containers; Docker Compose describes and runs a group of containers that work together — your app, its database and a cache — from one YAML file. How they relate, the same setup with and without Compose, and the commands you'll use.
Docker "Port Is Already Allocated": How to Find and Free the Port
Docker can't publish a container's port because something on your machine already uses it — often another container, a local Postgres or a dev server. How to find what's using the port on Mac, Linux and Windows, stop it, or simply map the container to a different port.
Docker "Permission Denied While Trying to Connect to the Docker Daemon Socket": Fix
Your user isn't allowed to talk to Docker's socket at /var/run/docker.sock. The quick fix (add yourself to the docker group), why that's effectively root access, the safer rootless alternative, and the other causes: Docker not running, Docker Desktop, WSL and CI.
Docker Image vs Container: What's the Difference?
An image is a read-only template; a container is a running instance of it. The difference explained with analogies and commands, what happens to files when a container is removed, why data belongs in volumes, and how tags, registries and layers fit in.
Docker Image Layers and OverlayFS: How Container Filesystems Really Work
A Docker image is a stack of read-only layers merged by OverlayFS, with a thin writable layer per container. How layers are built and cached, content addressing and digests, copy-up and whiteouts, why deleting files doesn't shrink images, and the performance traps for databases.
Docker Container Keeps Restarting: How to Find Out Why
A container stuck in 'Restarting' is crashing on start and being brought back by its restart policy. How to read exit codes (1, 126, 127, 137, 139, 143), get logs from a crash loop, override the entrypoint to look inside, and fix the usual causes: config errors, OOM kills, missing dependencies and failing healthchecks.
Docker Compose Networking: How Containers Talk to Each Other
How services in a Compose project find each other by name, why localhost doesn't work between containers, ports vs expose, custom and external networks, reaching the host from a container, connecting two Compose projects, and the security gotcha of published ports.
Docker Commands Cheat Sheet: The 40 You'll Actually Use
A practical Docker cheat sheet: running and stopping containers, viewing logs, getting a shell inside, building and tagging images, volumes, networks, Docker Compose, and cleaning up disk space — with what each command does in plain English.
DNS Rebinding Attacks: How a Website Reaches Your localhost
DNS rebinding lets a malicious web page send requests to services on your machine or private network — dev servers, admin panels, local MCP servers, routers — despite the same-origin policy. How the attack works step by step, why SSRF filters fall to it too, and the defences: Host header checks, authentication, binding, and resolve-then-pin.
DNS_PROBE_FINISHED_NXDOMAIN: What It Means and How to Fix It
NXDOMAIN means DNS says the domain name doesn't exist. Fixes for visitors (typos, DNS cache, changing DNS servers) and for site owners (missing records, nameserver changes, expired domains, propagation), with the commands to check what DNS is really saying.
Distributed Locks: Redis, Postgres and Why Fencing Tokens Matter
A lock across multiple processes or servers is harder than it looks: processes pause, leases expire and two holders can both believe they own the lock. Redis SET NX PX done right, the Redlock debate, Postgres advisory locks, fencing tokens, and when you don't need a distributed lock at all.
How to Deploy a React App (Vite): Every Option Explained
A Vite React app builds into static files, so you can host it almost anywhere. How to build it, deploy to Cloudflare, Netlify, Vercel or GitHub Pages, serve it from your own server with Nginx or Caddy, fix 404s on refresh and blank pages, and handle environment variables and an API.
How to Deploy a Node.js App to a VPS, Step by Step
From an empty Ubuntu server to your Node.js app running on your own domain with HTTPS: create a user, install Node, clone and build, keep it running with PM2 or systemd, put Caddy or Nginx in front, and set up redeploys.
How to Deploy a Flask App to Production
Flask's built-in server is for development only. How to deploy a Flask app properly: the app factory and config from environment variables, Gunicorn, a reverse proxy with HTTPS, running it as a systemd service, a Docker option, and the mistakes that cause 502s.
How to Deploy a FastAPI App to Production
Running uvicorn main:app --reload is for development. A production FastAPI deploy needs worker processes, a process manager or container, a reverse proxy with HTTPS, proper settings, migrations, and health checks. Step-by-step options for a VPS and Docker.
How to Deploy an Express.js App to Production
Getting an Express API from localhost to a real server: production settings, listening on PORT, trust proxy, security middleware, a process manager, a reverse proxy with HTTPS, Docker as an option, and the checks that prevent the usual 502s and crashes.
How to Deploy a Django App to Production (Step by Step)
Taking a Django project from runserver to production: settings for DEBUG, ALLOWED_HOSTS and secrets, Postgres, collectstatic and WhiteNoise, Gunicorn behind Nginx or Caddy, systemd, migrations on deploy, HTTPS, and the checklist Django itself gives you.
Dependabot Explained: Automatic Security and Version Updates on GitHub
Dependabot watches your project's dependencies, alerts you to known vulnerabilities and opens pull requests to update them. The three features (alerts, security updates, version updates), a dependabot.yml example with grouping and cooldowns, and how to handle the PRs without drowning.
How to Delete a Git Branch (Local and Remote)
The commands to delete a Git branch on your computer and on GitHub: git branch -d vs -D, git push origin --delete, cleaning up stale remote-tracking branches with fetch --prune, deleting merged branches in bulk, and recovering a branch you deleted by mistake.