When to reinstall
Reinstalling replaces the operating system and erases the disk contents. It is the quickest fix for a system you no longer trust or understand, and the clean way to change distribution or version. It is not a way to recover data. Anything you want to keep must be copied off the server first.
You can practise on the interactive demo of GLWS Manager before touching a real server. It uses example data and changes nothing.
Back up what you need
List what matters: website files, databases, configuration under /etc, application data, SSH keys, cron jobs and certificates. Copy them to your own computer or another server, and check you can open them. The backup guides cover the tools.
A normal deploy account cannot read all of /etc. Create the configuration archive with sudo, protect it as private data, and copy it off the VPS. This archive contains secrets. Database files copied while a database is running are not a consistent backup: take and verify database dumps separately. Download application volumes with the application-specific stopped-service backup steps.
sudo du -sh /etc /home /var/www /var/lib/mysql /var/lib/docker /opt 2>/dev/null
crontab -l; sudo crontab -l
systemctl list-unit-files --state=enabled | head -n 40sudo install -d -m 700 -o deploy -g deploy /home/deploy/reinstall-backup
sudo tar -czf /home/deploy/reinstall-backup/etc.tar.gz -C / etc
sudo chown deploy:deploy /home/deploy/reinstall-backup/etc.tar.gz
sudo chmod 600 /home/deploy/reinstall-backup/etc.tar.gz
sudo tar -tzf /home/deploy/reinstall-backup/etc.tar.gz | head -n 20umask 077
mkdir -p server-backup
rsync -av --info=progress2 -e ssh deploy@YOUR_SERVER:/home/deploy/reinstall-backup/etc.tar.gz ./server-backup/
tar -tzf ./server-backup/etc.tar.gz | head -n 20Open the reinstall page
The GLWS Manager demo lets you practise choosing an image and reading the destructive-action warning. It contains example data and does not provision or reinstall a VPS. On an actual server, use your provider’s live control panel and its instructions. The images shown depend on the selected plan and panel.
Choose the image and start
Pick a long-term-support release if you want years of security updates. Ubuntu 24.04 LTS, Debian 12 or 13 and AlmaLinux 9 are typical choices for servers. If the panel asks for a root password, use a long random one and store it in a password manager. Confirm the dialog, and the panel begins the reinstall. It usually takes a few minutes, and the activity log shows progress.
In the GLWS Manager demo, progress is simulated. Before confirming a live reinstall, verify that the independent backups and your recovery access work. Keep the new login details private.
Reconnect after the reinstall
A reinstall creates new SSH host keys. Confirm the new fingerprint through your provider’s trusted console before replacing the old known-host entry. At any other time, investigate a changed-host warning before connecting. Use the standard-port or custom-port command below as appropriate; replace every placeholder.
ssh-keygen -R YOUR_SERVER_IP
ssh root@YOUR_SERVER_IPssh-keygen -R "[YOUR_SERVER_IP]:YOUR_SSH_PORT"
ssh -p YOUR_SSH_PORT root@YOUR_SERVER_IPssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pubSecure the fresh system
Do these first, in order: update packages, create a non-root user with sudo, add your SSH key, test a second login, turn on the firewall and disable password login. Each step has its own guide, listed below.
apt update && apt upgrade
adduser deploy
usermod -aG sudo deploydnf upgrade
adduser deploy
passwd deploy
usermod -aG wheel deployRestore your data
Restore configuration and data in small steps and test as you go. Do not copy the whole of /etc back, because it contains system files that differ between versions. Copy only the configuration you need, such as web server sites, application settings and cron jobs, and adapt them to the new release.
rsync -av --info=progress2 -e ssh ./www-backup/ deploy@YOUR_SERVER:/home/deploy/www-restore/Official documentation
These upstream references provide more detail on the commands and workflows in this guide.