r/webdev • • 3d ago

Discussion What does your local development setup look like?

I'm curious about how you guys have your development environments set up, both at work and for personal projects.

What does your local setup look like?

Do you debug inside containers? Do you run exactly the same setup as production, e.g. a local kind cluster? Do you connect to a remote server that hosts the codebase?

Similarly, how do you test DevOps-related changes? Do you use any specific tools? Do you run single-node clusters or multiple vms etc?

Do you mainly test deployed on a server or locally first?

18 Upvotes

43 comments sorted by

9

u/devolute 3d ago
  • Home: I use Valet on Mac with Nginx, PHP & MySQL provided via Brew services. Connect to a VPS via SSH to make things happen on live. Mainly.
  • Work: I work in higher education at the moment so we don't have such a thing as an environment. It's mainly just copy and pasting things from desktop into a CMS field and testing things in a hidden part of the website somewhere. Been a bit of a culture shock tbh.

8

u/OkFarmer3779 3d ago

windows with wsl2 for the backend stuff and vs code, docker compose for the db so i can nuke it whenever. keeping it identical to prod is nice in theory but my laptop would melt running a kind cluster lol

1

u/Desperate-Virus9180 3d ago

thanks for the reply, same here, nuking it whenever for us is a bit risky but yes that's probably the most usual set up.

I don't rly get why we have to have windows, I get security and security/co policy management.

So most of testing takes place locally, and you can probably even set up your services to listen to dev's dbs if needed for constistency, pretty traditional otherwise.

1

u/OkFarmer3779 3d ago

yeah wsl2 is basically my workaround for needing linux tooling on a windows machine. shared dev dbs for consistency makes sense, i just nuke mine because it's only me using it lol

1

u/henrychauhan_4 18h ago

If nuking the working DB is the risky part, keep a separate disposable test DB with migrations and seeded fixtures. You get repeatable checks without losing useful local data.

7

u/V_Trautwein 3d ago

I usually develop locally with Docker, run tests in containers.

4

u/krileon 2d ago

DDEV with Mutagen enabled and working on local files letting it sync to the VM. I was using Laragon, which I replaced with EnvKit, which I recently replaced with DDEV. Wouldn't go back at this point. Native was easier to setup and was faster, but Mutagen eliminated all my performance and usability concerns (mounting is slow and I don't want to edit directly in the VM...). Testing is done in the VM.

3

u/PeterPook 2d ago

Laragon to handle Apache on localhost:80, mysql:3306, Node, VSCode, Navicat Lite, Postman, Claude Code Desktop, chatGPT Go for image assets, Affinity for graphics tweaks. I work mainly on a Vite+React+Axios+PHP+MySQL stack.

2

u/London-Boat 2d ago

once you run more than one agent or branch at a time, the thing that bites is shared state. two worktrees both want port 3000 and the same local db, and one agent's migration or db nuke breaks the other. what helps is a per-checkout .env with its own port and its own db name (a compose project name per worktree does most of it), so each copy is disposable on its own. and a cheap staging box you're allowed to break is a good call for the devops side.

2

u/583999393 2d ago

Digital ocean droplet with a dev domain pointed at it and Claude code installed and connected to services through a centralized brain app the holds details on each project. Claude spins up a new subdomain using the framework of choice, uses porkbun to make the subdomain and connect it up then creates the git repo.

It uses GitHub actions to deploy to the production site.

My fancy laptop to run docker is now pretty much redundant.

2

u/elendee 2d ago edited 2d ago

I'm a solo dev control freak, so I just maintain linux computers that are close enough to my web servers architecture that any compatibility issue is more of a learning experience than a problem. No docker or containers. Linux, node, mysql and the web, what else could I need. If I get locked into some old package, that becomes a high priority for a refactor for me. I recently started an Opencode quarantine computer where I have sessions on cloned repos free from any env variables or gitignored stuff on the system. A bit freaked out the first time I realized Opencode was freely writing schemas into my password-protected local mysql. SSH is config'd for instant access to any server, I kind of prefer no tmux at the moment tbh, it actually seems like less mental overhead. But that opinion may change with more frequent usage.

All this workflow is the result of largely working alone; it is a two edged sword, but I do like that edge a lot.

1

u/SwiinkaPeppa 3d ago

mac + docker compose just for postgres and redis, everything else runs native cause docker on mac eats all my ram lol. tbh i dont test devops stuff locally at all, i have a cheap staging vps and i break that instead

1

u/Naveen_prasath 3d ago

Use Minikube, as it is lightweight and can be used to provision a small, server-like environment for testing. You can mock the required services and use Docker Compose to run the database, cache, and queue services.

1

u/Mammoth-Creme-7019 3d ago

I keep databases and queues in Docker locally so my machine doesn't get messy

1

u/miria01 3d ago

Does your CI validate config or infrastructure before deployment?

1

u/bornmix_dev 3d ago

docker compose for the stateful stuff (postgres, redis, queues), the app itself runs natively on the host because hot reload and the debugger are just faster that way. I don't try to copy prod locally, no k8s on the laptop, that's what staging is for. devops changes go to staging first, with terraform plan in CI before anything applies. side projects are the same idea, smaller, often just a local postgres and a .env. the thing that helped most was one command that brings everything up, so a new person is running in 10 minutes

1

u/hasibulmawla 2d ago

I've settled on keeping things boring and close to production after years of overcomplicating my setup. I run the app itself natively so debugging stays fast, while databases and queues live in containers I can tear down and rebuild without touching my machine. For anything infrastructure-related, I test it in a small staging environment first, because I've been bitten too many times by something that worked locally but behaved differently once deployed. That split has saved me a lot of time, and it keeps my laptop clean when I switch between projects.

1

u/Constant-Dig-Dog 2d ago

For Kubernetes stuff I only spin up kind when I'm actually changing manifests or Helm charts. Running a full local cluster for everyday coding was way too slow, so now it's a tool for specific jobs, not my default.

1

u/SibLiant 2d ago

3 mon setup with xubuntu for my daily dev driver. typical tech stack is backend: node, prisma, fastify frontend: react, mantine / tailwind shadcn/ui, tanstack.

I code review in neovim in the terminal. claude code cli plugs into my neovim session so I can review what claude is doing. While claude is doing what I instructed, I have the dev site up on another monitor where I can see it being built in real time. Hot reloads auto refresh everychange so I can just watch it build / debug ( this is completely mindblowing compaired to what I was doing just 5 years ago). I correct claude as needed based on my personal end to end testing. when I run into issues, I point that out to claude and where it does its own end-to-end tests and fixes as needed. As code is generated I get auto diffes in my editor to review.

when we're ready for production I build a local docker images and move them to my container repo. then production syncs those images.

Like most other have said, my dev containers are things like postgres / redis and tools.

1

u/ripndipp full-stack 2d ago

Tmux split with panes for the difference services/ microservices

1

u/activematrix99 2d ago

Docker and/or kubernetes for everything.

1

u/Mike_L_Taylor 2d ago

I'm on windows so mostly ForgeKit and some docker with WSL2.
on MacOS I was using Herd if I remember correctly
on Linux I hear Lerd is amazing.

1

u/ryaaan89 2d ago

For work they bought me a mini pc which lives across the house and I use VS Code remote to edit. Everything already runs in Docker there with its own Nginx router, I have network wide custom DNS in Opnsense rather than the hostfile edits most of my coworkers have on their laptops.

For personal projects its all my laptop but the environment is a real mixed bag, sometimes contsinerized sometimes not.

1

u/No-Ear843 2d ago edited 2d ago

On personal projects I develop on bare metal Linux. I do all dev and debugging locally. Dev and prod are the same setup. I've never had a problem keeping things synched effectively perfectly.

This is also how most of my jobs have been. Since the db's are often big and complicated, those are usually remote. I do sometimes hear about difficulties and glitches in cloud hosting during stand-up, but for the most part they have people who handle that. The solutions are usually just arbitrary, mundane config stuff.

The one job I had where we developed in containers added perpetual friction for the entire team. It was slow and harder to debug. Because it's harder to debug in a container, we had weird bugs that nobody could figure out, the entire time I worked there, which is nuts.

1

u/elendee 2d ago

glad to hear this perspective; as a solo dev, containers, just like React, is one of those things I would try once a year, hate it, and give it up til next year where I would give oneeee more try.

1

u/MapNo2659 2d ago

For my local setup, I usually run Docker containers to mirror the production environment as closely as possible. It helps catch issues early on that might only show up in production otherwise. For debugging, I find using VS Code's remote containers extension super handy. As for testing DevOps changes, I tend to use a single-node Kubernetes cluster locally before scaling up. How about you? Do you find any specific tools indispensable for your workflow?

1

u/Psychological_Read_1 2d ago

We are using Blaze for our apple silicon macs. Our agency mostly maintain over 500 WordPress sites and it has been a game changer for us

1

u/gareththegeek full-stack 2d ago

Work: VSCode with Claude extension

Home: VSCode with AI turned off

1

u/Open-Adhesiveness-86 2d ago

db and redis in compose, app runs native. two things that bit me debugging inside containers: the debugger has to bind 0.0.0.0, not 127.0.0.1, or the published port gives you nothing, and delve/gdb need --cap-add=SYS_PTRACE plus security-opt seccomp=unconfined. for devops changes kind is fine for manifest/rbac mistakes but it'll never catch IAM, ingress controller or storage class differences, so a throwaway namespace on the real cluster is worth more than a local one.

1

u/SoundSpecific9751 2d ago

for most projects, i'd keep things simple with VS Code, Docker Compose, and a local database.

1

u/KarachoGames 2d ago

Pretty boring here. Linux Mint laptop, the whole frontend is one big HTML file with plain JS, no build step. Backend is Postgres (self hosted Supabase on a small Hetzner server) plus a second test copy where every migration runs first.

For testing i run Playwright headless with a phone viewport and fake GPS, that catches most stuff before i touch the real phone.

Only thing i would recommend to everyone: keep a second database you are allowed to break. Saved me more then once.

1

u/Ok-Snow-6553 1d ago

I've been trying to do exactly this lately. I run everything locally using Docker inside WSL, trying to mirror the production environment as closely as possible.

The goal is to have a seamless one-click deploy to the cloud without any "it works on my machine" surprises. It takes a bit more setup time initially, but it saves so much pain later.

1

u/[deleted] 3d ago

[removed] — view removed comment

1

u/webdev-ModTeam 3d ago

Your post/comment has been determined to be a low-effort post or comment. This includes title-only posts, easily searchable questions, vague/open-ended discussion prompts, LLM generated posts or comments, and posts/comments that do not provide enough context for meaningful replies or discussion.

1

u/[deleted] 3d ago

[removed] — view removed comment

1

u/webdev-ModTeam 3d ago

Your post/comment has been determined to be a low-effort post or comment. This includes title-only posts, easily searchable questions, vague/open-ended discussion prompts, LLM generated posts or comments, and posts/comments that do not provide enough context for meaningful replies or discussion.