{"id":2923,"date":"2018-05-31T07:00:00","date_gmt":"2018-05-31T07:00:00","guid":{"rendered":"https:\/\/blog.ssdnodes.com\/blog\/?p=1999"},"modified":"2025-05-18T12:42:25","modified_gmt":"2025-05-18T12:42:25","slug":"tutorial-installing-webmin","status":"publish","type":"post","link":"https:\/\/www.ssdnodes.com\/blog\/tutorial-installing-webmin\/","title":{"rendered":"How to install Webmin (cPanel alternative) on your server"},"content":{"rendered":"<p><a href=\"http:\/\/webmin.com\/\" target=\"_blank\" rel=\"noopener\">Webmin<\/a> is a lightweight control panel to manage Linux machines with ease. With its web interface, you can create user accounts, set up cron jobs, check disk quotas, and much more. Better yet, installing Webmin is fairly straightforward, and the service is completely free.<\/p>\n<p>All in all, Webmin is handy for Linux\/VPS beginners who are not comfortable with the Linux command line.<\/p>\n<p>In this article, we\u2019ll set up Webmin on Ubuntu 18.04. These instructions should also work on Ubuntu 16.04.<\/p>\n<h2><a id=\"Prerequisites_10\"><\/a>Prerequisites for installing Webmin<\/h2>\n<ul>\n<li>A new Ubuntu 16.04\/18.04 machine with at least 2 GB of RAM.<\/li>\n<li>A valid DNS name pointing its A record to the IP address of your VPS.<\/li>\n<\/ul>\n<div class=\"cta-inline\"><\/div>\n<h2><a id=\"Step_1_Configure_fullyqualified_domain_name_FQDN_of_your_VPS_16\"><\/a>Step 1. Configure fully-qualified domain name (FQDN) of your VPS<\/h2>\n<p>For Webmin to work you need to set up a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fully_qualified_domain_name\" target=\"_blank\" rel=\"noopener\">fully-qualified domain name<\/a> (FQDN). An FQDN is an absolute way of specifying a particular machine on a specific network and includes both a hostname and a domain name. Once you have an FQDN, you can set an A record on its DNS to point toward the IP address of your VPS.<\/p>\n<p>Set the hostname of the system by editing the file <code>\/etc\/hostname<\/code>, replacing <code>YOUR-HOSTNAME<\/code> with your hostname of choice:<\/p>\n<pre><code>$ vi \/etc\/hostname\r\nYOUR-HOSTNAME\r\n<\/code><\/pre>\n<p>Next, edit the file \/etc\/hosts and add the following line at the end: The format is <code>YOUR-IP YOUR-HOSTNAME.YOUR-DOMAIN YOUR-HOSTNAME<\/code>.<\/p>\n<pre><code>$ sudo vi \/etc\/hosts\r\nYOUR-IP YOUR-HOSTNAME.YOUR-DOMAIN YOUR-HOSTNAME\r\n<\/code><\/pre>\n<p>Here\u2019s an example using an IP of <code>123.456.78.9<\/code>, a hostname of <code>webmin<\/code> and a domain of <code>example.com<\/code>.<\/p>\n<pre><code>123.456.78.9 webmin.example.com webmin\r\n<\/code><\/pre>\n<p>Run the command below to restart hostname service and network manager to apply changes:<\/p>\n<pre><code>$ sudo systemctl restart systemd-logind.service\r\n$ sudo systemctl restart NetworkManager.service\r\n<\/code><\/pre>\n<p>Now check the hostname and FQDN of your VPS. They should be updated based on what you just specified.<\/p>\n<pre><code>$ hostname\r\npanel\r\n$ hostname -f\r\npanel.YOURDOMAIN\r\n<\/code><\/pre>\n<h2><a id=\"Step_2_Install_Webmin_57\"><\/a>Step 2. Install Webmin<\/h2>\n<p>The first step towards the installation of Webmin is to add Webmin\u2019s repository information to your source list for easy installation and updating of Webmin and its modules using <code>apt-get<\/code>. Edit <code>\/etc\/apt\/sources.list<\/code> and add the following lines at the end of the file.<\/p>\n<pre><code>$ sudo vi \/etc\/apt\/sources.list\r\n....\r\n....\r\ndeb http:\/\/download.webmin.com\/download\/repository sarge contrib\r\n<\/code><\/pre>\n<p>Add Webmin\u2019s PGP key, so your system trusts the new repository we just added.<\/p>\n<pre><code>$ sudo wget -qO- http:\/\/www.webmin.com\/jcameron-key.asc | sudo apt-key add\r\nOK\r\n<\/code><\/pre>\n<p>Update the system and install Webmin:<\/p>\n<pre><code>$ sudo apt-get update\r\n$ sudo apt-get install webmin\r\n<\/code><\/pre>\n<p>You can now visit the Webmin interface via <code>https:\/\/YOUR-HOSTNAME.YOUR-DOMAIN:10000<\/code>. Webmin warns you about an untrusted certificate\u2014that\u2019s fine, just add it to the exception list and login with the user you use to connect to the server via SSH.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" title=\"The Webmin login page\" src=\"https:\/\/lh3.googleusercontent.com\/V8VGcvvcarxPDpwT-li-jtZxHBn37jF1e0FgyriipJ8M0yf-uHMz5qtC0oTZzLW30l3kamRO-0Jx\" alt=\"The Webmin login page\" \/><\/p>\n<p>On successful login, you are redirected to the Webmin dashboard.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" title=\"The Webmin dashboard\" src=\"https:\/\/lh3.googleusercontent.com\/zi9HVGjZOk-aHaBNW4nYgKUrshV1KFCwKIgVima6Am1JPz1YFpsSKXq883cJiReXh2fCfiiMdRpq\" alt=\"The Webmin dashboard\" \/><\/p>\n<h2><a id=\"Step_3_Install_Lets_Encrypt_91\"><\/a>Step 3. Install Let\u2019s Encrypt<\/h2>\n<p>To keep the connection with your Webmin server encrypted, let\u2019s use a free Let\u2019s Encrypt\u2019s SSL certificate. First, clone the Let\u2019s Encrypt repository in the <code>\/usr\/local<\/code> folder.<\/p>\n<pre><code>$ cd \/usr\/local\r\n$ git clone https:\/\/github.com\/letsencrypt\/letsencrypt\r\n<\/code><\/pre>\n<p>Navigate to <code>Webmin &gt; Webmin Configuration<\/code> in the Webmin dashboard and click on the box with a gear icon on the top-left corner called \u201cModule Config.\u201d Enter the full path <code>(\/usr\/local\/letsencrypt\/letsencrypt-auto)<\/code> of the Let\u2019s Encrypt binary and hit the <em>save<\/em> button.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" title=\"Let's Encrypt Path in Webmin\" src=\"https:\/\/lh3.googleusercontent.com\/EJPpOuxWDIW-eP9sBgU32uiBemXezyzryZhlCBH3b4oIiUTCuPG6NS86JRokmCexMppVWtCMmaAU\" alt=\"Let's Encrypt Path in Webmin\" \/><\/p>\n<p>Go to <code>Webmin &gt; Webmin Configuration &gt; SSL Encryption<\/code> and select the Let\u2019s Encrypt tab. Enter your domain name in <code>hostname for certificates box<\/code>. Choose <code>Other directory<\/code> for <code>Website root directory for validation file<\/code> option and enter <code>\/var\/www\/html<\/code>. You can choose another directory in place of <code>\/var\/www\/html<\/code>, but make sure the Let\u2019s Encrypt ACME challenge can access that directory. Keep the rest of the options in their default state.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" title=\"Webmin fetch Lets Encrypt certificate\" src=\"https:\/\/lh3.googleusercontent.com\/RN5ShERorV-7jndmSoRgIPKFQsarB_uvCPigwtoHKxBbdzx-mQuDZ8tRVgmr2W86Ep9BmhH_jxuA\" alt=\"\" \/><\/p>\n<p>Click <code>Request Certificate<\/code>. On successful fetching of the certificate, you get the following message:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" title=\"Lets Encrypt message\" src=\"https:\/\/lh3.googleusercontent.com\/wW-by5n1xZBdjABakZ8C_ejMkLmhbp-IDiVYYIqK8tbvTLy8I-JczxhjGIxuTsWo_INxYTMLBFRw\" alt=\"enter image description here\" \/><\/p>\n<p>Now that the Webmin is installed and encrypted with SSL, you can start exploring its many features and capabilities. An excellent place to start it upgrading your system\u2019s packages. All packages available for update are listed on the left-hand side under the <code>Package Updates<\/code> section.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Package update through Webmin\" src=\"https:\/\/lh3.googleusercontent.com\/0b2Fk6zqlg7yt3WAJRQGBJ69umZkvIiv0AF8a1w5ChAusDk254FMf9TQ1xLkSOirzhK8C1IQ-Y2r\" alt=\"Package update through Webmin\" width=\"512\" height=\"352\" \/><\/p>\n<p>You\u2019re all set up to get cPanel-like administrative power for free!<\/p>\n<blockquote><p>celebratory gif<\/p><\/blockquote>\n<p>What\u2019s next? It all depends on your needs and applications, but you can go ahead and experiment with creating users\/groups, changing passwords, scheduling cron jobs, creating virtual hosts with Apache, manage firewalls, and more. With Webmin, you can do all this with a GUI rather than typing the commands\u2014a nice bonus for those who don\u2019t want to spend much time on a terminal.<\/p>\n<p>You can also check out Webmin\u2019s <a href=\"http:\/\/doxfer.webmin.com\/Webmin\/Main_Page\" target=\"_blank\" rel=\"noopener\">official wiki<\/a> to explore Webmin\u2019s features even further.<\/p>\n<h2><a id=\"Optional_step_Configure_an_Apache_virtual_host_and_proxy_125\"><\/a>Optional step. Configure an Apache virtual host and proxy<\/h2>\n<p>If you have Apache installed and running on port 80, you can configure Apache to act as a proxy gateway for Webmin. This will allow you to access Webmin via <code>https:\/\/YOUR-HOSTNAME.YOUR-DOMAIN<\/code> instead of <code>https:\/\/YOUR-HOSTNAME.YOUR-DOMAIN:10000<\/code>.<\/p>\n<p>For this, we need to enable three Apache modules: <code>proxy<\/code> and <code>proxy_http<\/code> and <code>ssl<\/code>. Enable these modules one by one by issuing following commands from the terminal and restart apache.<\/p>\n<pre><code>$ sudo a2enmod proxy\r\n$ sudo a2enmod proxy_http\r\n$ sudo a2enmod ssl \r\n$ sudo systemctl restart apache2\r\n<\/code><\/pre>\n<p>Next, create the Apache virtual host for our webmin installation with the following configuration:<\/p>\n<pre><code>$ vi \/etc\/apache2\/sites-available\/webmin.conf \r\n&lt;IfModule mod_ssl.c&gt;\r\n    &lt;VirtualHost *:443&gt;\r\n         ServerName YOUR-HOSTNAME.YOUR-DOMAIN\r\n         ServerAlias YOUR-HOSTNAME.YOUR-DOMAIN\r\n         LogLevel debug\r\n         ErrorLog ${APACHE_LOG_DIR}\/error.log\r\n         CustomLog ${APACHE_LOG_DIR}\/access.log combined\r\n         SSLEngine on\r\n         SSLCertificateFile \/etc\/letsencrypt\/live\/YOUR-HOSTNAME.YOUR-DOMAIN\/cert.pem\r\n         SSLCertificateKeyFile \/etc\/letsencrypt\/live\/YOUR-HOSTNAME.YOUR-DOMAIN\/privkey.pem\r\n         SSLCertificateChainFile \/etc\/letsencrypt\/live\/YOUR-HOSTNAME.YOUR-DOMAIN\/chain.pem\r\n         ProxyRequests On\r\n         ProxyVia On\r\n         SSLProxyEngine On\r\n         ProxyPass \/ https:\/\/YOUR-HOSTNAME.YOUR-DOMAIN:10000\/\r\n         ProxyPassReverse \/ https:\/\/YOUR-HOSTNAME.YOUR-DOMAIN:10000\/         \r\n   &lt;\/VirtualHost&gt;\r\n&lt;\/IfModule&gt;\r\n\r\n  &lt;VirtualHost *:80&gt;\r\n         ServerName YOUR-HOSTNAME.YOUR-DOMAIN\r\n         Redirect permanent \/ https:\/\/YOUR-HOSTNAME.YOUR-DOMAIN\/    \r\n  &lt;\/VirtualHost&gt;\r\n<\/code><\/pre>\n<p>The <code>ProxyPass<\/code> directive allows Apache to pass requests for <code>YOUR-HOSTNAME.YOUR-DOMAIN<\/code> to the Webmin server, which is running in the port 10000, and the ProxyPassReverse directive ensures internal links generated from the Webmin server pass through apache.<\/p>\n<p>Enable the virtual host by creating a symbolic link of the above file inside <code>\/etc\/apache2\/sites-enabled<\/code> directory. You can also activate the site using a2ensite command.<\/p>\n<pre><code>$ cd \/etc\/apache2\/sites-enabled\r\n$ sudo ln -s ..\/sites-available\/webmin.conf .\r\n<\/code><\/pre>\n<p>Test syntax and restart it.<\/p>\n<pre><code>$ sudo apache2ctl -t\r\nOK\r\n$ sudo systemctl restart apache2\r\n<\/code><\/pre>\n<p>Lastly, add the line <code>referer=YOUR-HOSTNAME<\/code> to your <code>\/etc\/webmin\/config<\/code> file.<\/p>\n<pre><code>$ vi \/etc\/webmin\/config \r\n....\r\n....\r\nreferer=YOUR-HOSTNAME.YOUR-DOMAIN\r\n<\/code><\/pre>\n<p>Finally, you can restart Webmin.<\/p>\n<pre><code>$ sudo systemctl restart webmin\r\n<\/code><\/pre>\n<p>At this point, you can access your Webmin server using the Apache proxy by navigating to <code>https:\/\/YOUR-HOSTNAME.YOUR-DOMAIN<\/code> in your browser.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing Webmin is easy for beginners, and gives you a simple interface for installing dozens of popular Linux services. And, unlike cPanel, it&#8217;s completely free!<\/p>\n","protected":false},"author":20,"featured_media":2003,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[18,30],"tags":[246,195],"class_list":["post-2923","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-tutorials","tag-cpanel","tag-webmin"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/2923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/comments?post=2923"}],"version-history":[{"count":3,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/2923\/revisions"}],"predecessor-version":[{"id":12998,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/2923\/revisions\/12998"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media\/2003"}],"wp:attachment":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media?parent=2923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/categories?post=2923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/tags?post=2923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}