This guide shows you how to install Virtualmin on a Linux VPS and create your first virtual server, complete with a domain, web root and database. You will run the official install script, finish the post-install wizard in your browser, then add a domain that Virtualmin manages for you end to end.
Virtualmin runs on top of Webmin and manages Apache or Nginx, BIND, Postfix and MariaDB for you. Once the wizard is done, adding a site is a form with a domain name and a password.
Before you start
- A Linux VPS with a clean Ubuntu 22.04/24.04 or Debian 12 install. The install script expects a fresh OS. If you have already installed another panel or a web stack, reinstall the OS from your VPS provider's control panel first and start again.
- Root SSH access. Your IP, username and password are in your VPS provider's control panel, together with power controls, OS reinstall and a browser console.
- A domain you control, for example
example.com, with an A record pointing at your server IP (203.0.113.10). Virtualmin works best when DNS is already correct. - A fully qualified hostname such as
vps1.example.com, and the same name in DNS. - Ports 80, 443 and 10000 reachable. Most providers do not block these by default, but if you enabled
ufworfirewalldyourself, open them.
Warning: The install script changes system packages and services, including the web server, mail server and DNS server. Run it on a fresh VPS, not on a box that already serves live sites. If you have anything to keep, back it up first.
Set the hostname before installing Virtualmin
Virtualmin identifies the server by its FQDN, and its configuration check fails if the hostname does not resolve. Set it now.
hostnamectl set-hostname vps1.example.comAdd the hostname to /etc/hosts so it resolves locally even before DNS propagates:
printf '203.0.113.10 vps1.example.com vps1\n' >> /etc/hosts
hostname -fThe last command should print vps1.example.com with no error. Then update the base system:
apt update && apt upgrade -yIf your VPS provider created an account named ubuntu or deploy, run everything below with sudo or as root.
Install Virtualmin with the official install script
Download the script from the vendor and run it. It detects your OS, adds the Virtualmin repository, installs Webmin, Usermin and the web, mail and DNS stack, and points you at the login URL when it finishes.
cd /root
wget https://software.virtualmin.com/gpl/scripts/virtualmin-install.sh
chmod +x virtualmin-install.sh
sudo sh virtualmin-install.shExpect the install to take several minutes; it pulls a full stack of packages. When it ends, the output should report success and show a URL in the form https://203.0.113.10:10000.
Tip: The script supports choosing a bundle instead of the default stack, for example Nginx rather than Apache. Check the current options and supported operating systems in the Virtualmin documentation before you run it, because flags change between releases.
Finish the post-install wizard
Open https://203.0.113.10:10000 in your browser and log in as root with your server root password.
- Accept the certificate warning. Webmin uses a self-signed certificate until you replace it, so the browser warning is expected.
- The wizard opens after login. Work through the pages it shows: it asks for the MariaDB root password, an administrator email address, and whether to enable mail filtering and virus scanning.
- Enter a strong MariaDB root password and save it in your password manager. Virtualmin manages that database server for you, so store the credentials somewhere you can find them.
- Decide on ClamAV and SpamAssassin. Both consume memory. On a small VPS with no mail hosting needs, leave them disabled; you can turn them on later.
- Set the DNS zone defaults and, if you are hosting DNS yourself, the nameservers you will use.
- Click Finish and wait for Virtualmin to apply the settings. The dashboard then loads with your server's status summary.
Create your first virtual server
A virtual server in Virtualmin is one domain with its own web root, mail, DNS zone and database. Creating one takes a single form.
- Go to Create Virtual Server in the left menu.
- In Domain name, enter
example.com. Addwww.example.comlater as a server alias if you need it. - Leave Description empty or type a short label.
- Set the Administration password. This becomes the domain owner's password for Usermin and SFTP. Use a strong one.
- Under Enabled features, tick what you need: Apache website, DNS domain, Mail for domain, MariaDB database. Turn off what you do not need to keep the server lean.
- Leave the IP address, interface and plan at their defaults, then click Create Server.
Virtualmin creates the virtual server and shows a summary. The web root is /home/example.com/public_html, and the panel creates a matching system user for file access. The exact username is listed on the server's summary page — use it for SFTP rather than guessing.
To upload files, connect over SFTP with that username and place your content in public_html. Then enable HTTPS for the domain from Server Configuration > SSL Certificate > Let's Encrypt, after DNS resolves to your server.
Note: If you changed the SSH port or use key-only login, none of that affects panel access. Virtualmin listens on port 10000 independently of your SSH settings.
Check it works
- In Virtualmin, select
example.comand open Summary. Website, DNS and mail status should all show as enabled. - Run System Settings > Re-check Configuration. Fix anything it reports as a fatal problem; warnings about unused features can be ignored.
- From your own machine, confirm DNS and the web server:
dig +short example.com
curl -I http://example.comYou should see 203.0.113.10 from dig and an HTTP 200 response from curl. The default page Virtualmin places in the web root is what you are seeing at this stage.
- Open
https://example.comafter enabling Let's Encrypt and check the certificate is valid.
Troubleshooting
- Browser warns that the connection to port 10000 is not private — Webmin is using its self-signed certificate. This is expected on a fresh install. Accept the exception, or replace the certificate from Webmin's configuration later.
- The install script stops with an unsupported OS message — the script only supports current versions of common distributions. Reinstall your VPS with Ubuntu 22.04/24.04 or Debian 12 from your VPS provider's control panel and run it again on the clean system.
- The wizard reports the hostname does not resolve — your FQDN is missing from
/etc/hostsor from DNS. Fix both, runhostname -fto confirm, then re-run Re-check Configuration. - The domain shows a generic page or 404 — DNS still points elsewhere, or Apache is serving the wrong virtual host. Check
dig +short example.comreturns your server IP, and confirm the virtual server exists in the Virtualmin list. - Port 10000 is unreachable — a local firewall is blocking it. Run
ufw allow 10000/tcp(and allow 80 and 443 while you are there), then try again withhttps://, nothttp://. - The install fails partway through on a small VPS — the mail filtering packages are memory hungry. Re-run the install, and in the wizard disable ClamAV and SpamAssassin.
Next steps
- First steps after your Linux VPS is ready to lock down SSH, updates and the firewall before you host real traffic.
- Set up Apache virtual hosts for multiple websites if you want to understand what Virtualmin writes into the Apache config.
- Install PostgreSQL and create your first database when a project needs PostgreSQL instead of MariaDB.
- Linux command line basics for your first VPS to get comfortable with the shell before you debug a live site.
Questions about the install? Open a ticket at /tickets/new and include the script output.
