This guide walks you through hosting multiple websites on a single VPS using Virtualmin, a web hosting control panel. You’ll learn how to add domains, configure DNS, and manage resources, all from a web interface. By the end, you’ll have a working multi-domain server without needing to rent a separate VPS for each site.
What You’ll Need
- A VPS running a supported Linux distribution (Ubuntu, Debian, CentOS, etc.) with root SSH access.
- A registered domain name (or multiple) and the ability to change its DNS nameservers.
- Virtualmin installed on the VPS. If not installed, follow the official Virtualmin installation script for your OS.
- Basic familiarity with the command line and DNS concepts.
Step-by-Step
- Log into Virtualmin – Open your browser and go to
https://your-server-ip:10000. Use the root user and password (or the user you set during installation) to log in. - Add a new virtual server – In the left sidebar, click Create Virtual Server. This is where you’ll define a new domain.
- Enter domain details – Fill in the Domain name (e.g.,
example.com). Optionally, add a description. For Administration password, either set a new one or leave it to auto-generate. Choose a plan (if you have any) and leave the rest as defaults. - Choose enabled features – Under Features to be enabled, select what you need: Web, DNS, Mail, Database, etc. For a basic website, keep Web and DNS enabled. You can always change these later.
- Create the server – Click Create Server. Virtualmin will set up the directory structure, Apache/Nginx config, DNS zone, and FTP user. Wait for the success message.
- Upload your website files – Use FTP/SFTP to connect to the new virtual server’s home directory (usually
/home/example.com). Place your site’s files in thepublic_htmlfolder. - Point DNS to your VPS – Go to your domain registrar’s control panel and change the nameservers to the ones Virtualmin shows under DNS > Zone (e.g.,
ns1.yourdomain.comandns2.yourdomain.com). If you’re not using Virtualmin’s DNS, create an A record pointingexample.comandwwwto your VPS IP. - Repeat for additional domains – For each new domain, repeat steps 2–7. Virtualmin will keep each site isolated with its own user, directory, and configuration.
- Test your sites – After DNS propagates (can take a few hours), visit each domain in a browser. If you see the default page or your content, it’s working.
- Set up SSL (optional but recommended) – In Virtualmin, go to the virtual server’s Manage SSL Certificate section and use Let’s Encrypt to get a free certificate. This will enable HTTPS for each domain.
Common Mistakes
- Not updating DNS nameservers – Forgetting to change nameservers at the registrar means your domain won’t resolve to your VPS.
- Using the same IP for multiple SSL certificates – With SNI (Server Name Indication), modern browsers handle this fine, but older clients may fail. Virtualmin handles this automatically, but ensure your server supports SNI.
- Overlooking resource limits – Each virtual server consumes memory and CPU. If you host many heavy sites, you may need to upgrade your VPS.
- Misconfiguring the default virtual host – When you add a domain, Virtualmin sets it as the default for the IP. If you have multiple IPs, assign each domain to the correct one to avoid conflicts.
- Forgetting to set up mail records – If you plan to send email from a domain, add SPF and DKIM records (Virtualmin can generate them).
Tips
- Use subdomains for separate projects – Instead of a new domain, you can create a subdomain like
blog.example.comwithin an existing virtual server. - Back up regularly – Virtualmin has a built-in backup module. Schedule backups to a remote location to avoid data loss.
- Keep Virtualmin updated – Use the System Information page to check for updates. Regular updates patch security vulnerabilities.
- Monitor server resources – Install a tool like
htopor use Virtualmin’s System Status to see CPU and memory usage. - Use Virtualmin’s API for automation – If you manage many domains, the API lets you create virtual servers programmatically.
Troubleshooting
- Domain doesn’t resolve – Check that your nameservers are correctly set and that the DNS zone in Virtualmin has the right IP. Use
dig example.comon your local machine to see the current DNS response. - Site shows default page – This usually means the virtual host config isn’t pointing to the right directory. Check the
public_htmlfolder and permissions (should be readable by the web server). - SSL not working – Ensure port 80 is open for Let’s Encrypt validation. If you use a firewall, allow HTTP and HTTPS. Also check that the domain resolves to your server during issuance.
- Email not sending/receiving – Verify that MX records point to your server and that port 25 is not blocked by your VPS provider. Check mail logs at
/var/log/mail.log. - Virtualmin login fails – If you can’t log in, SSH into the server and run
systemctl status virtualminto see if the service is running. Check for disk space issues withdf -h. - One domain causes server to slow down – Identify the culprit using
toporps aux. It might be a runaway script. Consider enabling PHP-FPM per-domain limits under PHP Configuration.
Frequently Asked Questions
Can I host unlimited domains on one VPS?
Technically yes, but each domain consumes resources (memory, CPU, disk). The practical limit depends on your VPS specs and traffic. Start with a few and monitor performance.
Do I need a separate IP for each domain?
No. With name-based virtual hosting, multiple domains can share one IP. Virtualmin configures this automatically. You only need multiple IPs for specific use cases like dedicated SSL on older systems (though SNI makes this rare).
How do I add a domain without using Virtualmin’s DNS?
When creating a virtual server, uncheck DNS under enabled features. Then, manually create an A record at your DNS provider pointing to your VPS IP.
Can I use Virtualmin to host both a website and email for different domains?
Yes, each virtual server can have its own mail setup. Enable Mail during creation, and you’ll get separate mailboxes for each domain.
What if I want to move an existing site to Virtualmin?
Create a new virtual server for the domain, then upload your files and import the database (if any) via phpMyAdmin or the command line. Update DNS after the site is ready.
Is Virtualmin free?
There is a free, open-source version (GPL) with core features. A paid version, Virtualmin Pro, adds advanced features like Cloudmin integration. The free version is sufficient for most multi-domain hosting.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Right Technology Tools for Schools: A Practical Guide
- Your Account Has Been Disabled? Fix It Now7 days
- Name Lookup Scope Problem: A How-To Guide
- Razer Synapse Not Detecting Mouse? Fixes That Work
- Refillable Photo Printers: Match to Your Prints
- Mortal Shell 2 Collapsed Mine Dungeon Walkthrough