Back to Article List

How to reinstall Webmin or remove it completely

How to reinstall Webmin or remove it completely - How to reinstall Webmin or remove it completely

Updated and tested 19 October 2026

Most people who go looking to reinstall Webmin don't need to. What they have is an install that runs perfectly well and carries a configuration they want gone: a port change they can't undo from the browser, or a pile of module settings inherited from whoever built the server. Some installs really are broken, half-removed or refusing to start, and those do need the package replaced. Both jobs are covered below, and the config-only reset sits lower down the page, so skip the removal sections if that's the one you came for.

Most write-ups on this are a single apt purge line. A purge on its own leaves the repository files sitting on disk where the next install will find them, and it backs nothing up for you first. Every command on this page runs as root; from a sudo account, put sudo in front of each one.

Back up Webmin's configuration in /etc/webmin first

/etc/webmin is the entire state of your installation. It holds miniserv.conf for the web server, miniserv.users for the accounts, config for core settings and one subdirectory per module for everything you configured through Webmin. A tar of that directory is the whole backup.

systemctl stop webmin
tar czf /root/webmin-config-backup.tar.gz /etc/webmin

tar czf of /etc/webmin prints tar: Removing leading / from member names

The only output of the backup is tar's harmless note about the leading slash.

tar prints tar: Removing leading `/' from member names, which is harmless: it stores the paths as etc/webmin/..., and that's why the restore command lower down uses that form. Stopping the service first means nothing rewrites a file while tar is reading it. Copy the archive somewhere off the machine afterwards, since a backup sitting on the server you're about to rebuild isn't much of a backup.

Save your best work

Send your backups to a storage VPS with room for years of archives, unmetered bandwidth and a cost per gigabyte that stays low.

Try an upgrade before a reinstall

When Webmin is misbehaving and not missing, an upgrade is the better first move. It replaces the program code, keeps /etc/webmin untouched and fixes anything that was a bug in the release you happen to be on.

Webmin ships roughly monthly, so the gap between your build and current is often wider than you'd guess. This guide was tested on 2.670, where the upgrade command below answers webmin is already the newest version (2.670). on a current box.

apt-get update
apt-get install --only-upgrade webmin

apt-get install --only-upgrade webmin: webmin is already the newest version (2.670)

On a current box the upgrade has nothing to do.

On the RHEL family that's dnf upgrade webmin. If you can't yet name the symptom, the error strings collected in the notes on common Webmin errors will usually identify it faster than a rebuild will. If the symptom survives the upgrade, a reinstall is a reasonable next step.

If Virtualmin is installed, do not purge Webmin

Virtualmin is a module suite built on top of Webmin. Same team, same :10000 address, appearing as a tab inside the Webmin you're about to remove. Purging the webmin package pulls the platform out from under it and takes Virtualmin's interface with it, and you'll be rebuilding a hosting panel instead of fixing a login problem. Don't do it.

On a Virtualmin server, work from the Virtualmin download and install documentation and leave the package manager alone. Their installer knows what the stack is meant to look like. Virtualmin 8 landed in late January 2026 after more than three years on the 7.x line and was a substantial refactor, so an old install may be better served by an upgrade path than by any kind of removal.

Remove Webmin

Debian and Ubuntu

apt-get autoremove --purge webmin

That takes out the package, the dependencies nothing else needs and the configuration files apt considers its own. The command is the same to remove Webmin on Ubuntu and to uninstall Webmin on Debian. Then look at what's left:

ls -la /etc/webmin /usr/share/webmin

After the purge, ls reports No such file or directory for /etc/webmin and /usr/share/webmin

On Ubuntu 24.04 with 2.670 the purge removes both directories.

On Ubuntu 24.04 with Webmin 2.670 the purge removes both directories, and ls answers No such file or directory for each. Older installs can leave /etc/webmin behind, holding files generated after installation that the package never claimed. People argue about deleting it by hand against leaving it for the next install to overwrite. Both end up in the same place and I don't think it matters much, as long as your backup is confirmed safe somewhere else first. The repository files are a separate matter and the purge doesn't touch any of them.

AlmaLinux, Rocky and other RHEL rebuilds

dnf remove webmin

RPM leaves .rpmsave copies of configuration files it noticed you had modified, so check /etc/webmin and the program directory at /usr/libexec/webmin the same way. That suffix has been in RPM since long before Webmin existed, and it turns up all over a server that's been through a few years of upgrades. Anything left over is yours to delete.

Clear the leftover repository files

This is the step people skip and it's the reason the next install behaves strangely. The setup script writes files that no package owns, so removal leaves every one of them in place.

Debian and Ubuntu

Two artefacts after a normal run: the sources file and the keyring. A third, an APT pin under /etc/apt/preferences.d/, exists only if the script was run with --pkg-prefs; the rm -f line for it is harmless when it isn't there.

rm -f /etc/apt/sources.list.d/webmin-stable.list
rm -f /usr/share/keyrings/ubuntu-webmin-developers.gpg
rm -f /etc/apt/preferences.d/ubuntu-stable-package-priority
apt-get update

After the purge the Webmin keyring and webmin-stable.list are still on disk; no Webmin pin file

The purge leaves the keyring and the sources file behind, and there is no Webmin pin file.

On Debian, swap ubuntu for debian in the last two filenames, since the script names them after the distribution ID. If you ever ran the script in prerelease or unstable mode there will be a webmin-prerelease.list or webmin-unstable.list alongside the stable one, and those are the files most likely to be forgotten.

The prerelease list matters more than it looks. Switching back with --stable doesn't delete it, so apt keeps rc.download.webmin.dev as a source next to the stable one and installs release candidates on a box you thought you had moved back. Clearing all of it and running apt-get update gives the next install a clean index to work from.

AlmaLinux, Rocky and SUSE

Two files, and on SUSE the repo one lives under /etc/zypp/repos.d/.

rm -f /etc/yum.repos.d/webmin-stable.repo
rm -f /etc/pki/rpm-gpg/RPM-GPG-KEY-webmin-developers
dnf clean all

Reinstall Webmin from the official repository

The install Webmin on Ubuntu 24.04 walkthrough uses the same setup-repo script and package manager pair, and it works identically on a rebuild.

curl -o webmin-setup-repo.sh https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh
sh webmin-setup-repo.sh

As root that works and asks Setup Webmin stable repository? (y/N); from a sudo account it must be sudo sh webmin-setup-repo.sh, or it stops with must be run as root!. Then apt-get install webmin --install-recommends on the Debian family or dnf install webmin on the RHEL family. The script defaults to the stable repository, which is what you want for a server anybody depends on. --prerelease and --unstable exist for testing a specific fix and should not be how you rebuild production.

The APT repository is one flat suite of architecture-independent packages. There's no codename to match and nothing to configure per release.

Without the repository, grab the package from the Webmin download page and install it locally with apt-get install --install-recommends ./webmin-current.deb or dnf install ./webmin-current.rpm. That gets you a working install with no automatic updates. Fine on an air-gapped box, and a bad trade anywhere else.

Give your websites a server of their own

Launch a virtual server as simple as shared hosting, with guaranteed resources and stronger security.
Billing Cycle

Personal Web Hosting

$6.99 Save  14 %
$5.99 Monthly
  • Perfect for personal sites, blogs, and portfolios, giving you a fast and reliable way to get online without complexity.
  • 40 GB NVMe storage
  • 2 GB RAM memory
  • 2 vCPU AMD EPYC
  • ✔ IPv4 & IPv6 included IPv6 support is currently unavailable in France or the Netherlands.
  • ✔Unmetered 1 Gbps network
  • ✔Free automatic backup
  • ✔Firewall management
  • ✔Free server monitoring
  • ✔KVM isolation

Business Web Hosting

$23.99 Save  21 %
$18.99 Monthly
  • Ideal for established sites and busy teams, with the power to support multiple projects and steady growth.
  • 250 GB NVMe storage
  • 8 GB RAM memory
  • 4 vCPU AMD EPYC
  • ✔ IPv4 & IPv6 included IPv6 support is currently unavailable in France or the Netherlands.
  • ✔Unmetered 1 Gbps network
  • ✔Free automatic backup
  • ✔Firewall management
  • ✔Free server monitoring
  • ✔KVM isolation

Agency Web Hosting

$44.99 Save  22 %
$34.99 Monthly
  • Designed for very high-demand users, offering the capacity to easily manage many clients and heavy workloads.
  • 600 GB NVMe storage
  • 16 GB RAM memory
  • 4 vCPU AMD EPYC
  • ✔ IPv4 & IPv6 included IPv6 support is currently unavailable in France or the Netherlands.
  • ✔Unmetered 1 Gbps network
  • ✔Free automatic backup
  • ✔Firewall management
  • ✔Free server monitoring
  • ✔KVM isolation

Reset the configuration without a full reinstall

For most people searching for a Webmin reinstall, this is the real goal. You want the Webmin configuration reset to defaults, without replacing a package that's working fine.

systemctl stop webmin
mv /etc/webmin /root/webmin-old
apt-get install --reinstall webmin

Stop the service before you move that directory, so nothing is writing into it while it goes. Moving the directory rather than deleting it leaves you a copy to pull an account or a module setting out of later. You come back up on port 10000 with a self-signed certificate and a single account, which is the default state described in the complete Webmin guide. On 2.670 the reinstall rebuilt /etc/webmin completely (135 entries, against 137 in the old one), with a new certificate and a working login. If yours comes back incomplete, fall back to the purge sequence above and install fresh.

After moving /etc/webmin away and reinstalling, ls /etc/webmin lists module folders and counts 135 entries

The reinstall rebuilt /etc/webmin from scratch: 135 entries.

Restore your old settings selectively

Do not untar the backup over the new /etc/webmin wholesale. Restoring an old miniserv.conf brings back the port, ssl, bind, allow and deny values along with certfile and keyfile paths that may now point at files you deleted, which is frequently the exact state you were trying to escape. List the archive first:

tar tzf /root/webmin-config-backup.tar.gz | less

Then extract single paths into a scratch directory and copy across only what you want:

tar xzf /root/webmin-config-backup.tar.gz -C /tmp etc/webmin/miniserv.users

Two things usually come back. miniserv.users, if you had built up extra Webmin accounts beyond the one the install creates, and the per-module directories under /etc/webmin/ for anything you had configured in depth, a mail server or a DNS zone setup being the obvious candidates. Webmin's FAQ tells you to run /etc/webmin/restart after editing miniserv.conf outside the panel, and a restored file counts as an edit as far as the daemon is concerned, so anything you drop in by hand needs a restart behind it.

Put the port, SSL and IP restrictions back

A rebuilt install accepts connections from anywhere its firewall allows, so the last job is reapplying what you had in front of it. Webmin security hardening has the full set, certificate included. Check where the rebuild left you:

webmin list-config --option port
webmin list-config --option ssl

Source restrictions go under Webmin Configuration on the IP Access Control page, where the documentation says to "Select Only allow from listed addresses and enter a list of hostnames, IP addresses and networks into the adjacent text box". A single office range such as 192.168.1.0/24 or a static address like 203.0.113.42 removes most of the noise a public IP attracts.

If this is your second or third rebuild in a month, Webmin might not be what's broken, and the rundown of Webmin alternatives puts the realistic options side by side. Webmin is stable software and repeated breakage usually points at something underneath it, a distribution upgrade it never caught up with or a stack it was never a good fit for. For some of those jobs the answer is a different tool and not a cleaner copy of this one.

Questions?

Does removing Webmin also remove Usermin?

No, Usermin is a separate package, so removing Webmin leaves it installed and still listening on port 20000. The repository script installs both, and each has its own removal command: sudo apt-get autoremove --purge usermin on Debian and Ubuntu or sudo dnf remove usermin on the RHEL family.

About the author

William Ramsay

I've earned my living from technical writing for more than 20 years. There were a few other jobs before that: university IT, a spell doing Unix administration, some training/paid work. Over these years, writing became the part people kept asking me to do, so I stopped pretending it was secondary.

Most of my career has been in infrastructure. The names have changed. We had dedicated servers, then virtual servers, then cloud instances; now there are another dozen ways to rent somebody else's computer. But the underlying problems don't change nearly as quickly. I'm in Glasgow, where I've lived for most of my life. I keep paper notebooks, walk in the hills when my knees agree to it and repair old hand tools. I've never been particularly interested in gadgets for their own sake. I like knowing how things work and being able to fix them.

Move your sites to a server with room to grow

Pick cPanel, Plesk or ispmanager at checkout and manage every site from the panel you know, with full root access when you need it. Support is available 24/7.