<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Unrent</title>
    <description>The latest articles on DEV Community by Unrent (@unrenthq).</description>
    <link>https://dev.to/unrenthq</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4266626%2F007a7a00-8e4b-4f97-b4be-9ba0902e75c5.png</url>
      <title>DEV Community: Unrent</title>
      <link>https://dev.to/unrenthq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/unrenthq"/>
    <language>en</language>
    <item>
      <title>A practical checklist for leaving Heroku, Render or Railway</title>
      <dc:creator>Unrent</dc:creator>
      <pubDate>Wed, 02 Dec 2026 11:06:50 +0000</pubDate>
      <link>https://dev.to/unrenthq/a-practical-checklist-for-leaving-heroku-render-or-railway-46b5</link>
      <guid>https://dev.to/unrenthq/a-practical-checklist-for-leaving-heroku-render-or-railway-46b5</guid>
      <description>&lt;p&gt;Leaving a hosted PaaS is less a leap than a sequence. The usual surprises are not "Docker is hard". They are an environment variable nobody listed, a release-phase migration that only the old platform ran, a Postgres add-on that was never dumped, or a DNS cut that happened before the new health check passed.&lt;/p&gt;

&lt;p&gt;You can move an app onto a server you own and keep the old side running until the new one has proved itself. This is the order that makes that boring.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Inventory what the platform is doing for you
&lt;/h2&gt;

&lt;p&gt;Write down everything the current platform provides, not just the web process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Process types: web, workers, cron or scheduled jobs, and any one-off release command.&lt;/li&gt;
&lt;li&gt;The datastore: Postgres, Redis or something else, including the major version, and whether you have a recent backup you have restored.&lt;/li&gt;
&lt;li&gt;Environment variables, and which of them are secrets.&lt;/li&gt;
&lt;li&gt;Domains and certificates, and who owns the DNS.&lt;/li&gt;
&lt;li&gt;File storage, email, background queues and other add-ons you will have to replace or point at a new host.&lt;/li&gt;
&lt;li&gt;How the app is built: a Dockerfile, a buildpack, or a &lt;code&gt;compose.yaml&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Heroku:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;heroku ps --app your-app
heroku addons --app your-app
heroku config -s --app your-app &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; prod.env
heroku domains --app your-app
heroku pg:info --app your-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Treat &lt;code&gt;prod.env&lt;/code&gt; as secret. It does not belong in git, in a chat or in a ticket. For Render or Railway, export the same list from the dashboard or from the infrastructure file you already use. The names differ; the inventory should not.&lt;/p&gt;

&lt;p&gt;Lower the TTL on your production records now, while nothing else is changing, so the later cutover is not waiting on a day-old cache.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Get a server that will still be yours after you leave
&lt;/h2&gt;

&lt;p&gt;Pick a Linux VPS in an account you control. You will need Docker Engine 28 or newer, and a current Ubuntu, Debian, RHEL-family, Fedora or Amazon Linux release. The app, the database and the proxy will run there. If the control plane you use later goes away, those workloads should keep running on that server.&lt;/p&gt;

&lt;p&gt;Do not point production DNS at this machine yet. Give it a hostname you can hit for tests, and open only 80 and 443 (plus SSH, until you have another path in).&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Make the app build in a way that is not tied to the old platform
&lt;/h2&gt;

&lt;p&gt;A Dockerfile is the portable unit. If you already have one, use it. If you do not, this is the moment to add one, or to use a builder that takes the same repository and produces an image on your server.&lt;/p&gt;

&lt;p&gt;Pin the image you deploy by digest, not only by a tag. Record the digest when you pull or build, so a rollback is a redeploy of the same image, not a rebuild that may not match.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build -t web:move .
docker images --digests --no-trunc web:move
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set a health check the new side can run before it takes traffic: an HTTP path such as &lt;code&gt;GET /healthz&lt;/code&gt;, or a TCP check if you have nothing else. If the app has a release-phase migration, run that command from the new image, with a time limit, before any switch. If it fails, stop; the old platform is still serving.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Move the configuration, then the data
&lt;/h2&gt;

&lt;p&gt;Load the non-secret variables onto the new service. Set secrets in a way that does not leave them in your shell history, or in a control plane that does not need them in plaintext.&lt;/p&gt;

&lt;p&gt;Then copy the database. Take a fresh dump from the current primary, restore it to a Postgres on the new server, and compare. Leave the old database running. A typical Postgres path looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# from the current platform, into a custom-format dump&lt;/span&gt;
pg_dump &lt;span class="s2"&gt;"$SOURCE_DATABASE_URL"&lt;/span&gt; --format=custom --no-owner --no-acl --file=app.dump

&lt;span class="c"&gt;# onto the new server's database&lt;/span&gt;
pg_restore --no-owner --no-acl --dbname=&lt;span class="s2"&gt;"$TARGET_DATABASE_URL"&lt;/span&gt; app.dump
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Heroku you can also use &lt;code&gt;heroku pg:backups:capture --app your-app&lt;/code&gt; and &lt;code&gt;heroku pg:backups:download --app your-app&lt;/code&gt;. Restore into a database that is not yet serving production traffic. Check row counts, a few known records, and that the app can boot against the copy.&lt;/p&gt;

&lt;p&gt;If the app writes continuously, plan a short freeze or a follow-up sync for the final cut.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Prove the new side before you cut DNS
&lt;/h2&gt;

&lt;p&gt;Deploy the image on the new server, run migrations from that image, start it, and hit the health check on the new hostname. Click through the real user paths: sign in, a write, and a background job if you have one.&lt;/p&gt;

&lt;p&gt;Only then attach the domain. Keep the old platform live so you can send traffic back if you need to. When you are ready, point the records at the new servers, wait until you see traffic and healthy checks, and watch logs before you tear anything down.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Unrent fits
&lt;/h2&gt;

&lt;p&gt;Unrent is a hosted control plane that deploys apps and Postgres onto servers you already own. An agent on the server connects out, so Unrent holds no SSH key and opens no inbound port. Your app keeps running if Unrent is down.&lt;/p&gt;

&lt;p&gt;You can connect a server you already have, or have Unrent create one in your own account on Hetzner, DigitalOcean, Vultr, Akamai (Linode), Scaleway, UpCloud, AWS EC2, Amazon Lightsail, Google Cloud, Azure or OVHcloud.&lt;/p&gt;

&lt;p&gt;Add the app as an image, or from a GitHub, GitLab, Bitbucket or Gitea/Forgejo repository. If the repository has a Dockerfile, Unrent builds it on your server and deploys the image by digest. If it has a &lt;code&gt;compose.yaml&lt;/code&gt; and no Dockerfile, it deploys as a stack. Otherwise Railpack can detect the language; you can also choose Cloud Native Buildpacks. Set the port and a health check. Values you mark as secret are sealed in your browser to the server, so Unrent stores only ciphertext.&lt;/p&gt;

&lt;p&gt;Create a Postgres 17 or 18 database on the same server and link it to the service. Linking writes &lt;code&gt;DATABASE_URL&lt;/code&gt; and the usual &lt;code&gt;PG*&lt;/code&gt; variables into the service's config. Restore your dump into that database, then deploy. The run view shows pull or build, the pre-deploy command, start, health check and the switch. A release that fails its health check never receives traffic.&lt;/p&gt;

&lt;p&gt;For the domain, add it to the service and create the TXT and A/AAAA (or CNAME) records Unrent shows you. The TXT record on &lt;code&gt;_unrent-challenge&lt;/code&gt; proves the name is yours. Once the checks pass, the domain goes live and gets a Let's Encrypt certificate on its first visit. Every service also gets an HTTPS address on &lt;code&gt;unrent.page&lt;/code&gt; that you can use as the test hostname, before you touch production DNS.&lt;/p&gt;

&lt;p&gt;After the cut, add an S3-compatible bucket for backups (Amazon S3, Cloudflare R2, Backblaze B2 or another compatible service) and check that a restore works. The old platform can stay up as a fallback until you are sure you will not need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The order, one more time
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Inventory processes, add-ons, config, domains and the database. Lower DNS TTLs.&lt;/li&gt;
&lt;li&gt;Put a server in an account you control. Do not cut DNS yet.&lt;/li&gt;
&lt;li&gt;Build a pinned image, with a health check and a migration command.&lt;/li&gt;
&lt;li&gt;Copy config, then restore a fresh database dump into a new Postgres, and verify it.&lt;/li&gt;
&lt;li&gt;Deploy, pass the health check, and exercise the app on a temporary hostname.&lt;/li&gt;
&lt;li&gt;Point DNS at the new side, watch it, and only then take the old platform down.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The move is done when the app, the data and the domain are on infrastructure you can keep without the old platform, and you have already seen the new side serve real traffic.&lt;/p&gt;

&lt;p&gt;More at &lt;a href="https://unrent.dev/" rel="noopener noreferrer"&gt;unrent.dev&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>heroku</category>
      <category>devops</category>
      <category>docker</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Guardrails for a coding agent that can reach production</title>
      <dc:creator>Unrent</dc:creator>
      <pubDate>Wed, 02 Dec 2026 11:06:19 +0000</pubDate>
      <link>https://dev.to/unrenthq/guardrails-for-a-coding-agent-that-can-reach-production-5ecj</link>
      <guid>https://dev.to/unrenthq/guardrails-for-a-coding-agent-that-can-reach-production-5ecj</guid>
      <description>&lt;p&gt;Coding agents are now close enough to your infrastructure to be useful. They can read logs, sketch an environment and request a deploy from the same conversation in which they just changed the code. That is a good workflow only if a bad or unexpected request cannot land in production on its own.&lt;/p&gt;

&lt;p&gt;The failure mode is not "the model is evil". It is more ordinary: the agent picks the wrong environment, a prompt includes a secret, a tool call is broader than you thought, or a request that looks like yours was not something you would have typed. You want the agent to be able to ask, and you want a person to approve the exact change before a server acts on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with read access
&lt;/h2&gt;

&lt;p&gt;Give the agent the smallest scope that still helps. Read access is enough to list environments, inspect service health and fetch redacted logs. That is the right first connection: you can ask "what is running in production?" without also granting "deploy it".&lt;/p&gt;

&lt;p&gt;Grant deploy or operate access only for the workflows you intend to use, and only for the organisation you mean. A connection that can see every organisation you belong to, or that was left on from a laptop experiment, is how a casual prompt becomes a production change.&lt;/p&gt;

&lt;p&gt;If your client supports it, reconnect and review the scopes instead of assuming last month's defaults still hold. Ask the agent to list environments and services first. If it can already request a deploy at that point, the scope is too wide.&lt;/p&gt;

&lt;h2&gt;
  
  
  Never let secrets pass through the model
&lt;/h2&gt;

&lt;p&gt;A coding agent that can print a database password or an API key will, sooner or later, put that value in a log, a chat transcript or a tool argument. Treat that as a design constraint, not a policy you hope the model will follow.&lt;/p&gt;

&lt;p&gt;Practical rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The agent can know the &lt;em&gt;names&lt;/em&gt; of secrets, not their values.&lt;/li&gt;
&lt;li&gt;Setting a secret happens on your machine, not in the chat.&lt;/li&gt;
&lt;li&gt;Production credentials never go into a sandbox, a preview or a paste "so the agent can try it".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you need to add a key, do it in a local command that reads the value from stdin or a prompt, and confirm afterwards that the chat never saw it. If a tool offers to "set STRIPE_KEY=sk_live_â€¦" for you, refuse the tool and set the value yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Approve the exact job, not a standing permission
&lt;/h2&gt;

&lt;p&gt;A blanket "this agent may deploy" is hard to reason about. A better control is: the agent requests a deploy, the control plane holds the job, and a person signs that exact job. The approval should not be reusable for a different image, service or environment.&lt;/p&gt;

&lt;p&gt;Put a time limit on it. A request that sits in a queue overnight is no longer the thing you looked at. The tool result should come back as "this needs your approval" with a link to the job, and nothing should be sent to the server until you sign it.&lt;/p&gt;

&lt;p&gt;The shape looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The agent asks to deploy, roll back or restart.&lt;/li&gt;
&lt;li&gt;The job is signed and held. The new release is not running.&lt;/li&gt;
&lt;li&gt;You review the exact job and approve it with a passkey.&lt;/li&gt;
&lt;li&gt;The server checks that signature and the approval itself, then acts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 4 matters as much as step 3. If the rules live only in the control plane, a compromised control plane can skip them. The stronger version is that the server also knows the policy, and will refuse a deploy that does not have the approvals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put a floor on production
&lt;/h2&gt;

&lt;p&gt;Not every environment needs the same friction. A personal preview can be loose. Production should not be.&lt;/p&gt;

&lt;p&gt;Set an approval floor on production for deploys, config changes and rollbacks: at least one person, and two if more than one person can already approve. If you can, refuse self-approval, so the person who asked for the change is not also the only person who signs it.&lt;/p&gt;

&lt;p&gt;That is the right place to be strict, because a coding agent is otherwise very good at doing exactly what you just implied in a hurry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give the agent a place that is not production
&lt;/h2&gt;

&lt;p&gt;When the agent needs to try a change, give it a disposable copy: its own URL, a time limit, and a database that is masked or empty, from a non-production environment. A sandbox should never receive a production secret and should never be able to touch production.&lt;/p&gt;

&lt;p&gt;Separately, check the agent's tools for anything that deletes a database, a service or a server. If the answer is not a clear no, do not connect that agent to production.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Unrent runs this
&lt;/h2&gt;

&lt;p&gt;Unrent is a hosted control plane that deploys onto servers you own. You can connect Claude Code, Codex, Cursor, VS Code or another MCP client to &lt;code&gt;https://mcp.unrent.dev/mcp&lt;/code&gt;. On first use, choose one organisation and start with read access. Grant deploy or operate access only for the workflows you intend to use.&lt;/p&gt;

&lt;p&gt;Claude Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add --transport http unrent https://mcp.unrent.dev/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then type &lt;code&gt;/mcp&lt;/code&gt; in Claude Code, choose unrent and sign in.&lt;/p&gt;

&lt;p&gt;Codex CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ~/.codex/config.toml
&lt;/span&gt;&lt;span class="k"&gt;[mcp_servers.unrent]&lt;/span&gt;
&lt;span class="na"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://mcp.unrent.dev/mcp"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex mcp login unrent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;get_variables&lt;/code&gt; returns the names of secrets, never their values, and &lt;code&gt;set_variables&lt;/code&gt; refuses anything that looks secret. You set the value on your own machine, where it is sealed, so it never passes through the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# the value is read from stdin&lt;/span&gt;
unrent env &lt;span class="nb"&gt;set&lt;/span&gt; production/web &lt;span class="nv"&gt;STRIPE_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;- --secret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploys, rollbacks and restarts requested by the agent are signed and held. The tool answers &lt;code&gt;approval_required&lt;/code&gt; with a link. Nothing is sent to the server until a person approves that exact job with a passkey (Touch ID, Windows Hello or a security key). A job nobody approves within 10 minutes expires. The server enforces the same rule: an approval floor is stored on the server as a policy change, and after that it refuses a deploy that does not have those approvals.&lt;/p&gt;

&lt;p&gt;An admin can set an environment to need 0, 1 or 2 approvals. Production's floor is one by default, and you can raise it to two. You can also turn on the two-person rule so nobody approves their own request.&lt;/p&gt;

&lt;p&gt;An authorised agent can create a disposable sandbox under the sandbox policy. A sandbox never gets a secret value and never touches production. No MCP tool deletes a database, a service or a server.&lt;/p&gt;

&lt;h2&gt;
  
  
  A checklist before you let an agent request deploys
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Does the connection have read access only, until you deliberately grant more?&lt;/li&gt;
&lt;li&gt;Can the agent read or set secret values, or only their names?&lt;/li&gt;
&lt;li&gt;Does a deploy, rollback or restart wait for a person to sign that exact job?&lt;/li&gt;
&lt;li&gt;Does the approval expire if nobody acts on it?&lt;/li&gt;
&lt;li&gt;Does the server itself refuse a change that lacks those approvals?&lt;/li&gt;
&lt;li&gt;Does production need at least one approval, and can you require two?&lt;/li&gt;
&lt;li&gt;Is there a sandbox path that cannot see production secrets?&lt;/li&gt;
&lt;li&gt;Can the agent delete a database or a server? If the answer is not a clear no, do not connect it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A coding agent is a fast junior operator. Give it the same rule you would give a person: it can ask, it can inspect, and production does not move until you say so, on that job, with a key only you can use.&lt;/p&gt;

&lt;p&gt;More at &lt;a href="https://unrent.dev/" rel="noopener noreferrer"&gt;unrent.dev&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>security</category>
      <category>mcp</category>
    </item>
    <item>
      <title>Close SSH on your VPS without locking yourself out</title>
      <dc:creator>Unrent</dc:creator>
      <pubDate>Wed, 02 Dec 2026 11:05:41 +0000</pubDate>
      <link>https://dev.to/unrenthq/close-ssh-on-your-vps-without-locking-yourself-out-5hjp</link>
      <guid>https://dev.to/unrenthq/close-ssh-on-your-vps-without-locking-yourself-out-5hjp</guid>
      <description>&lt;p&gt;Most VPS images start with SSH open to the internet on port 22. That is convenient on day one, and it is also the port that gets scanned all day. Closing it is a good idea. Doing it in the wrong order is how people lock themselves out of a box they still need.&lt;/p&gt;

&lt;p&gt;You can close SSH safely. You just need another way to reach the server, a firewall that matches what you think is open, and a way to deploy and debug that does not depend on an inbound port.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "closing SSH" actually means
&lt;/h2&gt;

&lt;p&gt;Two things have to be true at once:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;sshd&lt;/code&gt; is not reachable from the internet. Either it is not listening on a public address, or the firewall (on the host and at your cloud provider) drops port 22.&lt;/li&gt;
&lt;li&gt;You still have a path to run commands when something breaks: the provider's serial or VNC console, SSH only on a private network (for example Tailscale), or a management agent that opens a terminal only when you ask.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you only change &lt;code&gt;sshd_config&lt;/code&gt; and leave port 22 open, scanners still find a listener. If you only close the port and have no other path in, the next kernel update or bad firewall rule becomes an outage you cannot fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Look at what is actually listening
&lt;/h2&gt;

&lt;p&gt;Before you change anything, see what the server already exposes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ss -tulpn
sudo iptables -L -n
&lt;span class="c"&gt;# Ubuntu/Debian, if ufw is in use:&lt;/span&gt;
sudo ufw status verbose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a typical new VPS you will see &lt;code&gt;sshd&lt;/code&gt; on 22, and maybe nothing else. After you put an app in production you should see 80 and 443, and nothing unexpected. A forgotten &lt;code&gt;docker run -p 5432:5432&lt;/code&gt;, or a database published to &lt;code&gt;0.0.0.0&lt;/code&gt;, is more common than people think.&lt;/p&gt;

&lt;p&gt;Do the same check in your cloud console. The host firewall and the provider's security group are two separate doors. If either one is open, the port is open.&lt;/p&gt;

&lt;h2&gt;
  
  
  Harden SSH before you depend on closing it
&lt;/h2&gt;

&lt;p&gt;Keep SSH available while you set up the rest, but stop it accepting passwords. On OpenSSH this is the usual baseline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# in /etc/ssh/sshd_config.d/hardening.conf&lt;/span&gt;
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin prohibit-password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then test and reload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo sshd -t &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo systemctl reload ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use a second session to confirm you can still sign in with a key before you close the first one. A change that drops your only session is the classic lock-out.&lt;/p&gt;

&lt;p&gt;If you plan to keep SSH at all, restrict it further: only from your own address, or only on a tailnet. Binding SSH to a private interface is stronger than hoping a long key is enough on a public port.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set a default-deny firewall
&lt;/h2&gt;

&lt;p&gt;On Ubuntu or Debian with &lt;code&gt;ufw&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 22/tcp   &lt;span class="c"&gt;# temporary, until the new path in is proven&lt;/span&gt;
sudo ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
sudo ufw status verbose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a RHEL-family server, the same idea is a default-deny nftables or firewalld zone, with only the ports you chose. Allow outgoing traffic: an outbound-only agent, package updates and certificate issuance all need it.&lt;/p&gt;

&lt;p&gt;Do not delete port 22 in this step. Prove the next path first.&lt;/p&gt;

&lt;h2&gt;
  
  
  The outbound-only path
&lt;/h2&gt;

&lt;p&gt;The reason SSH stays open on so many app servers is that the deploy tool needs a way in. CI holds a key, a panel shells in, or you &lt;code&gt;ssh&lt;/code&gt; to run &lt;code&gt;docker pull&lt;/code&gt;. That means a listening port, and a key that has to live somewhere other than the server.&lt;/p&gt;

&lt;p&gt;The other pattern is an agent on the server that dials out, usually over a websocket, and only accepts instructions that are signed and narrowly typed. Nothing listens for the control plane. If you disconnect the agent, the app containers, the database and the proxy keep running; you have only lost the remote panel.&lt;/p&gt;

&lt;p&gt;That is the path you want to prove before you close port 22:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The agent is connected.&lt;/li&gt;
&lt;li&gt;You can deploy, read logs and, if you need a shell, open a terminal through that path.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ss -tulpn&lt;/code&gt; shows no listening port for the agent itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only when those are true is it safe to take SSH off the public internet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then close port 22
&lt;/h2&gt;

&lt;p&gt;Close SSH in both places: the host firewall and the cloud security group. If you still want a break-glass key, leave &lt;code&gt;sshd&lt;/code&gt; running but bound to the tailnet, or allowed only from your address, and confirm that a scan of the public IP no longer shows 22.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ufw: drop the temporary SSH rule&lt;/span&gt;
sudo ufw delete allow 22/tcp
sudo ufw status verbose

&lt;span class="c"&gt;# confirm nothing is listening on the public address&lt;/span&gt;
sudo ss -tulpn &lt;span class="o"&gt;|&lt;/span&gt; grep &lt;span class="s1"&gt;':22'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, from a network that is not on any allow-list, check that the public IP refuses 22 and still serves 80 and 443. The provider console stays your last resort.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Unrent runs this
&lt;/h2&gt;

&lt;p&gt;Unrent is a hosted control plane that deploys apps and Postgres onto servers you already own. The agent on each server connects out. Unrent does not hold an SSH key, and the agent does not open a listening port.&lt;/p&gt;

&lt;p&gt;Servers Unrent creates have SSH closed unless you choose otherwise. You can leave it off, open it only from your address with your key, or only over Tailscale. Web traffic can be public on 80 and 443, or only through a Cloudflare Tunnel, with no inbound port at all.&lt;/p&gt;

&lt;p&gt;A terminal session is not a standing login. It is a recorded session that your approvers sign with a passkey, and the server checks that approval itself before a shell opens. Opening a shell on the server itself takes two approvers.&lt;/p&gt;

&lt;p&gt;The same set of open ports is enforced twice: in your cloud firewall, where Unrent puts the rules back if someone changes them in the cloud console, and in the server's own firewall. Every night the server compares what is listening with that set and reports, in plain words, a port open to the internet, a missing firewall, SSH accepting passwords, or a cloud firewall changed outside Unrent.&lt;/p&gt;

&lt;p&gt;If you bring a server you already have, the install command ends by offering the same choice: pick the profile, review the hardening plan, then apply it. The plan is shown first; nothing is applied until you accept it. On the server, &lt;code&gt;sudo unrent doctor&lt;/code&gt; checks the agent, its outbound connection, the clock, Docker and the firewall, and prints a one-line fix for anything that fails. It only reads; it does not change the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  A checklist you can reuse
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Do you have a path in that is not port 22: provider console, private SSH, or a connected outbound agent?&lt;/li&gt;
&lt;li&gt;Have you confirmed that path with a real command, not just a "connected" light?&lt;/li&gt;
&lt;li&gt;Do the host firewall and the cloud security group allow the same set of ports?&lt;/li&gt;
&lt;li&gt;Does &lt;code&gt;ss -tulpn&lt;/code&gt; match that set?&lt;/li&gt;
&lt;li&gt;If SSH still runs, does it accept keys only, and only from a network you intend?&lt;/li&gt;
&lt;li&gt;After you close 22, did you test from an address that should be blocked?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Close the port last, not first. The goal is a server that has nothing inbound it does not need, and a way back in that you have already used.&lt;/p&gt;

&lt;p&gt;More at &lt;a href="https://unrent.dev/" rel="noopener noreferrer"&gt;unrent.dev&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>security</category>
      <category>devops</category>
      <category>selfhosted</category>
    </item>
    <item>
      <title>What your deploy should do when the new release is broken</title>
      <dc:creator>Unrent</dc:creator>
      <pubDate>Wed, 02 Dec 2026 10:40:39 +0000</pubDate>
      <link>https://dev.to/unrenthq/what-your-deploy-should-do-when-the-new-release-is-broken-2723</link>
      <guid>https://dev.to/unrenthq/what-your-deploy-should-do-when-the-new-release-is-broken-2723</guid>
      <description>&lt;p&gt;Most deploy guides describe the happy path. The interesting part of a deploy is what happens when the new release is bad: the migration fails, the app boots but cannot reach its database, or a bug only shows up after traffic arrives.&lt;/p&gt;

&lt;p&gt;A good deploy treats each of those as a normal outcome, not an outage. Here is the order of steps that makes that true, how to do it by hand, and how Unrent runs it on your own server.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule: the old release serves until the new one proves itself
&lt;/h2&gt;

&lt;p&gt;Stop-then-start deploys have a gap where nothing is serving, and if the new release never comes up, the gap never ends. The fix is to run the new release next to the old one and only move traffic once it is healthy.&lt;/p&gt;

&lt;p&gt;That gives you four checkpoints, and each one can fail safely:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pull or build, and pin the digest.&lt;/strong&gt; A tag like &lt;code&gt;:latest&lt;/code&gt; can change under you. The SHA-256 digest cannot, so it is what you roll back to later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run migrations from the new image.&lt;/strong&gt; With a time limit. If they fail, stop here. Nothing has touched traffic yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Start beside the old release and health-check it.&lt;/strong&gt; An HTTP check such as &lt;code&gt;GET /healthz&lt;/code&gt;, or a TCP check. If it never passes, the new container never receives traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Switch, then drain.&lt;/strong&gt; Move traffic to the new release, let the old one finish its requests, and keep it for rollback.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Doing it by hand
&lt;/h2&gt;

&lt;p&gt;On a single server with Docker and a reverse proxy, the shape looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Pull and record the digest&lt;/span&gt;
docker pull ghcr.io/you/web:1.4.2
docker inspect --format &lt;span class="s1"&gt;'{{index .RepoDigests 0}}'&lt;/span&gt; ghcr.io/you/web:1.4.2

&lt;span class="c"&gt;# 2. Run migrations from the new image; stop if they fail&lt;/span&gt;
docker run --rm --env-file prod.env ghcr.io/you/web:1.4.2 npm run migrate &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 1

&lt;span class="c"&gt;# 3. Start the new release on a different port and check it&lt;/span&gt;
docker run -d --name web-new -p 8081:8080 --env-file prod.env ghcr.io/you/web:1.4.2
curl -fsS http://localhost:8081/healthz &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; docker rm -f web-new&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 1&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# 4. Point the proxy at :8081, reload it, then stop the old container (keep it, don't remove it)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works, but every step is a place to forget something, usually at the worst time.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Unrent runs it
&lt;/h2&gt;

&lt;p&gt;Unrent is a hosted control plane that deploys onto servers you own. An agent on each server connects out, so there are no inbound ports and no SSH keys for Unrent to hold. Every deploy runs the same steps on your server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The image is pulled (or built on your server) and pinned to its SHA-256 digest.&lt;/li&gt;
&lt;li&gt;Your pre-deploy command runs from the new image, with a time limit. If it fails, the old release keeps serving.&lt;/li&gt;
&lt;li&gt;The new release starts beside the old one and Unrent waits for its HTTP or TCP health check.&lt;/li&gt;
&lt;li&gt;Only then does Caddy switch traffic. The old release drains and is kept for rollback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A release that fails its health check never receives traffic.&lt;/p&gt;

&lt;p&gt;If a service runs on several servers, the deploy rolls out one server at a time and stops at the first failed health check.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rolling back without a rebuild
&lt;/h2&gt;

&lt;p&gt;When a bug gets past the health check, a rollback redeploys an earlier release by its digest, with the config version it ran with. Nothing is rebuilt, so it takes as long as a container start and a health check.&lt;/p&gt;

&lt;p&gt;Config changes are versioned too. Changing a variable creates a new version you review and apply, and applying it goes through the same health check and switch.&lt;/p&gt;

&lt;p&gt;If a coding agent such as Claude Code or Codex asks for the rollback over MCP, it waits for a person to approve that exact job with a passkey.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick check for your own setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Does anything serve traffic while the new release starts?&lt;/li&gt;
&lt;li&gt;If migrations fail, what is serving?&lt;/li&gt;
&lt;li&gt;Can a release that fails its health check ever receive traffic?&lt;/li&gt;
&lt;li&gt;Is your rollback a rebuild, or a redeploy of a pinned digest?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More at &lt;a href="https://unrent.dev/" rel="noopener noreferrer"&gt;unrent.dev&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>deployment</category>
      <category>selfhosted</category>
    </item>
  </channel>
</rss>
