docs/
Outline
---
title: Deploy like a tech lead: the setup behind a boring deploy
slug: deploy-setup
lang: en
published: 2026-11-15
words: 648
lines: 56
size: 3.4 KB
read: 4 min read
reel: Deploy like a tech lead
---
It is 11 pm. You deployed a small feature, the site does not come up and your phone keeps ringing. Every minute users leave, and you are still on the server trying to find what broke.
This is how we deploy our main product so that night does not happen, in the order a release goes through it. It is the first episode of the Production Ready series.
1. The build never runs on the server
The server only runs code; it never builds it. Every build happens in the CI/CD pipeline (GitLab CI or something like it), and only the finished version goes to the server.
- A build that fails, fails in CI, where nobody is waiting on it. The site keeps running the last version.
- The server does not need compilers, build tools or extra memory for a build.
- What runs in production is exactly what CI tested, not something rebuilt on the server.
2. Every package comes from a mirror
Many services are under sanctions for us, so a build that pulls packages straight from the internet can break in the middle for reasons that have nothing to do with our code. Every package manager in the pipeline is pointed at a mirror we trust, so the CI/CD runs and the builds do not fail on a blocked download.
If you are not under sanctions, the same idea still helps: a registry that is slow or down should not be able to stop a release.
3. Staging first, with real data
Every version goes to staging before production. Staging has its own database, restored from a backup of the production database, so it holds real data, not a few test rows.
- Migrations run on staging first. A migration that locks a table or fails on real data shows it there, not in front of users.
- Migrations are scripts, not hand typed SQL: steps that run before, during and after the deploy, each with a rollback.
- The deploy reaches production only when staging is fine.
4. Production is blue-green
The new version comes up next to the old one, and both run at the same time. Traffic moves to the new version; the old one stays up.
That is what makes the fallback one click. If something goes wrong after the switch, at 11 pm or any other time, one button sends traffic back to the old version, which is still running. No rebuild, no restore, no searching the server under pressure.
5. SSH only through one gate
Nobody SSHs straight into the production server. Access goes through one central server, with keys, and only from a few known IP addresses. The production server and its database are locked down with firewall rules.
This is less about uptime and more about safety, but a server that only one door leads to is also a server nobody changes by hand at 11 pm.
The same night today
A deploy goes wrong at 11 pm. The build was tested in CI, the migration already ran on a copy of production, and the old version is still running next to the new one. One click, and users are back on the version that worked.
A deploy should be boring, not a stressful night.
Check your own setup
- Does any build run on the production server?
- Can a blocked or slow package registry stop a release?
- Do your migrations meet real data before they meet users?
- How many minutes, and how many commands, does it take to go back to the last version?
- Who can SSH into production, and from where?
Every "yes" to the first two and every "I'm not sure" to the rest is a night like the one above, waiting.
Next episode: how a tech lead works with AI.
| It is 11 pm. You deployed a small feature, the site does not come up and your phone keeps ringing. Every minute users leave, and you are still on the server trying to find what broke. |
| This is how we deploy our main product so that night does not happen, in the order a release goes through it. It is the first episode of the Production Ready series. |
| ## 1. The build never runs on the server |
| The server only runs code; it never builds it. Every build happens in the CI/CD pipeline (GitLab CI or something like it), and only the finished version goes to the server. |
| - A build that fails, fails in CI, where nobody is waiting on it. The site keeps running the last version. |
| - The server does not need compilers, build tools or extra memory for a build. |
| - What runs in production is exactly what CI tested, not something rebuilt on the server. |
| ## 2. Every package comes from a mirror |
| Many services are under sanctions for us, so a build that pulls packages straight from the internet can break in the middle for reasons that have nothing to do with our code. Every package manager in the pipeline is pointed at a mirror we trust, so the CI/CD runs and the builds do not fail on a blocked download. |
| If you are not under sanctions, the same idea still helps: a registry that is slow or down should not be able to stop a release. |
| ## 3. Staging first, with real data |
| Every version goes to staging before production. Staging has its own database, restored from a backup of the production database, so it holds real data, not a few test rows. |
| - Migrations run on staging first. A migration that locks a table or fails on real data shows it there, not in front of users. |
| - Migrations are scripts, not hand typed SQL: steps that run before, during and after the deploy, each with a rollback. |
| - The deploy reaches production only when staging is fine. |
| ## 4. Production is blue-green |
| The new version comes up next to the old one, and both run at the same time. Traffic moves to the new version; the old one stays up. |
| That is what makes the fallback one click. If something goes wrong after the switch, at 11 pm or any other time, one button sends traffic back to the old version, which is still running. No rebuild, no restore, no searching the server under pressure. |
| ## 5. SSH only through one gate |
| Nobody SSHs straight into the production server. Access goes through one central server, with keys, and only from a few known IP addresses. The production server and its database are locked down with firewall rules. |
| This is less about uptime and more about safety, but a server that only one door leads to is also a server nobody changes by hand at 11 pm. |
| ## The same night today |
| A deploy goes wrong at 11 pm. The build was tested in CI, the migration already ran on a copy of production, and the old version is still running next to the new one. One click, and users are back on the version that worked. |
| A deploy should be boring, not a stressful night. |
| ## Check your own setup |
| - Does any build run on the production server? |
| - Can a blocked or slow package registry stop a release? |
| - Do your migrations meet real data before they meet users? |
| - How many minutes, and how many commands, does it take to go back to the last version? |
| - Who can SSH into production, and from where? |
| Every "yes" to the first two and every "I'm not sure" to the rest is a night like the one above, waiting. |
| Next episode: how a tech lead works with AI. |





