Virtualmin is a Webmin module which allows for extensive management of (multiple) virtual private servers. You will be able to manage Apache, Nginx, PHP, DNS, MySQL, PostgreSQL, mailboxes, FTP, SSH, SSL, Subversion/Git repositories and many more.
In this tutorial, we will be installing the GPL (free) edition of Virtualmin on a freshly created VPS (droplet).
Make sure that the domain name points to your server's IP address.
Use the following command to check your current hostname.
hostname -f
And use the following command to change your hostname if necessary.
hostname myserver.example.com
Grab the IP address of your droplet from the DigitalOcean control panel and use SSH to login as root.
ssh root@123.45.67.89
Virtualmin provides an install script which allows for an easy installation. Use the following command to download the script to your root directory.
wget http://software.virtualmin.com/gpl/scripts/install.sh -O /root/virtualmin-install.sh
You should expect to see something like this when it's finished:
2013-07-06 11:03:57 (129 KB/s) - `/root/virtualmin-install.sh' saved [45392/45392]
Now it's time to run the script we just downloaded.<pre>sh /root/virtualmin-install.sh</pre>
This will start the installation wizard. It will start with a short disclaimer, after accepting it the installation will begin.
When the install script has finished installing, you can reach Virtualmin with the following URL:
https://myserver.example.com:
There you can login with your root username and password. Once you are logged in the "Post-Installation Wizard", it will begin to configure your Virtualmin installation.
This wizard is pretty self-explanatory, we'll cover some of the steps with some additional information.
Memory use
Virus scanning
<ul>
<li>Run ClamAV server scanner? This is explained pretty well on the page, if your server receives a lot of e-mails then it's beneficial to enable it.</li>
</ul>
Note: If you are installing Virtualmin on a 512MB VPS and you have just enabled ClamAV server scanner in the step above, then it is very likely that you run accros this error:
A problem occurred testing the ClamAV server scanner : ERROR: Can't connect to clamd: No such file or directory ----------- SCAN SUMMARY ----------- Infected files: 0 Time: 0.000 sec (0 m 0 s)
The reason why you get this error is because your VPS is running out of RAM... you can choose to upgrade your RAM or add swap space to handle the increased memory usage.
For more information about swap space and how to enable it, please follow this tutorial: https://www.digitalocean.com/
Spam filtering
<ul>
<li>
Run SpamAssassin server filter?<br><br>
Again this is explained pretty well on the page, if your server receives a lot of e-mails then it's beneficial to enable it.<br>
</li>
</ul>
Database servers
This step should be pretty clear assuming you know what MySQL or PostgreSQL is. Enable whichever one you need.
If you picked MySQL, the next step will ask you to enter a root password for your MySQL server. The step after that asks what type of configuration MySQL should use.
It's recommended to pick the one that matches your RAM (I believe it selects the right one by default).
DNS zones
If you plan on managing your DNS zones with Virtualmin then enter your primary and secondary nameservers here.
Passwords
Virtualmin gives you two choices on how it should save passwords. It is highly recommended to select "Only store hashed passwords".
This way if any uninvited people get into your server they won't be able to retrieve any personal passwords.
All right, you've completed the post-installation wizard! You might see a big yellow bar on the top of the page with a button that says "Re-check and refresh configuration".
It's recommended to press that button just to make sure everything is well.
If you run into an error during that check, follow the instructions to resolve it and re-check your configuration until all errors are gone.
Here's some information which will help you get around Virtualmin:
Virtual Private Server
A virtual private server (usually) represents a website, typically every website has it's own virtual private server.
Sub-server
A sub-server sounds confusing but it's basically a subdomain.
Virtualmin vs Webmin
As you can see on the top left, you have Virtualmin and Webmin. These are different control panels, Virtualmin is where you manage all the VPS and anything related to that. Webmin is where you manage the server itself.
Documentation
Virtualmin is very well documented, this means that every page has it's own help page and every option's label (the label in front of the input field) is linked to an explanation of that option.
Here's a screenshot explaining the menu structure of Virtualmin.
Now that we've gone through the installation and wizard, we can start setting up our virtual private server(s). Click "Create Virtual Server" in the navigation on the left side.
Enter the domain name you want to setup a server for, in this tutorial we will use: example.com.
Enter an administration password which will become the main password to manage the virtual private server. If you are managing the virtual private server by yourself then you don't really need to know this password. In that case, I suggest using a long generated password for extra security.
Virtualmin allows you to manage server configuration templates and account plans, these can be modified under "System Settings" and then "Server Templates" and "Account Plans".
You can specify an administration username, leaving it on automatic would make "example" the username.
Have a look at the options hidden underneath the other tabs and enable/disable/change anything you'd like to configure your virtual private server.
Now click "Create Server", Virtualmin will execute the steps needed to setup your virtual private server, if any errors occur, it will display them there.
Now that we've setup our virtual private server, it's time to add a subdomain, click on "Create Virtual Server" again.
Notice how different options are now on the top of the page: "Top-level server" (Virtual private server), "Sub-server" (Subdomain), "Alias of example.com" and "Alias of example.com, with own e-mail".
Click on "Sub-server" to create a subdomain of "example.com".
Fill in the full domain name (test.example.com) and go through the options below it, once you are ready click "Create Server".
Watch Virtualmin do what it needs to do and after it's all done, you should see "test.example.com" as the currently selected virtual private server.
First of all, let's make sure we are on the top-level server "example.com" and then click on "Edit Users". On the top, you see you have three options of creating users: "Add a user to this server.", "Batch create users." and "Add a website FTP access user."
If you are only looking to setup a user that has FTP access then click that link, we will go with "Add a user to this server.". The first step is to enter the user's email address, real name and password. Then, carefully look at the other options available to get your ideal setup, when you're done press "Create".
You will now see your user being added to the list, the main user is bold. It also tells you what the user's login is (by default this is something like test.example).
For further setup of e-mail addresses see the "Edit Mail Aliases" link in the menu.
Click the "Edit Databases" link in the menu, remember to set your virtual private server correctly. Depending on your settings, every virtual private server has its own database (or multiple).
Every database has a "Manage..." link which gives you a very simple view of the database and allows you to execute queries. Now go back to the "Edit Databases" page and click "Passwords", here is your database's password which was automatically generated by Virtualmin.
Moving on to the "Import Database" tab you can assign an existing database (a database created outside of Virtualmin) to the current virtual private server, useful for when you created databases using a MySQL client of some form.
Last but not least, the "Remote hosts" tab allows you to provide multiple hosts to connect to your server, it's recommended to leave it as is (localhost) and use an SSH tunnel to login to your database server.
Virtualmin has a very nicely organised directory structure. See the following scheme.
`-- /home/example |-- /home/example/awstats |-- /home/example/cgi-bin |-- /home/example/domains | `-- /home/example/domains/test.example.com | |-- /home/example/domains/test.example.com/awstats | |-- /home/example/domains/test.example.com/cgi-bin | |-- /home/example/domains/test.example.com/homes | |-- /home/example/domains/test.example.com/logs | `-- /home/example/domains/test.example.com/public_html | `-- /home/example/domains/test.example.com/public_html/stats |-- /home/example/etc | `-- /home/example/etc/php5 |-- /home/example/fcgi-bin |-- /home/example/homes | `-- /home/example/homes/test | `-- /home/example/homes/test/Maildir | |-- /home/example/homes/test/ Maildir/cur | |-- /home/example/homes/test/ Maildir/new | `-- /home/example/homes/test/ Maildir/tmp |-- /home/example/logs |-- /home/example/public_html | `-- /home/example/public_html/ stats `-- /home/example/tmp
As you can see, everything is put in /home/example and our subdomain can be found in /home/example/domains/test.
Take some time to go through Virtualmin's settings. There are many things you can change to make your experience better. Don't forget to also explore the Webmin side of this control panel.
This tutorial only touches the surface of Virtualmin and there's a lot more which can be done with it or added to it through modules. There are even modules for setting up svn/git repositories.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Great article. If you have set up Ruby on Rails on your server running VirtualMin GPL, could you also write about it? Could be useful for a lot of people.
@Joseph: Since you’re using the GPL version of Virtualmin, you will have to install RoR manually:
https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm
Great starter. I was struggling with my first droplet and ZPanel. Once reading this, I re-imaged and started with VirtualMin which turns out to be HEAPS better! Thanks.
looks good. But, are there any 3rd party scripts (or plugins) for virtualmin I was thinking about worpdress, ajaxexplorer or joomla, some basic scripts. In zpanel there is vast community with plugins, but with virtualmin it seems that you only have one option - upgrade to pro version which is about 100US$ or something similar.
@gasperzi: I don’t know of any but virtualmin GPL (the free version) seems a bit limited compared to the paid version but overall Virtualmin GPL is much better than zPanel.
Sorry if this is a dumb question, but if I’m using Virtualmin to manage my dns, would I still put in the digitalocean nameservers (ns1.digitalocean, etc.), or would I create my own nameservers based on the primary domain tied to my IP address?
@alexvasquez1: You will need to point your domain’s nameservers to virtualmin (see <a href=“https://www.digitalocean.com/community/articles/how-to-create-vanity-or-branded-nameservers-with-digitalocean-cloud-servers”>https://www.digitalocean.com/community/articles/how-to-create-vanity-or-branded-nameservers-with-digitalocean-cloud-servers</a> for instructions on setting up branded nameservers).
installed but when I go to url:1000 I get webpage not available url resolves by itself ie without :1000
@commerce: The port is 10000 not 1000.
Hi Kamal, same question as alex vazqued… which are my domain’s nameservers? The ones provided by digitalocean or should i creat some branded ones?
@pmartelletti: You will need to set up branded nameservers if you are using virtualmin.
is virtualmin good to start my own hosts company
@yusufgaf1991: You can run a hosting company with or without a control panel. It comes down to how knowledgable you are and the type of customers you are trying to attract with your hosting. If you’re not very knowledgable with linux and are looking to offer low budget shared hosting (hosting under $10) then most likely you’d want to start by purchasing something along the lines of cPanel or Plesk as they’re going to be easier to use for both you and your customers.
Think of it this way, your control panel you choose should be for your customers and to occasionally help you with tasks. If you can’t do everything the panel can from the command line then you shouldn’t be starting a hosting company yet.
Back to Virtualmin! If you decide to use Virtualmin/Usermin to start your hosting company then you also have another option instead of managing the server yourself. Outsourcing your server administration can save you a lot of headaches if you have the money for it. It’s fairly easy to find a server administration company that supports cPanel or Virtualmin/Usermin. You can check WebHostingTalk.com for offers.
Hope that made sense as i’ve been up for 32 hours. LOL! Good luck!
After creating a fresh WordPress Droplet I followed this tutorial and received the following error:
FATAL - Fatal Error Occurred: Something went wrong during installation: 0 FATAL - Cannot continue installation. FATAL - Attempting to remove virtualmin repository configuration, so the installation can be FATAL - re-attempted after any problems have been resolved. FATAL - Removing temporary directory and files. FATAL - If you are unsure of what went wrong, you may wish to review the log FATAL - in /root/virtualmin-install.log
Log doesn’t actually say anything helpful. Anyone have any ideas why this is occurring? Thanks.
@d363f86b: You need to install Virtualmin on a fresh new droplet from a base OS image (not an application image such as wordpress).
Thank you! I’m not a programmer and it works like magic!
My VPS is already setup and running. What if I install Virtualmin now?
@yazirarafath: You’ll probably break your droplet if you install Virtualmin on it.
I really interest With virtualmin. But If i break my droplet With Zpanel installed before. So How about my website on it. I Will lose my website too…
do I install LAMP before or after virtualmin?
Linux is already installed, and Apache MySQL and PHP are included in virtualmin, so there is no need to install LAMP before or after the installation. those services will be automatically installed during the installation.
Hello! Thanks for the article. I did everything in strict accordance with it but Post-Installation Wizard didn’t start. I can enter Webmin (I installed it before) using link https://myserver.example.com:10000/. But I do not have Virtualmin inside. I had no mistakes during installation.
Please tell me what’s the problem? And how to solve it?
Thank you in advance.
@josephcapers: Neither. Virtualmin installs it for you :]
@mk: Do you see the following section? <img src=“https://kmlnsr.me/vFyHQ2oFitlBUWbLHldGuZDKn70Yfezb-Screenshot from 2014-02-13 23%3A02%3A25.png” alt=“screenshot”/>
Thanks. No. But I think that the problem is that I installed first LAMP + Webmin and only after that Virtualmin. That’s the problem. I am installing now Virtualmin to a fresh droplet. And I am sure this will solve the problem. But nehtertheless it would be interesting to learn how to install Virtualmin OVER LAMP + Webmin:).
In the end. I installed the Virtualmin but now I have the following issues: Postfix can support per-domain outgoing IP addresses, but is not currently configured to do so. This can be setup in the Postfix Mailserver module. . Either change the program on the spam and virus scanners page, or disable this feature. … your system is not ready for use by Virtualmin.
How do I solve them?
@Max: We don’t support multiple IPs on a single droplet so you can disable that feature.
Hello , i have almost the same problem , i installed Virtualmin , and i didnt get to post installation… i enterd hostname… and when i enter it in browser … it wont open , i tryed to uninstall and do it again but now i can uninstall it beacuse i can opet install.sh … by running command sh install.sh --uninstal.Any ideas to fix this ?
@sergejv95: Did you install it on an existing droplet or a fresh new one?
On the DNS Zones page, what do we put in the primary and secondary nameserver?
Is it:
Prmary nameserver ns1.digitalocean.com
Secondary name servers (optional) ns2.digitalocean.com ns3.digitalocean.com
Cheers
@stuartjones93: Depends on whether you want to use DNS yourself or use DigitalOcean’s DNS manager. If the case is the former, you should set it to your nameservers (check out <a href=“https://www.digitalocean.com/community/articles/how-to-create-vanity-or-branded-nameservers-with-digitalocean-cloud-servers”>https://www.digitalocean.com/community/articles/how-to-create-vanity-or-branded-nameservers-with-digitalocean-cloud-servers</a>). Otherwise, you can just ignore them and it would work.