For most production Linux servers, use an in-place release upgrade only when the server is clean, backed up, and easy to roll back; use a fresh Ubuntu 22.04 install when the server is old, messy, or too precious to gamble with. Ubuntu 20.04 LTS has moved past standard support, while Ubuntu 22.04 LTS gets standard support until 2027 [source: Ubuntu]. So yes, it is time to move. The real question is how brave you feel today.
TLDR: If your Ubuntu 20.04 server has simple services, like Nginx, PHP, MySQL, and a few cron jobs, try the Ubuntu release upgrade first. If it runs five-year-old custom scripts, mystery PPAs, and “temporary” fixes from 2021, do a fresh installation. Example: for a small web server with 2 vCPUs, 4 GB RAM, and under 20 custom packages, an in-place upgrade may take 30 to 60 minutes. For a critical app server, a fresh install plus migration may take 2 to 4 hours, but it gives you a cleaner machine and fewer weird gremlins.
Release upgrade vs fresh install: the simple version
An Ubuntu release upgrade keeps your server in place. It changes Ubuntu 20.04 into Ubuntu 22.04. Your files stay there. Your users stay there. Your installed packages try to move forward too.
A fresh installation is the clean-room method. You install Ubuntu 22.04 on a new server, disk, VM, or cloud instance. Then you copy apps, data, configs, users, and services across.
Think of it like this:
- Release upgrade: Replace the engine while the car sits in your garage.
- Fresh install: Buy a cleaner car, then move your stuff into it.
The first can be faster. The second is cleaner. Both can ruin your afternoon if you skip backups.
When to choose an Ubuntu release upgrade
Pick an in-place upgrade when your server is boring. Boring is good. Boring pays invoices.
Use this path if:
- The server runs common packages from Ubuntu repositories.
- You have few or no third-party PPAs.
- You can reboot during a maintenance window.
- You have snapshots or full backups.
- You know what services should start after reboot.
- You can test the same upgrade on staging first.
This works well for simple web servers, small databases, VPN boxes, monitoring nodes, and internal tools. It is also handy when you do not want to rebuild firewall rules, users, SSL paths, and service files by hand.
The catch is that old packages can throw tantrums. A tiny config file from 2020 can stop a service in 2026. It drives me crazy that one forgotten PPA can add 20 minutes of package drama to a clean plan.
When to choose a fresh Ubuntu 22.04 installation
Choose a fresh install when the server feels haunted.
Use this path if:
- The server has many PPAs or manually installed
.debfiles. - You inherited it and nobody knows what changed.
- It runs old PHP, Python, Ruby, or Node apps.
- It has custom kernels, storage drivers, or odd network rules.
- You want to move from bare metal to cloud, or from one cloud to another.
- You need a safer rollback plan.
A fresh install is slower at first. But it removes junk. No old libraries hiding in corners. No zombie services. No “why is Apache still installed when we use Nginx?” nonsense.
For serious servers, this is often the calmer choice. Build the new Ubuntu 22.04 box. Test it. Sync data. Switch DNS or load balancer traffic. If something breaks, point users back to the old server. Simple. Not painless, but simple.
Before you upgrade anything, take inventory
Do this before touching the release upgrade button. Future you will smile. Or at least swear less.
lsb_release -a
uname -a
df -h
free -m
ip a
systemctl --failed
systemctl list-units --type=service --state=running
Save installed packages:
dpkg --get-selections > packages-ubuntu-20-04.txt
apt-mark showmanual > manual-packages.txt
Save config files:
sudo tar -czf etc-backup.tar.gz /etc
Check third-party repositories:
ls /etc/apt/sources.list.d/
cat /etc/apt/sources.list
Back up the real treasure:
- Databases, such as MySQL, MariaDB, or PostgreSQL.
- Web files in
/var/www. - App files in
/optor/srv. - SSH keys.
- SSL certificates.
- Cron jobs.
- Firewall rules.
- Docker compose files, if used.
How to upgrade Ubuntu 20.04 to 22.04 in place
First, update Ubuntu 20.04 fully:
sudo apt update
sudo apt upgrade
sudo apt full-upgrade
sudo apt autoremove
Reboot if needed:
sudo reboot
Install the upgrade tool:
sudo apt install update-manager-core
Check this file:
sudo nano /etc/update-manager/release-upgrades
Make sure it says:
Prompt=lts
Start the upgrade:
sudo do-release-upgrade
Follow the prompts. Read them. Yes, actually read them. The tool may ask if you want to keep old config files or install package maintainer versions. If you changed a config file by hand, be careful. When unsure, compare the differences.
After the upgrade, reboot:
sudo reboot
Then check the version:
lsb_release -a
Check services:
systemctl --failed
journalctl -p err -b
Test your app like a user would. Not like an admin who wants to go home.
How to do a fresh Ubuntu 22.04 server install
Start with a new server, VM, or cloud instance. Install Ubuntu 22.04 LTS. Patch it.
sudo apt update
sudo apt upgrade
Create users. Set SSH keys. Lock down SSH. Add a firewall.
sudo adduser deploy
sudo usermod -aG sudo deploy
sudo ufw allow OpenSSH
sudo ufw enable
Install what you need. Not everything from the old box. Only what earns a seat.
Copy configs carefully. Do not blindly dump old /etc over new /etc. That is like pouring yesterday’s soup into fresh coffee.
Move app data with rsync:
rsync -avz /var/www/ deploy@newserver:/var/www/
Dump and restore databases:
mysqldump -u root -p appdb > appdb.sql
mysql -u root -p appdb < appdb.sql
Start services. Test ports. Read logs. Fix file permissions. Then switch traffic.
Which method is safer?
Fresh install is usually safer for critical production servers. It gives you a clear rollback. The old server stays alive while the new one proves itself.
Release upgrade is faster for simple servers. It is also cheaper when you have limited time or limited hosting control.
Here is a quick rule:
- One small app? Release upgrade is fine.
- Many apps on one server? Fresh install is better.
- No staging server? Be careful. Very careful.
- No backup? Stop. Make one. No hero points here.
Common problems after upgrading
Expect a few bumps.
- PHP version changes: Ubuntu 22.04 ships newer PHP packages than 20.04.
- Python changes: Old scripts may hate newer modules.
- MySQL or MariaDB issues: Check upgrade paths before the move.
- Firewall changes: Confirm
ufw,iptables, or cloud rules. - Service failures: Run
systemctl --failedright away. - Config prompts: Package upgrades may overwrite defaults if you say yes too fast.
Honestly, it feels like the smallest forgotten service always waits until 2 minutes after the maintenance window ends. So make a checklist. Then use it.
The best practical plan
If uptime matters, use a fresh install. Build Ubuntu 22.04 beside the old Ubuntu 20.04 server. Test it. Move traffic only when happy.
If the server is small and easy to restore, use do-release-upgrade. Take a snapshot first. Keep console access open. Do not upgrade over a shaky coffee shop connection. That is how villains are born.
The smart move is not the fanciest one. It is the one you can undo at 3 a.m. with tired eyes and cold pizza nearby.
Final pick: use an Ubuntu release upgrade for simple servers with clean package history. Use a fresh Ubuntu 22.04 installation for business-critical servers, messy servers, or anything that makes you say, “I hope this still works.” Hope is not a rollback plan.