You are on page 1of 9

More about SSD Nodes—simple, high-value VPS cloud computing to help you build amazing experiences on the web.

Serverwise:
the SSD Nodes blog

Tutorials | May 31, 2018 | 9 min read

How to install Webmin (cPanel alternative) on


your server
Written by Dwijadas Dey

Webmin 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.

All in all, Webmin is handy for Linux/VPS beginners who are not comfortable with the Linux command line.

In this article, we’ll set up Webmin on Ubuntu 18.04. These instructions should also work on Ubuntu 16.04.

Now in LA!
Get THE BEST DEALS IN CLOUD HOSTING from Los Angeles!

Grab a huge 32GB RAM & 320GB of SSD storage for just $109/year!

Prerequisites for installing Webmin


A new Ubuntu 16.04/18.04 machine with at least 2 GB of RAM.
A valid DNS name pointing its A record to the IP address of your VPS.
What’s the BEST DEAL in cloud hosting?
Develop at hyperspeed with a Performance VPS from SSD Nodes. We DOUBLED the amount of blazing-fast NVMe storage on
our most popular plan and beefed up the CPU offering on these plans. There’s nothing else like it on the market, at least not at
these prices.

Score a 24GB Performance VPS with 240GB of NVMe storage for just $99/year for a limited time!

Get limited-time deals!⚡

Step 1. Configure fully-qualified domain name (FQDN) of your


VPS
For Webmin to work you need to set up a fully-qualified domain name (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.

Set the hostname of the system by editing the file /etc/hostname , replacing YOUR-HOSTNAME with your hostname of choice:

$ vi /etc/hostname
YOUR-HOSTNAME

Next, edit the file /etc/hosts and add the following line at the end: The format is YOUR-IP YOUR-HOSTNAME.YOUR-DOMAIN YOUR-HOSTNAME
.

$ sudo vi /etc/hosts
YOUR-IP YOUR-HOSTNAME.YOUR-DOMAIN YOUR-HOSTNAME

Here’s an example using an IP of 123.456.78.9 , a hostname of webmin and a domain of example.com .

123.456.78.9 webmin.example.com webmin

Run the command below to restart hostname service and network manager to apply changes:

$ sudo systemctl restart systemd-logind.service


$ sudo systemctl restart NetworkManager.service

Now check the hostname and FQDN of your VPS. They should be updated based on what you just specified.

$ hostname
panel
$ hostname -f
panel.YOURDOMAIN

Step 2. Install Webmin


The first step towards the installation of Webmin is to add Webmin’s repository information to your source list for easy
installation and updating of Webmin and its modules using apt-get . Edit /etc/apt/sources.list and add the following lines at
the end of the file.

$ sudo vi /etc/apt/sources.list
....
....
deb http://download.webmin.com/download/repository sarge contrib

Add Webmin’s PGP key, so your system trusts the new repository we just added.

$ sudo wget -qO- http://www.webmin.com/jcameron-key.asc | sudo apt-key add


OK

Update the system and install Webmin:

$ sudo apt-get update


$ sudo apt-get install webmin

You can now visit the Webmin interface via https://YOUR-HOSTNAME.YOUR-DOMAIN:10000 . Webmin warns you about an untrusted
certificate—that’s fine, just add it to the exception list and login with the user you use to connect to the server via SSH.

On successful login, you are redirected to the Webmin dashboard.

Step 3. Install Let’s Encrypt


To keep the connection with your Webmin server encrypted, let’s use a free Let’s Encrypt’s SSL certificate. First, clone the Let’s
Encrypt repository in the /usr/local folder.

$ cd /usr/local
$ git clone https://github.com/letsencrypt/letsencrypt
Navigate to Webmin > Webmin Configuration in the Webmin dashboard and click on the box with a gear icon on the top-left corner
called “Module Config.” Enter the full path (/usr/local/letsencrypt/letsencrypt-auto) of the Let’s Encrypt binary and hit the save
button.

Go to Webmin > Webmin Configuration > SSL Encryption and select the Let’s Encrypt tab. Enter your domain name in
hostname for certificates box . Choose Other directory for Website root directory for validation file option and enter
/var/www/html . You can choose another directory in place of /var/www/html , but make sure the Let’s Encrypt ACME challenge
can access that directory. Keep the rest of the options in their default state.

Click Request Certificate . On successful fetching of the certificate, you get the following message:

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’s packages. All packages available for update are listed on the left-hand side
under the Package Updates section.

You’re all set up to get cPanel-like administrative power for free!


celebratory gif

What’s 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—a nice bonus for those who don’t want to spend much time on a
terminal.

You can also check out Webmin’s official wiki to explore Webmin’s features even further.

Optional step. Configure an Apache virtual host and proxy


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 https://YOUR-HOSTNAME.YOUR-DOMAIN instead of https://YOUR-HOSTNAME.YOUR-DOMAIN:10000 .

For this, we need to enable three Apache modules: proxy and proxy_http and ssl . Enable these modules one by one by
issuing following commands from the terminal and restart apache.

$ sudo a2enmod proxy


$ sudo a2enmod proxy_http
$ sudo a2enmod ssl
$ sudo systemctl restart apache2

Next, create the Apache virtual host for our webmin installation with the following configuration:

$ vi /etc/apache2/sites-available/webmin.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName YOUR-HOSTNAME.YOUR-DOMAIN
ServerAlias YOUR-HOSTNAME.YOUR-DOMAIN
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/YOUR-HOSTNAME.YOUR-DOMAIN/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/YOUR-HOSTNAME.YOUR-DOMAIN/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/YOUR-HOSTNAME.YOUR-DOMAIN/chain.pem
ProxyRequests On
ProxyVia On
SSLProxyEngine On
ProxyPass / https://YOUR-HOSTNAME.YOUR-DOMAIN:10000/
ProxyPassReverse / https://YOUR-HOSTNAME.YOUR-DOMAIN:10000/
</VirtualHost>
</IfModule>

<VirtualHost *:80>
ServerName YOUR-HOSTNAME.YOUR-DOMAIN
Redirect permanent / https://YOUR-HOSTNAME.YOUR-DOMAIN/
</VirtualHost>

The ProxyPass directive allows Apache to pass requests for YOUR-HOSTNAME.YOUR-DOMAIN 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.

Enable the virtual host by creating a symbolic link of the above file inside /etc/apache2/sites-enabled directory. You can also
activate the site using a2ensite command.
$ cd /etc/apache2/sites-enabled
$ sudo ln -s ../sites-available/webmin.conf .

Test syntax and restart it.

$ sudo apache2ctl -t
OK
$ sudo systemctl restart apache2

Lastly, add the line referer=YOUR-HOSTNAME to your /etc/webmin/config file.

$ vi /etc/webmin/config
....
....
referer=YOUR-HOSTNAME.YOUR-DOMAIN

Finally, you can restart Webmin.

$ sudo systemctl restart webmin

At this point, you can access your Webmin server using the Apache proxy by navigating to https://YOUR-HOSTNAME.YOUR-DOMAIN in
your browser.
Share this post:

 Reddit  Hacker News  Facebook  Twitter  Flipboard

Like what you saw? Subscribe to our weekly newsletter.

Enter your email Subscribe

A note about tutorials: We encourage our users to try out tutorials, but they
aren't fully supported by our team—we can't always provide support when
things go wrong. Be sure to check which OS and version it was tested with
before you proceed.

If you want a fully managed experience, with dedicated support for any
application you might want to run, contact us for more information.

Tags: cpanel webmin

You might also like:


How to install VestaCP (cPanel alternative) How to install Ajenti (cPanel alternative) in
on your server Ubuntu 16.04

How to install Slack alternative Rocket.Chat The 7 best FREE cPanel alternatives (2020
on your server edition)

Get VPS wisdom in your inbox every Friday. No


Enter your email Subscribe
funny business. Just stuff that makes you
smarter.

Features Tutorials

Pricing VPS Uses

Company Updates Use Cases: Developers

Self-Hosting Development

Comparisons SaaS Alternatives

Blog Strasmore, Inc.


2522 Chambers Road Suite 100
About Us
Tustin, CA 92780

Terms of Service
Contact us

Legal
Strasmore
DMCA

 Twitter  Facebook

© 2011-2020 Strasmore, Inc. All rights reserved. Strasmore and SSD Nodes are registered trademarks of Strasmore, Inc.

You might also like