How to move a DigitalOcean Droplet from Ubuntu to Debian
By Flavio
Updated
Tagged: Security
Move a DigitalOcean Droplet from Ubuntu to Debian: new server, copy the data, then switch the reserved IP. In-place conversion is unsupported.
As of 4 November 2026, Ubuntu’s tracker still lists CVE-2026-98432 as Vulnerable on every current LTS, with a fix in progress and no published USN. Debian’s security archive for Debian 13 already has a fixed kernel. If that Droplet is on DigitalOcean and you want the fix now, build a new Debian 13 Droplet, copy the service, and move the address.
The bug itself, the kernel check, and the MPTCP stop gap are in CVE-2026-98432: check your Linux server and close public ports. This post is about the move.
On 2 November 2026 Pieter Levels wrote that Ubuntu still hadn’t patched it, and that “We might just have to switch all our servers over to Debian”. He linked WTF Ubuntu?, which says Debian patched it on October 16 while every supported Ubuntu release, LTS included, was still listed as Vulnerable, as of 2026-11-02 14:48 UTC. The same post quotes Levels’ earlier note on closing every VPS port.
The October 16 date is Chalmovsky’s. The Debian tracker names DSA-6568-1 as the first fixed package for trixie (linux 6.12.113-1).
Where the two trackers stand
Ubuntu’s page was last updated 3 November 2026. DigitalOcean’s current Ubuntu images are 22.04, 24.04, and 26.04, and the main linux package is Vulnerable on all three, with fixes in progress (5.15.0-203.213, 6.8.0-149.149 and 7.0.0-43.43). A 22.04 Droplet that boots the HWE kernel is a different row, linux-hwe-6.8 on jammy, which is also work in progress in 6.8.0-149.149~22.04.1. Cloud and OEM kernels have their own rows too. The CVE post has the full tables for Ubuntu, Debian and RHEL, and shows how to match uname -r to a row.
This delay is inside standard support. Ubuntu Pro and Kernel Livepatch have nothing to apply until a fixed kernel exists.
On Debian 13 (trixie), the first fixed version is 6.12.113-1, and on 2 November the package in trixie-security was already newer, 6.12.115-2. DSA-6602-1, listed that day as a linux security update, doesn’t name CVE-2026-98432, but it is a later kernel, so the tracker marks it fixed. Bookworm has fixes in its security suite too.
Be careful with the base suite. Plain trixie still has the vulnerable 6.12.107-1, so a Debian 13 machine that never enables trixie-security installs the vulnerable kernel. The command to check the candidate is further down.
Ubuntu and Debian, without the panic
Switching the whole fleet because one kernel is late is a real choice. It’s a bad one if you need something Debian does not ship.
Ubuntu’s release cycle publishes a version every six months. Interim releases get nine months of updates. An LTS lands every two years, with five years of standard security maintenance for the Main archive. Ubuntu Pro adds ESM and the Legacy add-on, up to 15 years, and Kernel Livepatch. Pro is free for personal use on up to five machines. ESM covers Main and Universe for 10 years.
On that page, 24.04 LTS has standard support through May 2029 and ESM through May 2034. 22.04 LTS has standard support through May 2027, and 26.04 LTS through May 2031. 20.04 LTS left standard support in May 2025.
Debian’s releases page describes about five years for a stable release: three of full support, then two of LTS. Debian 13 “trixie” was released on 9 August 2025. The latest point release listed there is 13.7, on 12 September 2026. Full support runs to 9 August 2028, LTS to 30 June 2030, and the page lists an ELTS date of 30 June 2035. Debian 12 “bookworm” left full support on 11 July 2026, and its LTS runs to 30 June 2028.
Debian stable is the quieter archive, while Ubuntu gives you interim releases and Ubuntu Pro’s long window. Snaps are an Ubuntu feature (Ubuntu Core is an all-snap system), and Debian does not install snapd by default. Run snap list on the Ubuntu Droplet before you assume every service has a .deb.
A Launchpad PPA is an Ubuntu archive. Debian’s FAQ is direct about derivatives: “These distributions are Debian-based, but they are not Debian.” On migrating, it says to back up your data and reinstall from scratch, and not to “upgrade” with the package management tools, “as you might end up with an unusable system” (Debian FAQ, 3.2.1 and 3.2.3).
Package freshness cuts both ways. Debian 13’s nodejs candidate on 2 November 2026 was 20.19.2+dfsg-1+deb13u3 from trixie-security. The same day, nodejs.org/en/download offered Node.js 26.13.0 LTS, 24.22.2 LTS, and 22.23.4 LTS, and listed the 20.x line as EOL (20.20.2). Debian will keep patching its package, but it’s the old line.
Leave the disk alone
People do write up an in-place conversion. One Unix & Linux answer describes adding Debian repositories, pinning the Ubuntu packages down, and running a dist-upgrade, including a claimed run from Ubuntu 22.04 to Debian 11. A Hacker News thread has the other stories, with kernel updates and Wi-Fi that broke.
I’m not giving that recipe here. The FAQ already says the package tools can leave you with an unusable system, and the two archives rebuild the same upstream with different patches, different kernel package names, and different /etc conffiles. A half-finished dist-upgrade can leave a box you never SSH into again, while a new Droplet keeps the old one bootable until you move the address.
The route
Inventory the Ubuntu Droplet, snapshot it, create a Debian 13 Droplet in the same region, copy the data, test, then move the reserved IP or the DNS record. Power the old Droplet off, and destroy it after you have lived on the new one for a few days.
Rebuild is the other button, and it is the destructive one. DigitalOcean says a rebuild wipes the disk, keeps the Droplet’s IP, and only offers images from the same OS family. The docs don’t say whether Ubuntu and Debian count as one family, and a DigitalOcean ideas thread uses a Debian-to-Ubuntu rebuild as the example of a cross-family rebuild the panel refuses. If Debian 13 appears in that Droplet’s rebuild image list, the panel will let you wipe the disk and install it. If it doesn’t, stop there. The CLI form, from the rebuild docs, is:
doctl compute droplet-action rebuild "$OLD_ID" --image debian-13-x64
The doctl commands in this post come from DigitalOcean’s reference docs. 203.0.113.25 below is DigitalOcean’s documentation address, so replace it with yours.
Use rebuild only when the data already lives somewhere else, Debian 13 is actually in the list, and you need that exact public IP, because destroying a Droplet releases it and DigitalOcean says you are unlikely to get it back. Rebuild cannot keep the old disk online while you test, and you get a new SSH host key.
Resize changes CPU, RAM, and disk, never the OS, and you cannot shrink the disk. Skip it for this job. The doctl guide has the resize command if you need a bigger plan later.
Inventory the Ubuntu box
SSH in, write the answers down, and copy them off the server. A snapshot is a disk image, while this list tells you what to reinstall.
Packages you installed yourself:
apt-mark showmanual
Running services:
systemctl list-units --type=service --state=running
Listening ports:
ss -tulpn
Cron and timers:
ls /etc/cron.* /var/spool/cron/crontabs
systemctl list-timers --all
Users and keys:
getent passwd
ls /root/.ssh /home/*/.ssh
Then the files the service depends on: Nginx or Caddy config under /etc, ufw status verbose if you use ufw, Compose files and docker ps / docker volume ls, anything in /etc/letsencrypt, and every .env the app reads. Also snap list, and every file under /etc/apt/sources.list.d that points at a PPA.
Databases get their own dump, because a disk snapshot of a running database can catch a half-written page. A dump of a busy server can still miss in-flight writes, so use the database’s own backup page if you need a consistent online dump. PostgreSQL’s is SQL dump.
pg_dump app > app.sql
mysqldump app > app.sql
Snapshot, then create Debian 13
Snapshot pricing is $0.06 per GB per month for Droplets, with a $0.01 minimum, until you delete the snapshot. Power the Droplet off first if you want a consistent disk. That is downtime. Take the database dump either way.
doctl compute droplet-action shutdown "$OLD_ID" --wait
doctl compute droplet-action snapshot "$OLD_ID" \
--snapshot-name ubuntu-before-debian \
--wait
doctl compute droplet-action power-on "$OLD_ID" --wait
shutdown asks the guest to stop. The doctl guide notes that the action can finish without the guest powering off, and that power-off is the forced one, which cuts through writes. Check the status before you trust the snapshot.
DigitalOcean’s image table lists one Debian image: Debian 13, slug debian-13-x64, image ID 252660345. Ubuntu on that page is ubuntu-22-04-x64, ubuntu-24-04-x64, and ubuntu-26-04-x64. There is no Debian 12 image. Image IDs move, so confirm the slug before you create:
doctl compute image list-distribution
Copy the old Droplet’s region, size, VPC, and SSH key. The size slugs below are examples from DigitalOcean’s docs (s-1vcpu-1gb, region nyc3), and doctl compute droplet get "$OLD_ID" shows the real ones.
Droplet pricing bills a Droplet from create until destroy, even powered off, because the CPU stays reserved. Bundled plans bill per second, with a 60 second or $0.01 minimum, and a cap of 672 hours in a month. The v5 plans have no monthly cap, and a public IPv4 on v5 is a separate line (the pricing page lists an introductory $0.00, subject to change).
The panel path is the same one in Create a VPS on DigitalOcean. Choose Debian 13 on the Distributions list. With doctl, pass the key. If you omit --ssh-keys, DigitalOcean emails a temporary root password.
NEW_ID=$(doctl compute droplet create debian-web \
--region nyc3 \
--image debian-13-x64 \
--size s-1vcpu-1gb \
--ssh-keys "$SSH_KEY_ID" \
--vpc-uuid "$VPC_UUID" \
--enable-monitoring \
--wait \
--format ID \
--no-header)
--vpc-uuid is for a non-default VPC, and --enable-private-networking is for the default one. Both flags are on the droplet create reference (doctl v2.1.0). --wait waits for the Droplet action, not for cloud-init. Run cloud-init status --wait on the new box for that.
Put the new Droplet in the same Cloud Firewall before you open SSH to the world. Cloud Firewalls are free and stateful, and the default is deny. If the old firewall is attached by tag, pass that --tag-name on create, which is how the doctl guide does it. If it is attached to Droplet IDs, add the new one, as in the add-droplets reference:
doctl compute firewall add-droplets "$FIREWALL_ID" --droplet-ids "$NEW_ID"
A Droplet can sit in more than one firewall, and the rules add up, so one allow-everything rule cancels a tight one. Read the whole set.
A volume can attach to one Droplet at a time. Detach it from the old one, then attach it to the new one:
doctl compute volume-action detach "$VOLUME_ID" "$OLD_ID"
doctl compute volume-action attach "$VOLUME_ID" "$NEW_ID"
DigitalOcean auto-mounts a pre-formatted volume on Debian Droplets created on or after 26 April 2018. Older guests need the mount steps. You can attach up to 15 volumes.
Harden it before you copy the app
The long version of a locked-down VPS is How to secure a VPS with Tailscale and Cloudflare Tunnel. SSH itself is SSH for developers. Both, and the free VPS course and Linux server security course, are written around Ubuntu. The habits transfer, and the package details below are Debian’s.
If a VPS is the wrong shape and this move is a good moment to stop, Where to host covers that earlier question.
The package versions and config files in the rest of this post come from a Debian 13.7 (trixie) system installed from deb.debian.org on 2 November 2026. A DigitalOcean image can differ, so read your own.
With the OpenSSH package there (1:10.0p1-7+deb13u4), sshd -T reported:
permitrootlogin without-password
pubkeyauthentication yes
passwordauthentication yes
kbdinteractiveauthentication no
Root can log in with a key, and password login is still on for other users. A DigitalOcean image may override this in cloud-init, so read sshd -T on the Droplet. Then set keys only, and create a sudo user before you close root.
adduser deploy
usermod -aG sudo deploy
install -d -m 700 -o deploy -g deploy /home/deploy/.ssh
Put your public key in /home/deploy/.ssh/authorized_keys, mode 600, owner deploy. In /etc/ssh/sshd_config:
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin no
sshd -t must succeed before you reload ssh. The SSH post has the rest, including what to do when the reload locks you out. Keep DigitalOcean’s web console open while you test the new user.
unattended-upgrades 2.12 wrote /etc/apt/apt.conf.d/20auto-upgrades as:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
The active lines in 50unattended-upgrades were:
Unattended-Upgrade::Origins-Pattern {
"origin=Debian,codename=${distro_codename},label=Debian";
"origin=Debian,codename=${distro_codename},label=Debian-Security";
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
};
The -updates, -proposed-updates, and backports lines were commented out. So was // "linux-"; inside the package blacklist, which means kernel packages are eligible. Unattended-Upgrade::Automatic-Reboot was commented out too, including the "02:00" time. So security updates install, and the new kernel doesn’t boot until you reboot.
sudo apt install unattended-upgrades
sudo unattended-upgrades --dry-run
--dry-run is the documented simulation. It downloads and does not install. Securing a server with AI shows this on Ubuntu, and the file above is the Debian one.
Levels’ layout is still the one to end on: SSH over Tailscale, and the public site through a Cloudflare Tunnel, which the Tunnel guide covers for a named tunnel. The VPS guide builds the pair and says what to test before you delete the public SSH rule. Close port 22 only after the new path works, and only with the web console still open.
The host firewall should work the same as on Ubuntu. ufw is in Debian 13 (candidate 0.36.2-9 on 2 November 2026), so follow the rules in the VPS guide. Docker is the exception, because publishing a container port bypasses ufw. Docker’s Debian install page says so, and points at Docker and ufw. The same page says Docker wants iptables-nft or iptables-legacy, and doesn’t support rules you create with nft directly. Put Docker rules on the DOCKER-USER chain.
Install the equivalents
snapd is absent unless you install it. A snap with no Debian package is a service you have to replace, or you keep that one box on Ubuntu.
PPA lines in sources.list won’t resolve on Debian, so delete those files. Debian trixie prefers deb822 (.sources files), and apt modernize-sources converts an old sources.list. Third-party archives can still break the system, as the Debian wiki page on sources warns, so add one only when you know who publishes it.
Docker’s apt repo is per distro. The Ubuntu file points at download.docker.com/linux/ubuntu, and Debian’s at download.docker.com/linux/debian. Copy the Ubuntu file across and you install nothing, or the wrong packages.
Docker’s Debian install lists Debian Trixie 13 and Bookworm 12. Uninstall the distro packages first. It’s fine if apt says none of them are installed.
sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-doc docker-buildx podman-docker containerd runc | cut -f1)
Then the repository, as that page gives it:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
On Debian 13.7 on 2 November 2026, that install produced:
docker-ce 5:29.9.2-1~debian.13~trixie
docker-ce-cli 5:29.9.2-1~debian.13~trixie
containerd.io 2.4.2-3~debian.13~trixie
docker-buildx-plugin 0.38.1-1~debian.13~trixie
docker-compose-plugin 5.7.0-1~debian.13~trixie
On a Droplet, finish with systemctl status docker and docker run hello-world, the two checks Docker’s page asks for. The sample apt list output on Docker’s page still shows a Bookworm build, 5:29.8.2-1~debian.12~bookworm, while apt on trixie installs the trixie builds above. Versions move, so install the current ones, and pin a version only when you have a reason.
For Node, sudo apt install nodejs installs Debian’s package. The candidate that day was 20.19.2+dfsg-1+deb13u3 from security, and 20.19.2+dfsg-1+deb13u2 from trixie main. That’s the 20.x line Node’s own download page marks EOL. For a current LTS, use Node’s download page. The NodeSource steps in How to upgrade Node.js on Ubuntu are for Ubuntu only.
Nginx’s candidate the same day was 1.26.3-3+deb13u10 from trixie-security, and 1.26.3-3+deb13u7 from trixie. sudo apt install nginx follows the candidate.
The kernel is the package that matters for this CVE. Before trixie-security was configured, apt-cache policy linux-image-amd64 offered:
Candidate: 6.12.107-1
That’s the vulnerable version on the tracker. After adding this deb822 file, the candidate changed:
Types: deb
URIs: http://deb.debian.org/debian-security
Suites: trixie-security
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
linux-image-amd64:
Installed: (none)
Candidate: 6.12.115-2
Version table:
6.12.115-2 500
500 http://deb.debian.org/debian-security trixie-security/main amd64 Packages
6.12.115-1 500
500 http://deb.debian.org/debian-security trixie-security/main amd64 Packages
6.12.107-1 500
500 http://deb.debian.org/debian trixie/main amd64 Packages
A DigitalOcean image may already include a security suite, possibly on DigitalOcean’s own mirror, so go by the candidate version. If it’s still 6.12.107-1, the security suite is missing. Install linux-image-amd64 once the candidate is 6.12.115-2 or newer, then reboot, then check uname -r against the tracker.
Move the data
Copy service data, never /. An rsync of / from Ubuntu onto Debian overwrites Debian’s /etc with Ubuntu’s and puts you back in the unsupported conversion.
According to rsync --help (3.5.0+ds1-0+deb13u1), --archive (-a) is -rlptgoD, and that set doesn’t include ACLs, xattrs, or hard links. -H, -A, and -X add those. --numeric-ids keeps the uid and gid numbers instead of translating them by name.
rsync -aHAX --numeric-ids \
[email protected]:/var/www/ /var/www/
Run id deploy on both machines. If the name exists on both and the numbers differ, --numeric-ids preserves the Ubuntu number, and ls -l on Debian shows a number where you expected a name. Then chown to the Debian user, on the paths you copied. A blind chown -R across /var/lib will hand database files to the wrong user.
Restore the dumps on the new box:
psql app < app.sql
mysql app < app.sql
Create the database and the user first, with the passwords from the old .env. PostgreSQL’s data directory is a bad rsync target while the server is running, so prefer the dump.
Docker volumes live under /var/lib/docker/volumes. With the daemon stopped on both sides, you can rsync one volume’s _data directory with rsync -aHAX --numeric-ids. With the daemon up, docker run a temporary container and tar the volume. Compose files come across with the project directory. Recreate the containers on Debian after Docker is installed, rather than reusing anything built on Ubuntu.
Certificates in /etc/letsencrypt can be copied, and the account key with them. Treat that directory like a password. After cutover, run your renewal tool’s dry run from its own docs. Caddy and Traefik renew themselves, but read the log the next morning.
Test before anyone else hits it
Point one machine at the new IP and leave DNS alone.
/etc/hosts on your laptop:
203.0.113.25 app.flaviocopes.com
Or the same trick from a curl —resolve example:
curl --resolve app.flaviocopes.com:443:203.0.113.25 https://app.flaviocopes.com/
Use your own name and address. A temp subdomain with a short TTL, like new.flaviocopes.com, does the same job from a phone. Click the real paths, log in, write a row, and watch journalctl -u for the service you moved. If TLS fails, the usual cause is the certificate name or the Host header, and the old Droplet is still serving the real name, so you can take your time.
Cut over
A reserved IP is the clean switch. Reserved IP pricing is free while it is assigned to a Droplet. An unassigned reserved IPv4 is $5.00 per month ($0.01 per hour), and it is not billed until you accrue $1. Reserved IPv6 is free even when it is unassigned.
A reserved IP moves to another compatible Droplet in the same region, as the doctl guide explains, so keep the new Droplet there. The assign command, from DigitalOcean’s reserved-ip-action reference:
doctl compute reserved-ip-action assign "$RESERVED_IP" "$NEW_ID"
Their example is doctl compute reserved-ip-action assign 203.0.113.25 386734086. The reference doesn’t say how long the move takes, so watch the address until it answers on the new Droplet. DNS doesn’t change at all.
If the name is an ordinary A record, lower the TTL a day or more before the move, wait out the old TTL, then change the record. That DNS section explains why. The old IP keeps answering until caches expire, so leave the old service up through that window. Stop it early and visitors get connection refused while their resolver still has the old address. I hit that on a previous Droplet move, more on that below.
Check it from outside
On the new box:
systemctl --failed
journalctl -u nginx -u docker --since "10 min ago"
sudo unattended-upgrades --dry-run
Use the unit names you run. Confirm the renewal log, and confirm the backup job still has somewhere to write. The snapshot on the old Droplet only rolls back the old disk, so set up the new backup the same day.
From a second machine, not the Droplet:
nmap -Pn -p 22,80,443 203.0.113.25
You want to see the ports you meant to publish, and nothing else. If 22 is still open and Tailscale already works, that’s the leftover to close, using the VPS guide.
Then destroy the old one
Power it off and leave it for a few days, so you can boot it if the new box is wrong. Droplet pricing is explicit: a powered-off Droplet on a bundled plan is still billed, because the resources stay reserved. Billing stops when you destroy it. The snapshot keeps billing at $0.06 per GB per month until you delete that too.
doctl compute droplet-action shutdown "$OLD_ID" --wait
When the new box has lived through a backup, a renewal, and a reboot:
doctl compute droplet delete "$OLD_ID"
delete asks for confirmation. The doctl guide has the same command.
Stay patched
unattended-upgrades covers the archive, but it won’t reboot the machine while Automatic-Reboot stays commented out. After a kernel install, ask needrestart (3.11-1 on Debian 13.7). needrestart -b prints machine-readable lines, and the one to look at is NEEDRESTART-KSTA. The package’s codes are 0 unknown, 1 no upgrade, 2 ABI upgrade, 3 version upgrade. So 1 means the expected kernel is running, and 3 means the running version differs from the one on disk and you need to reboot.
needrestart with no flags walks services one by one, and -r a restarts services without asking. Leave that for a window you chose.
Subscribe to debian-security-announce, as Debian’s security page tells you to. When a linux DSA shows up, run:
apt-cache policy linux-image-amd64
Install, reboot, and check the tracker row again. Like in the CVE post, the kernel package you are booted into is the status that counts.
How I would do this
The last time I moved a service to a new Droplet, I kept the old one answering until DNS caught up, and I destroyed it only after I was sure nothing still pointed at it. That story is the Sendy migration. I would do the same here, on a new Debian 13 Droplet, and I would leave the Ubuntu box powered off for a few days because the old disk is the rollback. I have not converted an Ubuntu disk to Debian, and I would not start with that.
I would stay on Ubuntu in two cases. One is a snap or a PPA package with no Debian build, if that package is the product. The other is Ubuntu Pro, if you are paying for the long support window or Livepatch on a fleet that can wait for Ubuntu’s kernel. This CVE is a good reason to move a box that is exposed and still Vulnerable, and a weak reason to rebuild a private build machine with no public ports. Closing those ports is the other half, in the CVE post and the VPS guide.
On the new Debian Droplet, my first command would be apt-cache policy linux-image-amd64. The candidate should be the security build, 6.12.115-2 or newer as of 2 November 2026. Then I’d subscribe to debian-security-announce, so I hear about the next kernel fix from Debian directly.
Want me to talk about your product? You can sponsor this site.
Related posts about security: