---
title: "How to Install Webmin on Ubuntu Linux"
description: "Learn how to install Webmin to help with system administration on your Ubuntu Linux without manually editing Unix configuration files in this step-by-step tutorial!"
canonical: "https://adamtheautomator.com/install-webmin/"
---

# How to Install Webmin on Ubuntu Linux

> Learn how to install Webmin to help with system administration on your Ubuntu Linux without manually editing Unix configuration files in this step-by-step tutorial!

Source: https://adamtheautomator.com/install-webmin/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Install Webmin on Ubuntu Linux](https://adamtheautomator.com/wp-content/uploads/2022/03/How-to-Install-Webmin-on-Ubuntu-Linux.jpg)

# How to Install Webmin on Ubuntu Linux

[![](https://secure.gravatar.com/avatar/572a248f516b6d0cd566cb44fdbd9336f30ef95aa0f6d78f118c1f47b1b6d6b7?s=192&d=mm&r=g)Arvid Larson](https://adamtheautomator.com/author/arvid-larson/)18 March 202210 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Linux](/tag/linux/)[Monitoring](/tag/monitoring/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Adding Webmin GPG Key and Repository](#adding-webmin-gpg-key-and-repository)
*   [Securing Webmin with SSL Certificates](#securing-webmin-with-ssl-certificates)
*   [Managing Users in Webmin](#managing-users-in-webmin)
*   [Setting up Package Updates](#setting-up-package-updates)
*   [Creating a New Virtual Host](#creating-a-new-virtual-host)
*   [Installing MySQL Server for Database Backend](#installing-mysql-server-for-database-backend)
*   [Installing PHP to Support PHP-Based Web Applications](#installing-php-to-support-php-based-web-applications)
*   [Verifying Apache2 Web Server and PHP](#verifying-apache2-web-server-and-php)
*   [Conclusion](#conclusion)

# How to Install Webmin on Ubuntu Linux

Need a lightweight GUI application for Linux server management? You may have heard of Webmin’s web-based interface for managing Linux servers. But how do you install Webmin to manage and administer Linux servers?

Webmin provides modules to simplify Linux server administration. And in this tutorial, you’ll learn to install Webmin and set up [LAMP Stack](https://www.liquidweb.com/kb/what-is-a-lamp-stack/) on an Ubuntu server through the Webmin dashboard.

Read on and ease up your daily tasks with Webmin!

## Prerequisites

This tutorial houses step-by-step demos. To follow along, ensure you have the following requirements:

*   A Linux server – This tutorial uses the latest version of the [Ubuntu 20.04](https://adamtheautomator.com/install-ubuntu/) server.

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

*   A root user or a user with admin privileges.
*   A domain name pointed to your server IP address. This tutorial uses the domain _webmin.example.io_ and _example.io_.

## Adding Webmin GPG Key and Repository

Webmin is a web-based application for simply Linux server management through the web browser. Webmin allows you to administer Linux management tasks, such as managing users, managing packages updates, and monitoring basic services.

Webmin provides its official repository to install, and you’ll be adding the Webmin GPG key and repository to your system.

1\. Open your terminal and log in to your server.

2\. Next, run the below command to add the GPG key (`apt-key add`) for Webmin on your system.

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

Related:[How to Download Files with Python Wget](https://adamtheautomator.com/python-wget/)

3\. Run the below commands to add Webmin repository and refresh the package index on your system.

```bash
# adding Webmin repository
sudo sh -c 'echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list'

# refresh package index
sudo apt update
```

![Adding Webmin GPG key, repository, and refresh the package index](https://adamtheautomator.com/wp-content/uploads/2022/03/image-230.png)

Adding Webmin GPG key, repository, and refresh the package index

4\. Lastly, run the `apt` command below to `install webmin`.

```bash
sudo apt install webmin -y
```

As you can see below, Webmin is installed on the Ubuntu system and is running on default port **10000**.

![Installing Webmin](https://adamtheautomator.com/wp-content/uploads/2022/03/image-231.png)

Installing Webmin

## Securing Webmin with SSL Certificates

You’ve now installed Webmin on your system for managing your Linux server. And naturally, you’d want to secure your Webmin installation. But how? You’ll secure Webmin with SSL certificates and Apache reverse proxy.

SSL certificates encrypt connections between client and server, and the Apache reverse proxy keeps Webmin running locally on your server.

> _You can use free SSL certificates from LetsEncrypt. Be sure you have the domain name pointed to your server IP address._

[1\. Generate SSL certificates](https://eff-certbot.readthedocs.io/en/stable/using.html#getting-certificates-and-choosing-plugins) using the [certbot](https://certbot.eff.org/) tool.

2\. Next, run the `apt` command below to `install` the Apache2 web server.

```bash
sudo apt install apache2 -y
```

3\. Run the below command to enable Apache2 modules (`ssl`, `proxy`, and `rewrite`). The Apache2 mod\_ssl (`ssl`) will enable HTTPS on your web server. While mod\_proxy (`proxy`) and mod\_proxy\_http (`proxy_http`) allow you to set up Apache as a reverse proxy for your application.

```bash
sudo a2enmod ssl proxy proxy_http proxy_balancer rewrite
```

![Enabling Apache Modules](https://adamtheautomator.com/wp-content/uploads/2022/03/image-232.png)

Enabling Apache Modules

Now, create a new virtual host configuration (`/etc/apache2/sites-available/webmin.conf`) using your preferred editor and populate the following configuration.

Be sure to change the following values:

*   Change the domain `webmin.example.io` with your domain name.
*   Change the path of the public key certificate (`/etc/letsencrypt/live/webmin.example.io/fullchain.pem`) with your public key certificate.
*   Change the path of the private key 

```powershell
# configuration of Apache2 reverse proxy for Webmin with SSL/HTTPS enabled
<VirtualHost *:80>
    ServerName webmin.example.io
    ErrorLog /var/log/apache2/webmin_error_log
    CustomLog /var/log/apache2/webmin_access_log combined
    RewriteEngine On
    RewriteCond %{SERVER_PORT} =80
    RewriteRule ^/(.*)$ https://%{SERVER_NAME}:443/$1 [R,L]
</VirtualHost>

<VirtualHost *:443>
    ServerName webmin.example.io
    ErrorLog /var/log/apache2/webmin-ssl_error_log
    CustomLog /var/log/apache2/webmin-ssl_access_log combined
    SSLEngine On
    SSLCertificateFile  /etc/letsencrypt/live/webmin.example.io/fullchain.pem
    SSLCertificateKeyFile  /etc/letsencrypt/live/webmin.example.io/privkey.pem
    ProxyRequests Off
    ProxyPreserveHost Off
    SSLProxyEngine On
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    RewriteRule ^/$ / [R]
    ProxyPass / https://127.0.0.1:10000/
    ProxyPassReverse / https://127.0.0.1:10000/

    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
</VirtualHost>
```

5\. Run the following commands to activate the virtual host configuration (`webmin.conf`) and verify the Apache configuration.

```bash
# activate virtual host configuration webmin.conf
sudo a2ensite webmin.conf

# verify Apache2 configuration
sudo apachectl configtest
```

You’ll see the output message below (**Syntax OK**) if your configuration is correct.

![Activating Virtual Host Configuration](https://adamtheautomator.com/wp-content/uploads/2022/03/image-233.png)

Activating Virtual Host Configuration

6\. Execute the `systemctl` command below to `restart` the Apache2 service and apply a new configuration.

```bash
sudo systemctl restart apache2
```

Related:[Controlling Systemd services with Ubuntu systemctl](https://adamtheautomator.com/ubuntu-systemctl/)

7\. Open the Webmin configuration (`/etc/webmin/config`) in your preferred editor and add the following configuration. Make sure to change the `server-ubuntu` with your system hostname.

```powershell
# change the referer to system hostname
referrer=server-ubuntu
```

![Configuring Referer for Webmin](https://adamtheautomator.com/wp-content/uploads/2022/03/image-234.png)

Configuring Referer for Webmin

8\. Now run the below command to `restart` the `webmin` service and apply new changes. `sudo systemctl restart webmin`

```bash
sudo systemctl restart webmin
```

9\. If you have the UFW firewall running on your system, run the below command to add and allow HTTP and HTTPS connections on your firewall.

Related:[How To Set Up the UFW Firewall on Linux](https://adamtheautomator.com/ufw-firewall/)

```bash
# Add HTTP and HTTPS to UFW firewall
sudo ufw allow http
sudo ufw allow https
```

![Opening HTTP and HTTPS Ports UFW Firewall](https://adamtheautomator.com/wp-content/uploads/2022/03/image-236.png)

Opening HTTP and HTTPS Ports UFW Firewall

10\. Lastly, open your web browser and navigate to the domain name of your Webmin (i.e., https://webmin.example.io/).

If your Webmin configuration is correct, you’ll get the Webmin login page as below. Input your root user and password, and click **Sign In** to access the Webmin dashboard.

![Logging in to Webmin as user root ](https://adamtheautomator.com/wp-content/uploads/2022/03/image-237.png)

Logging in to Webmin as user root

After logging in, your browser redirects to the Webmin dashboard as below.

![Viewing Default Webmin Dashboard](https://adamtheautomator.com/wp-content/uploads/2022/03/image-238.png)

Viewing Default Webmin Dashboard

## Managing Users in Webmin

You’ve now installed and secured Webmin on your server, so feel free to create a new user through the Webmin dashboard. Using a non-root user to log in to your server is always recommended for security reasons.

1\. Click on the **System** menu at the left panel, then click **Users and Groups** to see the list of users on your system, as shown below. Click the button **Create a new user** under the Local Users tab to create a new user.

![Creating a New User with Webmin](https://adamtheautomator.com/wp-content/uploads/2022/03/image-239.png)

Creating a New User with Webmin

2\. On the **User Details** section, input the **Username**, default **Shell**, and **Password** you prefer.

![Filling up User Details for New User](https://adamtheautomator.com/wp-content/uploads/2022/03/image-240.png)

Filling up User Details for New User

3\. Move to the **Group Membership** section, add the **sudo** group to your new user, then click **Create** to confirm and create a new user. This action allows the new user (john) to manage and administer the server using the Webmin dashboard.

![Adding sudo Group to New Use](https://adamtheautomator.com/wp-content/uploads/2022/03/image-241.png)

Adding sudo Group to New Use

![Confirming to Create a New User](https://adamtheautomator.com/wp-content/uploads/2022/03/image-242.png)

Confirming to Create a New User

4\. Next, click the **Sign out** button to log out from the Webmin dashboard.

![Logging out from Webmin root](https://adamtheautomator.com/wp-content/uploads/2022/03/image-243.png)

Logging out from Webmin root

5\. Log in again to the Webmin dashboard, but this time login with the new user `john` and the password you set for the user (`StrongPassword`).

![Logging into Webmin with user john ](https://adamtheautomator.com/wp-content/uploads/2022/03/image-244.png)

Logging into Webmin with user john

You should get the Webmin dashboard, as shown below, after logging in with the new user (john).

![Webmin Dashboard of the new user (john)](https://adamtheautomator.com/wp-content/uploads/2022/03/image-245.png)

Webmin Dashboard of the new user (john)

## Setting up Package Updates

Apart from managing users in Webmin, you can also set up a package update to ensure you’re using the latest version of packages on your system and the latest patches.

1\. Click the **System** menu and click on **Software Package Updates** to see packages with available updates.

2\. On the **Packages Updates** tab, click the button **Update Selected Packages** and update all packages manually.

![Updating Packages from Webmin](https://adamtheautomator.com/wp-content/uploads/2022/03/image-246.png)

Updating Packages from Webmin

3\. Now click **Install Now** to apply a new update.

![Confirming package updates ](https://adamtheautomator.com/wp-content/uploads/2022/03/image-247.png)

Confirming package updates

The update will run on your web browser, as shown below. Wait until all packages updates are completed.

![Viewing Running Package Updates](https://adamtheautomator.com/wp-content/uploads/2022/03/image-248.png)

Viewing Running Package Updates

4\. Next, move to the **Scheduled Upgrades** tab and configure an automatic package update with the following:

*   Select **Yes, every** option, then select the time for the update to **day**.
*   Select the **Install any updates** option as Webmin’s action when updates are needed.At this point, the automatic updates will keep your packages updated to the latest version every day.

![Setting up Automatic Updates](https://adamtheautomator.com/wp-content/uploads/2022/03/image-249.png)

Setting up Automatic Updates

## Creating a New Virtual Host

Updating packages on Webmin is out of the way, and as preparation for installing PHP web applications, you’ll need to install the LAMP Stack. You’ll create a virtual host for your domain name via the Webmin dashboard.

1\. Click the **Refresh Modules** button to reload Webmin modules and apply the Apache2 web server module.

![Refreshing Webmin Modules](https://adamtheautomator.com/wp-content/uploads/2022/03/image-250.png)

Refreshing Webmin Modules

2\. Next, click on the **Tools** menu, then click **File Manager** to access your system’s **File Manager**.

Select the _/var/www/_ directory, click the **File** menu and select **Create new directory** to initialize creating a new directory.

![Creating a new DocumentRoot directory](https://adamtheautomator.com/wp-content/uploads/2022/03/image-251.png)

Creating a new DocumentRoot directory

3\. Input new directory name, and click **Create**. This demo sets the directory name as **example.io**. This directory will be used as the DocumentRoot directory for the _example.io_ domain.

![Creating a new DocumentRoot Directory (example.io)](https://adamtheautomator.com/wp-content/uploads/2022/03/image-252.png)

Creating a new DocumentRoot Directory (_[example.io](http://example.io)_)

4\. Now, click the **example.io** directory, click the **File** drop-down button and select **Create new file**.

![Creating a New File](https://adamtheautomator.com/wp-content/uploads/2022/03/image-253.png)

Creating a New File

5\. Input a unique file name, but this demo sets the file name as **index.html**. Click on **Create** to finalize creating the file. This file will be the default _index.html_ file for the _example.io_ domain.

After creating the _index.html_ file, Webmin opens the file to a text editor (step six).

![Creating index.html for domain example.io](https://adamtheautomator.com/wp-content/uploads/2022/03/image-254.png)

Creating _index.html_ for domain _example.io_

6\. Populate the following HTML script to the _index.html_ file and click the **Save** icon. `<center><h1>Index.html for example.io</h1></center>`

```markup
<center><h1>Index.html for example.io</h1></center>
```

![Populating HTML script for index.html file](https://adamtheautomator.com/wp-content/uploads/2022/03/image-255.png)

Populating HTML script for _index.html_ file

7\. Next, click on the menu **Servers**, then click **Apache Webserver** to access the page where you’ll create a virtual host.

Click on the **Create virtual host** tab and input details for virtual host configuration as below, then click on **Create Now** to confirm and create a new virtual host:

*   Port: **80**
*   Document Root: **/var/www/example.io**
*   Server Name: **example.io**

![Creating a new virtual host](https://adamtheautomator.com/wp-content/uploads/2022/03/image-256.png)

Creating a new virtual host

8\. Now, click the reload button (top right) to reload the Apache webserver and apply new changes.

![Reloading Apache Webserver](https://adamtheautomator.com/wp-content/uploads/2022/03/image-257.png)

Reloading Apache Webserver

9\. Lastly, open a new tab and visit your virtual host domain name (i.e., [](http://example.io/)_http://example.io_), and you should get the default _index.html_ for your domain name.

![Testing index.html File for example.io Domain](https://adamtheautomator.com/wp-content/uploads/2022/03/image-258.png)

Testing _index.html_ File for _example.io_ Domain

## Installing MySQL Server for Database Backend

You’ve successfully created Apache virtual host for your domain name. And in case you plan to install web applications, such as WordPress, Joomla, or Magento, you’ll need to install the MySQL server for the database backend.

Click on the **Un-used Modules** menu —> **MySQL Database Server**, and click the **Install Now** button to initialize installing MySQL server packages. This action will populate all packages and dependencies for the MySQL server.

![Installing MySQL Server](https://adamtheautomator.com/wp-content/uploads/2022/03/image-259.png)

Installing MySQL Server

2\. Next, click the **Install Now** button to confirm the package and dependency installations.

![Confirming MySQL Server installation](https://adamtheautomator.com/wp-content/uploads/2022/03/image-260.png)

Confirming MySQL Server installation

3\. Once installed, click the **Refresh Modules** menu to reload all installed modules on Webmin.

![Refreshing Webmin Modules](https://adamtheautomator.com/wp-content/uploads/2022/03/image-261.png)

Refreshing Webmin Modules

4\. Now, click the **Servers** menu —> **MySQL Database Server**, then click the **Change Administration Password** option under the **Global Options** section. This action redirects your browser to a page where you’ll set an admin password to secure your MySQL server (step five).

![Setting up MySQL Server](https://adamtheautomator.com/wp-content/uploads/2022/03/image-262.png)

Setting up MySQL Server

5\. Lastly, input a new password for the MySQL root user, repeat the password, and click the **Change Now** to confirm.

Setting up a MySQL root password is recommended to improve the security of your MySQL database server.

![Setting up MySQL root password](https://adamtheautomator.com/wp-content/uploads/2022/03/image-263.png)

Setting up MySQL root password

## Installing PHP to Support PHP-Based Web Applications

You’ve completed installing MySQL server with Webmin for the database backend. But to support PHP-based web applications, similar to installing MySQL server, you’ll need to install PHP packages from Webmin Dashboard.

1\. Initialize installing PHP with the following:

*   Click the **System** menu and select **Software Packages** to access the page where you’ll install new packages.
*   On the **Install a New Package** section, select the **Package from APT** option and input the package names **php** and **php-mysql**. The MySQL module (**php-mysql)** for PHP allows your PHP applications to use MySQL/MariaDB as the database backend.
*   Click **Install** to install PHP packages.

![Installing PHP using Webmin](https://adamtheautomator.com/wp-content/uploads/2022/03/image-264.png)

Installing PHP using Webmin

2\. Next, click **Install Now** to confirm and install PHP packages.

![Confirming to Install php and php-mysql Packages](https://adamtheautomator.com/wp-content/uploads/2022/03/image-265.png)

Confirming to Install php and php-mysql Packages

3\. After installing the packages, click the **Refresh Modules** menu to reload Webmin modules and apply new changes.

![Refreshing Webmin Modules and Applying New Changes](https://adamtheautomator.com/wp-content/uploads/2022/03/image-266.png)

Refreshing Webmin Modules and Applying New Changes

4\. Lastly, click the **Tools** menu and select **PHP Configuration** to see the page managing the _php.ini_ configuration.

You can now edit the _php.ini_ configuration manually or use the graphical menu from Webmin.

![ Viewing Webmin PHP Configuration](https://adamtheautomator.com/wp-content/uploads/2022/03/image-267.png)

Viewing Webmin PHP Configuration

## Verifying Apache2 Web Server and PHP

By now, you’ve completely installed packages in Webmin. But how do you verify the PHP and Apache2 web server work? Create a new _phpinfo_ file with Webmin to check your PHP installation information.

1\. Click on the **Tools** menu, select **File Manager**, and look for the _/var/www/example.io_ file.

Select the _/var/www/example.io_ file, click the **File** drop-down menu and select **Create New File** to initialize creating a new file.

![Creating a New File](https://adamtheautomator.com/wp-content/uploads/2022/03/image-268.png)

Creating a New File

2\. Next, input the new file name as **info.php** and click **Create**, as shown below, to finalize creating the file. The _info.php_ file automatically opens in a text editor.

![Naming the New File (info.php)](https://adamtheautomator.com/wp-content/uploads/2022/03/image-269.png)

Naming the New File (_info.php_)

3\. Populate the below PHP script to the _info.php_ file, then click the **Save** button to confirm and save the file. The code below checks information about your PHP installation. `<?php phpinfo(); ?>`

```php
<?php
phpinfo();
?>
```

![Creating the info.php File to Check PHP Installation](https://adamtheautomator.com/wp-content/uploads/2022/03/image-270.png)

Creating the _info.php_ File to Check PHP Installation

4\. Finally, open a new tab on your web browser and visit your domain name (i.e., http://example.io/) followed by the URL path _/info.php_.

If your Apache2 and PHP installation are successful, you should see the PHP info page below.

![Verifying Apache2 and PHP installation with phpinfo](https://adamtheautomator.com/wp-content/uploads/2022/03/image-271.png)

Verifying Apache2 and PHP installation with phpinfo

## Conclusion

You’ve learned how to install and secure Webmin with Apache reverse proxy throughout this tutorial. You’ve also touched on managing users and keeping your packages updated with the automatic update feature in Webmin.

In addition, you’ve configured the LAMP Stack through the Webmin dashboard, so now you’re ready to deploy your PHP web applications.

Now, why not set up [NFS Mount](https://doxfer.webmin.com/Webmin/NFS_Exports), manage [LDAP server](https://doxfer.webmin.com/Webmin/LDAP_Server), and [Mail server](https://doxfer.webmin.com/Webmin/Postfix_Mail_Server)?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Finstall-webmin%2F&text=How%20to%20Install%20Webmin%20on%20Ubuntu%20Linux)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Finstall-webmin%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Finstall-webmin%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2022/04/Getting-Started-with-Grafana-Prometheus-Kubernetes-Cluster-Monitoring-1.jpg)

### [Utilizing Grafana & Prometheus Kubernetes Cluster Monitoring](/prometheus-kubernetes/)

Learn how to effectively monitor your Grafana and Prometheus Kubernetes cluster in this tutorial!

![](https://adamtheautomator.com/wp-content/uploads/2022/09/Practical-Linux-Unix-Tee-Commands-for-the-Linux-Admin.jpg)

### [Master Unix tee Commands for Real-World Linux Admin Tasks](/unix-tee/)

Simplify Linux output management and streamline your workflow with the “Unix tee” command. This tutorial guides you through its practical applications.

![](https://adamtheautomator.com/wp-content/uploads/2024/03/openldap-4.jpg)

### [How to Install and Configure an OpenLDAP Ubuntu Server](/openldap/)

Unlock the power of OpenLDAP on Ubuntu for centralized user authentication, seamless access control management, and enhanced directory services!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
