Installing Webmin on Ubuntu Server | Information Technology from Valdemar

This article is written for those who were searching for a detailed and simple for the understanding guide on how to install Webmin on Ubuntu Server.

Webmin is an open-source control panel that allows you to manage your server based on the Linux or Windows operating system through an easy-to-use web interface. Webmin allows you to manage users, groups, disk quotas, create files and directories, and configure the most popular services, including web servers, FTP, email, and database servers.

In this guide, we will consider the case when you already have a server with the Ubuntu Server 18.04 LTS operating system installed on it.

You can read more about how to install Ubuntu Server 18.04 LTS in my guide «Installing Ubuntu Server 18.04 LTS».

In addition, OpenSSH must be installed on the server, and port 22 must be open in order to be able to connect to the server using the SSH protocol.

To install OpenSSH on the server, you can use the command:

sudo apt-get install openssh-server

If you plan to connect to the server using the Windows operating system, you can use PuTTY, a freeware client for various remote access protocols, including SSH, Telnet, rlogin.

This guide covers connecting to a server using the iTerm2 terminal emulator installed on the macOS operating system.

Please note that you will need to open the following TCP ports to access your server:

  • 80 – to receive a free cryptographic certificate through the Let’s Encrypt certificate authority.
  • 443 – to access the Multicraft control panel.
  • 10000 – to access the Webmin web interface.

Connect to the server on which it is planned to install Webmin.

This guide discusses how to obtain a free cryptographic certificate through the Let’s Encrypt Certificate Authority. To receive and further update the free SSL certificate, we will use the Certbot software client, which is designed to simplify the receipt and renewal of the certificate through the Let’s Encrypt certificate authority.

Add the Certbot repository using the command:

sudo add-apt-repository ppa:certbot/certbot

Press the “Enter” button to confirm the addition of a new repository.

Next, you need to add the repository from which you can install the Webmin control panel. To do this, add a link to the repository in the file “sources.list”.

Make changes to the “sources.list” file by opening it in a text editor using the command:

sudo vim /etc/apt/sources.list

Next, at the end of the file, specify the address of the repository from which you can install the Webmin control panel:

deb http://download.webmin.com/download/repository sarge contrib

Now press the “Esc” button to exit the editing mode, and then enter “: x” and press the “Enter” button to save the changes and exit the editor.

Next, you need to download and then import the repository key.

Download the repository key using the command:

sudo wget http://www.webmin.com/jcameron-key.asc

Import the repository key using the command:

sudo apt-key add jcameron-key.asc

Now update the local package index to the latest changes in the repositories using the command:

sudo apt-get update

Now install Webmin and the packages necessary for the control panel to work using the command:

sudo apt-get install -y apache2 certbot python-certbot-apache webmin

At this stage, you can fully use the Webmin control panel at https://webmin.otrs.heyvaldemar.net:10000, where webmin.otrs.heyvaldemar.net is the name of my subdomain for accessing the Webmin control panel. To access the control panel, you will need to specify the username and password of an account that has administrator rights on your server and click on the “Sign in” button.

Next, we will implement the ability to use Webmin at https://webmin.otrs.heyvaldemar.net, without specifying port 10000 in the address bar of the browser, and also increase the security level of the webserver by receiving a cryptographic certificate for the domain or subdomain by which the control panel Webmin is available from the Internet.

In this manual, the webmin.otrs.heyvaldemar.net subdomain will be used to access the Webmin control panel from the Internet. You will need to specify your domain or subdomain by which your Webmin control panel will be accessible from the Internet.

We will make changes to the two configuration files of the Webmin control panel to ensure the correct operation.

Open the first Webmin configuration file in a text editor using the command:

sudo vim /etc/webmin/miniserv.conf

Press the “i” button to enter the editing mode, find the “ssl” parameter and change its value to “0”.

Please note that at this step we disable the use of SSL in Webmin, as this functionality will be implemented using Apache.

Now press the “Esc” button to exit the editing mode, and then enter “: x” and press the “Enter” button to save the changes and exit the editor.

Open the second Webmin configuration file in a text editor using the command:

sudo vim /etc/webmin/config

Next, at the end of the file, specify an additional parameter:

referers=webmin.otrs.heyvaldemar.net

In this manual, the webmin.otrs.heyvaldemar.net subdomain will be used to access the Webmin control panel from the Internet. You will need to specify your domain or subdomain by which your Webmin control panel will be accessible from the Internet.

Now press the “Esc” button to exit the editing mode, and then enter “: x” and press the “Enter” button to save the changes and exit the editor.

Restart Webmin to apply the changes using the command:

sudo systemctl restart webmin

Verify that Webmin has started successfully using the command:

sudo systemctl status webmin

Configure Apache for further work with the Webmin control panel.

Enable the Apache webserver module called “proxy_http” with the command:

sudo a2enmod proxy_http

Please note that the “proxy_http” module acts like a proxy server for the HTTP and HTTPS protocols.

Enable the Apache webserver module called “rewrite” with the command:

sudo a2enmod rewrite

Please note that the “rewrite” module is one of the most commonly used Apache webserver modules and provides a flexible and powerful way to manipulate URLs.

Now you need to create two virtual host files (called block in Nginx), with which Webmin will continue to work.

Two virtual host files will be required to provide access to Webmin via HTTPS, as well as to realize the possibility of using Webmin at https://webmin.otrs.heyvaldemar.net, without specifying port 10000 in the address bar of the browser.

In this manual, the webmin.otrs.heyvaldemar.net subdomain will be used to access the Webmin control panel from the Internet. You will need to specify your domain or subdomain by which your Webmin control panel will be accessible from the Internet.

Create the first virtual host file using a text editor using the command:

sudo vim /etc/apache2/sites-available/webmin.otrs.heyvaldemar.net.conf

Press the “i” button to enter the editing mode, then insert the following configuration for the webserver to work:

In this manual, the webmin.otrs.heyvaldemar.net subdomain will be used to access the Webmin control panel from the Internet. You will need to specify your domain or subdomain by which your Webmin control panel will be accessible from the Internet.

Now press the “Esc” button to exit the editing mode, and then enter “: x” and press the “Enter” button to save the changes and exit the editor.

Create a second virtual host file using a text editor using the command:

sudo vim /etc/apache2/sites-available/webmin.otrs.heyvaldemar.net-ssl.conf

Press the “i” button to enter the editing mode, then insert the following configuration for the web server to work:

In this manual, the webmin.otrs.heyvaldemar.net subdomain will be used to access the Webmin control panel from the Internet. You will need to specify your domain or subdomain by which your Webmin control panel will be accessible from the Internet.

Now press the “Esc” button to exit the editing mode, and then enter “: x” and press the “Enter” button to save the changes and exit the editor.

Activate the first virtual host using the command:

sudo a2ensite webmin.otrs.heyvaldemar.net.conf

Activate the second virtual host using the command:

sudo a2ensite webmin.otrs.heyvaldemar.net-ssl.conf

Deactivate the default virtual host using the command:

sudo a2dissite 000-default.conf

Make sure that there are no errors in the syntax of the new Apache configuration file using the command:

sudo apache2ctl configtest

Restart Apache to apply the changes using the command:

sudo systemctl restart apache2

Verify that Apache started successfully using the command:

sudo systemctl status apache2

Now, to increase the security level of the webserver, it is necessary to obtain a cryptographic certificate for the domain or subdomain, through which the Webmin control panel will be accessible from the Internet.

To obtain and subsequently renew a free SSL certificate, we will use the Let’s Encrypt Certificate Authority, as well as the Certbot software client, which is designed to simplify the receipt and renewal of the certificate through the Let’s Encrypt Certificate Authority.

In this manual, the webmin.otrs.heyvaldemar.net subdomain will be used to access the Webmin control panel from the Internet. You will need to specify your domain or subdomain by which your Webmin control panel will be accessible from the Internet.

Request a cryptographic certificate using the command:

sudo certbot --apache -d webmin.otrs.heyvaldemar.net

Next, indicate the email address to which Let’s Encrypt will send notifications about the expiration of the cryptographic certificate and press the “Enter” button.

The next step is to read and accept the terms of use of the services provided.

Press the “a” button, then “Enter” if you agree to the terms of use of the services provided.

At the next stage, you need to choose: do you want to share the email address indicated above with the Electronic Frontier Foundation to receive newsletters.

Press the “n” button, then “Enter”.

The next step is to choose: do you want the parameters to automatically redirect HTTP traffic to HTTPS be automatically added to the Apache configuration file.

Press the button “1”, then “Enter”.

Please note that the cryptographic certificates received through the Let’s Encrypt Certificate Authority are valid for ninety days. Certbot automatically adds a script to renew the certificate in the task scheduler, and the script runs twice a day, automatically updating any cryptographic certificate that expires within thirty days.

You can check the operability of the cryptographic certificate renewal process using the command:

sudo certbot renew --dry-run

From the workstation, follow the link https://webmin.otrs.heyvaldemar.net, where webmin.otrs.heyvaldemar.net is the name of my subdomain for accessing the Webmin control panel. You will need to specify your domain or subdomain by which your Webmin control panel will be accessible from the Internet.

Next, you need to specify the username and password of an account that has administrator rights on your server and click on the “Sign in” button.

Welcome to the Webmin control panel.

Now you can manage users, groups, disk quotas, create files and directories, and configure the most popular services, including web servers, FTP, email, and database servers.

Author

Hi, I’m Vladimir Mikhalev, but my friends call me Valdemar. I have a lot of experience in the design and maintenance of various information systems. On my website, you will find detailed and clear guides for setting up IT solutions. Dive into the ocean, full of positive and technology! For cooperation: callvaldemar@gmail.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.